summaryrefslogtreecommitdiffstats
path: root/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml
diff options
context:
space:
mode:
authorddomingo <ddomingo@redhat.com>2008-10-28 14:04:21 +1000
committerddomingo <ddomingo@redhat.com>2008-10-28 14:04:21 +1000
commitfc03e8e8d406640d6dfa73f9e3890086c9bfb75f (patch)
treec2e4fb656f94dbc71ddaeb6f28f060e8ec109fad /doc/SystemTap_Beginners_Guide/en-US/Scripts.xml
parent709fde54c8c296d537e58af4bc619b18c654f6a2 (diff)
downloadsystemtap-steved-fc03e8e8d406640d6dfa73f9e3890086c9bfb75f.tar.gz
systemtap-steved-fc03e8e8d406640d6dfa73f9e3890086c9bfb75f.tar.xz
systemtap-steved-fc03e8e8d406640d6dfa73f9e3890086c9bfb75f.zip
changes as per wcohen, minor additions
Diffstat (limited to 'doc/SystemTap_Beginners_Guide/en-US/Scripts.xml')
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Scripts.xml21
1 files changed, 18 insertions, 3 deletions
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml
index fad12dee..ca360e06 100644
--- a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml
+++ b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml
@@ -38,9 +38,23 @@
SystemTap scripts use the file extension <filename>.stp</filename>, and are written in the following format:
</para>
</formalpara>
-<programlisting>
+<screen>
probe <replaceable>event</replaceable>, {<replaceable>handler</replaceable>}
-</programlisting>
+</screen>
+
+<para>
+ Sometimes, you may need to recycle a handler accross multiple probes. Rather than rewrite handler statements accross probes, you can simply recycle them using <firstterm>functions</firstterm>, as in:
+</para>
+
+<screen>
+function <replaceable>function_name</replaceable> {<replaceable>handler1</replaceable>}
+probe <replaceable>event</replaceable> {<replaceable>function_name</replaceable>}
+</screen>
+
+<para>Here, the probe executes <command><replaceable>handler1</replaceable></command> as the handler for the probed <command><replaceable>event</replaceable></command>.</para>
+
+
+
<!--
<para>The <replaceable>exit()</replaceable> condition is optional; this condition safely terminates the session once the script successfully collects the required information the first time.</para>
-->
@@ -353,13 +367,14 @@ hald(2360) open
<para>A string describing the probe point currently being handled.</para>
</listitem>
</varlistentry>
-
+<!-- removed, doesnt work as expected anymore
<varlistentry>
<term>probefunc()</term>
<listitem>
<para>If known, the name of the function in which the probe was placed.</para>
</listitem>
</varlistentry>
+-->
<varlistentry>
<term>thread_indent()</term>