diff options
author | Dave Brolley <brolley@redhat.com> | 2008-09-09 15:09:47 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2008-09-09 15:09:47 -0400 |
commit | bb997bd81d90b94e734c8c93402353eddd0bc408 (patch) | |
tree | 4e57cbf3adab36130ab242538fe6bbc79c243798 | |
parent | 13e6d2152e5aca18e4fd1d0d5f8c6b280f995763 (diff) | |
parent | 67a66a8b72d19dc1a1fd10db1c55e31a6e93b270 (diff) | |
download | systemtap-steved-bb997bd81d90b94e734c8c93402353eddd0bc408.tar.gz systemtap-steved-bb997bd81d90b94e734c8c93402353eddd0bc408.tar.xz systemtap-steved-bb997bd81d90b94e734c8c93402353eddd0bc408.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | doc/SystemTap_Beginners_Guide/en-US/Scripts.xml | 46 | ||||
-rw-r--r-- | doc/SystemTap_Beginners_Guide/en-US/Understanding_How_SystemTap_Works.xml | 7 | ||||
-rw-r--r-- | runtime/ChangeLog | 5 | ||||
-rw-r--r-- | runtime/sym.c | 2 |
5 files changed, 57 insertions, 5 deletions
@@ -1,7 +1,7 @@ * What's new - Target process mode (stap -c CMD or -x PID) now implicitly restricts all - "process.*" probes to the given child process. (It does not effect + "process.*" probes to the given child process. (It does not affect kernel.* or other probe types.) The CMD string is now executed directly, rather than via a /bin/sh -c subshell. diff --git a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml new file mode 100644 index 00000000..abb087bc --- /dev/null +++ b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml @@ -0,0 +1,46 @@ +<?xml version='1.0'?> +<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ +]> + +<section id="scripts"> + <title>SystemTap Scripts</title> + + <para> + For the most part, SystemTap scripts are the foundation of each SystemTap session. The SystemTap scripts you use or write yourself instruct SystemTap on what type of information to trap, and what to do once that information is trapped. + </para> + + <para> + As stated in <xref linkend="understanding-how-systemtap-works"/>, SystemTap scripts are made up of two components: <emphasis>events</emphasis> and <emphasis>handlers</emphasis>. Once a SystemTap session is underway, SystemTap monitors the operating system for the specified events and executes the handlers as they occur. + </para> + +<note> + <title>Note</title> + <para>An event and its corresponding handler is collectively called a <emphasis>probe</emphasis>. A SystemTap script can have multiple probes, in the same manner that each event can have multiple corresponding handlers.</para> +</note> + + <para> + In terms of application development, using events and handlers is similar to inserting <command>print</command> statements in a program's sequence of commands. These <command>print</command> statements allow you to view a history of commands executed once the program is run. + </para> + + <para> + SystemTap scripts go one step further by allowing you more flexibility with regard to handlers. Events serve as the triggers for handlers to run; handlers can be specified to trap specified data and print it in a certain manner. + </para> + + + + <section id="systemtapscript-format"> + <title>Format</title> + <para> + SystemTap scripts use the following format: + </para> + </section> + + <!-- <section id="SystemTap_Beginners_Guide-Test-Section_2_Test"> + <title>Section 2 Test</title> + <para> + Test of a section + </para> + </section>--> + +</section> + diff --git a/doc/SystemTap_Beginners_Guide/en-US/Understanding_How_SystemTap_Works.xml b/doc/SystemTap_Beginners_Guide/en-US/Understanding_How_SystemTap_Works.xml index e418f561..de5d41b0 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Understanding_How_SystemTap_Works.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Understanding_How_SystemTap_Works.xml @@ -41,10 +41,11 @@ <step><para>Once the SystemTap session is terminated, the hooked events are disconnected from the kernel; afterwards, the kernel module is unloaded.</para></step> </procedure> -<para>This sequence is driver from a single command-line program: <command>stap</command>. This program is SystemTap's main front-end tool. For more information about <command>stap</command>, refer to <command>man stap</command> (once SystemTap is set up on your machine).</para> +<para>This sequence is driven from a single command-line program: <command>stap</command>. This program is SystemTap's main front-end tool. For more information about <command>stap</command>, refer to <command>man stap</command> (once SystemTap is set up on your machine).</para> </section> - +<xi:include href="Scripts.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> +<!-- <section id="understanding-scripts"> <title>SystemTap Scripts</title> @@ -52,7 +53,7 @@ ** definition, significance, structure, very basic examples, reference to later chapter (how to read library of preset SystemTap scripts in this book, using them) </remark> </section> - + --> <section id="understanding-tapsets"> <title>Tapsets</title> diff --git a/runtime/ChangeLog b/runtime/ChangeLog index eb091d01..71cd97e4 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,8 @@ +2008-09-09 Mark Wielaard <mwielaard@redhat.com> + + * sym.c (_stp_kallsyms_lookup): Correct this_section_offset + calculation. + 2008-09-08 Tim Moore <timoore@redhat.com> PR 1288 diff --git a/runtime/sym.c b/runtime/sym.c index dcdbaf69..b594d9c2 100644 --- a/runtime/sym.c +++ b/runtime/sym.c @@ -98,7 +98,7 @@ static const char *_stp_kallsyms_lookup(unsigned long addr, unsigned long *symbo unsigned long this_section_addr = _stp_modules[midx]->sections[secidx].addr; unsigned long this_section_offset; if (addr < this_section_addr) continue; - this_section_offset = this_section_addr - addr; + this_section_offset = addr - this_section_addr; if (this_section_offset < closest_section_offset) { closest_section_offset = this_section_offset; |