summaryrefslogtreecommitdiffstats
path: root/doc/SystemTap_Beginners_Guide
diff options
context:
space:
mode:
authorddomingo <ddomingo@redhat.com>2008-09-15 15:21:57 +1000
committerddomingo <ddomingo@redhat.com>2008-09-15 15:21:57 +1000
commit6d24a6c909520290b1c508ae1624a218f19e93f1 (patch)
tree7362bd94c467203cfeb1979b212581d289dc4e18 /doc/SystemTap_Beginners_Guide
parent58b5c08a69fa298a92ead6d9384415ff750ea2ef (diff)
downloadsystemtap-steved-6d24a6c909520290b1c508ae1624a218f19e93f1.tar.gz
systemtap-steved-6d24a6c909520290b1c508ae1624a218f19e93f1.tar.xz
systemtap-steved-6d24a6c909520290b1c508ae1624a218f19e93f1.zip
minor revisions as per dsmith
Diffstat (limited to 'doc/SystemTap_Beginners_Guide')
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Introduction.xml4
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Scripts.xml39
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Understanding_How_SystemTap_Works.xml2
3 files changed, 36 insertions, 9 deletions
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Introduction.xml b/doc/SystemTap_Beginners_Guide/en-US/Introduction.xml
index 6f1b2a0a..b19f5e48 100644
--- a/doc/SystemTap_Beginners_Guide/en-US/Introduction.xml
+++ b/doc/SystemTap_Beginners_Guide/en-US/Introduction.xml
@@ -5,7 +5,7 @@
<chapter id="introduction">
<title>Introduction</title>
<para>
- SystemTap is a tracing and probing tool that provides users deep technical insight into what the operating system (particularly, the kernel) is doing at any given time. It provides information similar to the output of tools like <command>netstat</command>, <command>ps</command>, <command>top</command>, and <command>iostat</command>; however, SystemTap is designed to provide information that is more "granular" in nature.
+ SystemTap is a tracing and probing tool that provides users to study and monitor the activities of the operating system (particularly, the kernel) in fine detail. It provides information similar to the output of tools like <command>netstat</command>, <command>ps</command>, <command>top</command>, and <command>iostat</command>; however, SystemTap is designed to provide information that is more "granular" in nature.
</para>
<para>
@@ -23,7 +23,7 @@
<para>Without SystemTap, monitoring the activity of a running kernel would require a tedious instrument, recompile, install, and reboot sequence. SystemTap is designed to eliminate this, allowing users to gather the same information by simply running its suite of tools against specific <firstterm>tapsets</firstterm> or SystemTap scripts.</para>
- <para>However, SystemTap was initially designed for users with intermediate to advanced knowledge of the kernel. This could present a steep learning curve for administrators or developers whose knowledge of the Linux kernel is little to none.</para>
+ <para>However, SystemTap was initially designed for users with intermediate to advanced knowledge of the kernel. As such, much of the existing documentation for SystemTap is primarily for advanced users. This could present a steep learning curve for administrators or developers whose knowledge of the Linux kernel is little to none.</para>
<para>In line with that, the main goals of the <citetitle>SystemTap Beginner's Guide</citetitle> are as follows:</para>
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml
index bed0bd06..8426dc70 100644
--- a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml
+++ b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml
@@ -13,9 +13,12 @@
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.</para>
+
+ <para>A probe's handler is also commonly referred to as a <emphasis>probe body</emphasis>.</para>
</note>
<para>
@@ -92,11 +95,34 @@ probe kernel.function("*@net/socket.c").return { }
<varlistentry>
<term>syscall.<replaceable>[system_call]</replaceable></term>
<listitem>
- <para>The entry to the system call <replaceable>[system_call]</replaceable>. Similar to <command>kerne.function</command>, appending a <command>return</command> to the statement specifies the exit of the system call. For example, to specify the entry of the system call <command>close</command>, use <command>syscall.close.return</command>.</para>
+ <para>The entry to the system call <replaceable>[system_call]</replaceable>. Similar to <command>kernel.function</command>, appending a <command>return</command> to the statement specifies the exit of the system call. For example, to specify the entry of the system call <command>close</command>, use <command>syscall.close.return</command>.</para>
<para>To identify what system calls are made by a specific program/command, use <command>strace <replaceable>command</replaceable></command>.</para>
</listitem>
</varlistentry>
+
+<varlistentry>
+ <term>timer.ms()</term>
+ <listitem>
+ <para>An event that specifies a handler to be executed "after X number of milliseconds". For example:</para>
+
+<example id="timer"><title>Using timer.ms</title>
+<programlisting>
+probe timer.ms(4000)
+{
+ exit()
+}
+</programlisting>
+</example>
+
+<para>
+ <xref linkend="timer"/> is an example of a probe that allows you to terminate the script after 4000 milliseconds (or 4 seconds). When used in conjunction with another probe that traps a large quantity of data, a probe using <command>timer.ms()</command> allows you to limit the information your script is collecting (and printing out).
+</para>
+
+ </listitem>
+</varlistentry>
+
+<!--<remark>add timer.ms() to events list!</remark>-->
<!--
<varlistentry>
<term></term>
@@ -119,7 +145,7 @@ probe kernel.function("*@net/socket.c").return { }
</section>
<section id="systemtapscript-handlers">
- <title>Handlers</title>
+ <title>Handlers/Probe Body</title>
<para>
Consider the following sample script:
@@ -169,10 +195,11 @@ printf ("<replaceable>[format string]</replaceable>\n", <replaceable>[argument]<
<title>Using Variables In printf ( ) Statements</title>
<programlisting>
# This probe will need to be manually terminated with Ctrl-C
-probe syscall.open
-{
- printf ("%s(%d) open\n", execname(), pid())
-}
+probe syscall.open
+{
+ printf ("%s(%d) open\n", execname(), pid())
+}
+
</programlisting>
</example>
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 de5d41b0..76296507 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
@@ -34,7 +34,7 @@
<title>SystemTap Session</title>
<step><para>SystemTap first translates the script to C, running the system C compiler to create a kernel module from it.</para></step>
- <step><para>SystemTap then loads the module, then enables all the probed events by "hooking" those events into the kernel.</para></step>
+ <step><para>SystemTap loads the module, then enables all the probed events by "hooking" those events into the kernel.</para></step>
<step><para>As the events occur, their corresponding handlers are executed.</para></step>