summaryrefslogtreecommitdiffstats
path: root/doc/SystemTap_Beginners_Guide
diff options
context:
space:
mode:
authorddomingo <ddomingo@redhat.com>2008-11-28 09:47:00 +1000
committerddomingo <ddomingo@redhat.com>2008-11-28 09:47:00 +1000
commitbe7fd6299b45a46c9dc56bd6bd2ddb5b0afd9362 (patch)
treee8d5dec862ba37f46a1b3ce2fc27ae580b7fed9e /doc/SystemTap_Beginners_Guide
parent021dcea6a8cf44ca4a2e7a3d6f76fc1b8a9c88da (diff)
downloadsystemtap-steved-be7fd6299b45a46c9dc56bd6bd2ddb5b0afd9362.tar.gz
systemtap-steved-be7fd6299b45a46c9dc56bd6bd2ddb5b0afd9362.tar.xz
systemtap-steved-be7fd6299b45a46c9dc56bd6bd2ddb5b0afd9362.zip
more indexes
Diffstat (limited to 'doc/SystemTap_Beginners_Guide')
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Scripts.xml12
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-functioncalls.xml41
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-futexes.xml63
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch.xml79
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch2.xml27
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-nettop.xml42
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-sockettrace.xml42
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-threadtimes.xml41
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-traceio2.xml6
9 files changed, 338 insertions, 15 deletions
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml
index 233dc069..e6ffc4ef 100644
--- a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml
+++ b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml
@@ -957,6 +957,18 @@ probe kernel.function("*@net/socket.c").return
4775 ftp(7223): &lt;- sys_socketcall
</screen>
+<para>This sample output contains the following information:</para>
+
+<itemizedlist>
+ <listitem><para>The time delta (in microseconds) since the previous entry; i.e. the number of microseconds since the last traced function call.</para></listitem>
+
+ <listitem><para>The process name (and its corresponding ID) that made the function call.</para></listitem>
+
+ <listitem><para>An arrow signifying whether the call was an entry (<computeroutput>&lt;-</computeroutput>) or an exit (<computeroutput>-></computeroutput>); the indentations help you match specific function call entries with their corresponding exits.</para></listitem>
+
+ <listitem><para>The name of the function called by the process.</para></listitem>
+</itemizedlist>
+
<remark>remember to add a reference later to "tapsets" from here, to clarify
that thread_indent is defined in tapsets as a special function of sorts</remark>
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-functioncalls.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-functioncalls.xml
index bcab2c47..6a5c8f4d 100644
--- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-functioncalls.xml
+++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-functioncalls.xml
@@ -5,8 +5,33 @@
<section id="countcallssect">
<title>Counting Function Calls Made</title>
+<indexterm>
+<primary>script examples</primary>
+<secondary>tallying function calls</secondary>
+</indexterm>
+
+<indexterm>
+<primary>examples of SystemTap scripts</primary>
+<secondary>tallying function calls</secondary>
+</indexterm>
+
+<indexterm>
+<primary>tallying function calls</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
-
+
+<indexterm>
+<primary>counting function calls</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+<indexterm>
+<primary>function calls, tallying</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+
<remark>
WAR STORY: Function call count http://sourceware.org/systemtap/wiki/WSFunctionCallCount?highlight=((WarStories))
</remark>
@@ -28,6 +53,20 @@ no script in examples
</formalpara>
<para><xref linkend="countcalls"/> takes the targeted kernel function as an argument. The argument supports wildcards, which enables you to target multiple kernel functions up to a certain extent.</para>
+<indexterm>
+<primary>script examples</primary>
+<secondary>timer.ms(), sample usage</secondary>
+</indexterm>
+
+<indexterm>
+<primary>examples of SystemTap scripts</primary>
+<secondary>timer.ms(), sample usage</secondary>
+</indexterm>
+
+<indexterm>
+<primary>timer.ms(), sample usage</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
<para>You can increase the sample time by editing the timer in the second probe (<command>timer.ms()</command>). The output of <xref linkend="countcalls"/> contains the name of the function called and how many times it was called during the sample time (in alphabetical order). <xref linkend="countcallsoutput"/> contains an excerpt from the output of <command>stap countcalls.stp "*@mm/*.c"</command>:</para>
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-futexes.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-futexes.xml
index 34e51076..82bb762b 100644
--- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-futexes.xml
+++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-futexes.xml
@@ -6,7 +6,28 @@
<section id="futexcontentionsect">
<title>Identifying Contended User-Space Locks</title>
+<indexterm>
+<primary>script examples</primary>
+<secondary>identifying contended user-space locks (i.e. futex contentions)</secondary>
+</indexterm>
+
+<indexterm>
+<primary>examples of SystemTap scripts</primary>
+<secondary>identifying contended user-space locks (i.e. futex contentions)</secondary>
+</indexterm>
+
+<indexterm>
+<primary>identifying contended user-space locks (i.e. futex contentions)</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+<indexterm>
+ <primary>contended user-space locks (futex contentions), identifying</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+
+
<remark>
WAR STORY: Futex contention http://sourceware.org/systemtap/wiki/WSFutexContention?highlight=((WarStories))
</remark>
@@ -16,9 +37,49 @@ no script in examples
</remark>
- <para>This section describes how to identify contended user-space locks throughout the system within a specific time period. The ability to identify contended user-space locks can help you investigate hangs that you suspect may be caused by <command>futex</command> contentions.</para>
+ <para>This section describes how to identify contended user-space locks throughout the system within a specific time period. The ability to identify contended user-space locks can help you investigate hangs that you suspect may be caused by <command>futex</command> contentions.</para>
+<indexterm>
+ <primary>futex contentions, identifying</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>futex contention, definition</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+<indexterm>
+<primary>script examples</primary>
+<secondary>process deadlocks (arising from futex contentions)</secondary>
+</indexterm>
+
+<indexterm>
+<primary>examples of SystemTap scripts</primary>
+<secondary>process deadlocks (arising from futex contentions)</secondary>
+</indexterm>
+
+<indexterm>
+<primary>process deadlocks (arising from futex contentions)</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
<para>Simply put, a <command>futex</command> contention occurs when multiple processes are trying to access the same region of memory. In some cases, this can result in a deadlock between the processes in contention, thereby appearing as an application hang.</para>
+<!-- next 2 indexterms for futex system call -->
+
+<indexterm>
+<primary>script examples</primary>
+<secondary>futex system call</secondary>
+</indexterm>
+
+<indexterm>
+<primary>examples of SystemTap scripts</primary>
+<secondary>futex system call</secondary>
+</indexterm>
+
+<indexterm>
+<primary>futex system call</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
<para>To do this, <xref linkend="futexcontention"/> probes the <command>futex</command> system call.</para>
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch.xml
index e747771b..098524ae 100644
--- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch.xml
+++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch.xml
@@ -6,7 +6,36 @@
<section id="inodewatchsect">
<title>Monitoring Reads and Writes to a File</title>
-
+<indexterm>
+<primary>script examples</primary>
+<secondary>monitoring reads and writes to a file</secondary>
+</indexterm>
+
+<indexterm>
+<primary>examples of SystemTap scripts</primary>
+<secondary>monitoring reads and writes to a file</secondary>
+</indexterm>
+
+<indexterm>
+<primary>monitoring reads and writes to a file</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+<indexterm>
+<primary>file reads/writes, monitoring</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>reads/writes to a file, monitoring</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>writes/reads to a file, monitoring</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
<remark>
WAR STORY: monitoring inode activity http://sourceware.org/systemtap/wiki/WSFileMonitor?highlight=((WarStories))
</remark>
@@ -31,13 +60,45 @@ no script in examples
<para><xref linkend="inodewatch"/> takes the following information about the file as an argument:</para>
+<indexterm>
+ <primary>script examples</primary>
+ <secondary>file device number (integer format)</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>examples of SystemTap scripts</primary>
+ <secondary>file device number (integer format)</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>file device number (integer format)</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>device number of a file (integer format)</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
<itemizedlist>
<listitem><para>The file's device number, in integer format. When this is passed to the script as the first argument, be sure to replace any <computeroutput>0</computeroutput> with a space.</para></listitem>
<listitem><para>The file's <command>inode</command> number.</para></listitem>
</itemizedlist>
-
+<indexterm>
+ <primary>script examples</primary>
+ <secondary>stat -c, determining file device number (integer format)</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>examples of SystemTap scripts</primary>
+ <secondary>stat -c, determining file device number (integer format)</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>stat -c, determining file device number (integer format)</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
<para>To get this information, use <command>stat -c '%D %i' <replaceable>filename</replaceable></command>, where <command><replaceable>filename</replaceable></command> is an absolute path.</para>
<para>For instance: if you wish to monitor <filename>/etc/crontab</filename>, run <command>stat -c '%D %i' /etc/crontab</command> first. This gives the following output:</para>
@@ -45,6 +106,20 @@ no script in examples
<screen>
805 1078319
</screen>
+<indexterm>
+ <primary>script examples</primary>
+ <secondary>inode number</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>examples of SystemTap scripts</primary>
+ <secondary>inode number</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>inode number</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
<para><computeroutput>805</computeroutput> is the device number, while <computeroutput>1078319</computeroutput> is the <command>inode</command> number. To start monitoring <filename>/etc/crontab</filename>, run <command>stap inodewatch.stp 8 5 1078319</command>.</para>
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch2.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch2.xml
index 04b8f1c8..0cc04dba 100644
--- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch2.xml
+++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-inodewatch2.xml
@@ -6,7 +6,32 @@
<section id="inodewatch2sect">
<title>Monitoring Changes to File Attributes</title>
-
+<indexterm>
+<primary>script examples</primary>
+<secondary>monitoring changes to file attributes</secondary>
+</indexterm>
+
+<indexterm>
+<primary>examples of SystemTap scripts</primary>
+<secondary>monitoring changes to file attributes</secondary>
+</indexterm>
+
+<indexterm>
+<primary>monitoring changes to file attributes</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>changes to file attributes, monitoring</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>file attributes, monitoring changes to</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+
<remark>
WAR STORY: monitoring more inode activity http://sourceware.org/systemtap/wiki/WSFileMonitor2?highlight=((WarStories))
</remark>
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-nettop.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-nettop.xml
index 7e01a1f8..c51d4b66 100644
--- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-nettop.xml
+++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-nettop.xml
@@ -5,7 +5,20 @@
<section id="nettopsect">
<title>Network Profiling</title>
-
+<indexterm>
+<primary>script examples</primary>
+<secondary>network profiling</secondary>
+</indexterm>
+
+<indexterm>
+<primary>examples of SystemTap scripts</primary>
+<secondary>network profiling</secondary>
+</indexterm>
+
+<indexterm>
+<primary>network profiling</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
<remark>
WAR STORY: Top network users by PID http://sourceware.org/systemtap/wiki/WSNetTop?highlight=((WarStories))
@@ -15,6 +28,15 @@
probably http://sourceware.org/systemtap/examples/network/nettop.stp
</remark>
+<indexterm>
+<primary>profiling the network</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+
+<indexterm>
+<primary>network traffic, monitoring</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
<para>This section describes how to profile network activity. <xref linkend="nettop"/> provides a glimpse into how much network traffic each process is generating on a machine.</para>
@@ -25,8 +47,22 @@
<xi:include parse="text" href="extras/testsuite/systemtap.examples/network/nettop.stp" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
</para>
-</formalpara>
-
+</formalpara>
+
+<indexterm>
+ <primary>script examples</primary>
+ <secondary>if/else conditionals, alternative syntax</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>examples of SystemTap scripts</primary>
+ <secondary>if/else conditionals, alternative syntax</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>if/else conditionals, alternative syntax</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
<para>Note that <command>function print_activity()</command> uses the following constructs:</para>
<screen>
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-sockettrace.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-sockettrace.xml
index 85694faf..9a9e1c55 100644
--- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-sockettrace.xml
+++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-sockettrace.xml
@@ -5,13 +5,46 @@
<section id="sockettracesect">
<title>Tracing Functions Called in Network Socket Code</title>
-
-
+<indexterm>
+<primary>script examples</primary>
+<secondary>tracing functions called in network socket code</secondary>
+</indexterm>
+
+<indexterm>
+<primary>examples of SystemTap scripts</primary>
+<secondary>tracing functions called in network socket code</secondary>
+</indexterm>
+
+<indexterm>
+<primary>tracing functions called in network socket code</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+<indexterm>
+ <primary>network socket code, tracing functions called in</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+<indexterm>
+ <primary>functions called in network socket code, tracing</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
<remark>
http://sourceware.org/systemtap/examples/network/socket-trace.stp
</remark>
+<indexterm>
+ <primary>script examples</primary>
+ <secondary>net/socket.c, tracing functions from</secondary>
+</indexterm>
+<indexterm>
+ <primary>examples of SystemTap scripts</primary>
+ <secondary>net/socket.c, tracing functions from</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>net/socket.c, tracing functions from</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
<para>This section describes how to trace functions called from the kernel's <filename>net/socket.c</filename> file. This task helps you identify, in finer detail, how each process interacts with the network at the kernel level.</para>
<formalpara id="sockettrace">
@@ -51,6 +84,9 @@
</screen>
</example>
+<para><xref linkend="sockettraceoutput"/> contains a 3-second excerpt of the output for <xref linkend="sockettrace"/>. For more information about the output of this script as provided by <command>thread_indent()</command>, refer to <xref linkend="systemtapscript-functions"/> <xref linkend="thread_indent"/>. </para>
+
+<!--
<para><xref linkend="sockettraceoutput"/> contains a 3-second excerpt of the output for <xref linkend="sockettrace"/>. Each line contains the following information, on the order that they appear:</para>
<itemizedlist>
@@ -61,7 +97,7 @@
<listitem><para>An arrow signifying whether the call was an entry (<computeroutput>&lt;-</computeroutput>) or an exit (<computeroutput>-></computeroutput>); the indentations help you match specific function call entries with their corresponding exits.</para></listitem>
<listitem><para>The name of the function called by the process.</para></listitem>
-</itemizedlist>
+</itemizedlist> -->
<!--
probe kernel.function("*@net/socket.c").call {
printf ("%s -> %s\n", thread_indent(1), probefunc())
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-threadtimes.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-threadtimes.xml
index 8df14aca..3bddf067 100644
--- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-threadtimes.xml
+++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-threadtimes.xml
@@ -5,7 +5,32 @@
<section id="threadtimessect">
<title>Determining Time Spent in Kernel and User Space</title>
-
+<indexterm>
+<primary>script examples</primary>
+<secondary>determining time spent in kernel and user space</secondary>
+</indexterm>
+
+<indexterm>
+<primary>examples of SystemTap scripts</primary>
+<secondary>determining time spent in kernel and user space</secondary>
+</indexterm>
+
+<indexterm>
+<primary>determining time spent in kernel and user space</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+<indexterm>
+ <primary>time spent in kernel/user space, determining</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+<indexterm>
+ <primary>kernel and user space, determining time spent in</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+<indexterm>
+ <primary>user and kernel space, determining time spent in</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
<remark>
http://sourceware.org/systemtap/examples/profiling/thread-times.stp
@@ -22,6 +47,20 @@
</programlisting>
</para>
</formalpara>
+<indexterm>
+ <primary>script examples</primary>
+ <secondary>CPU ticks</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>examples of SystemTap scripts</primary>
+ <secondary>CPU ticks</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>CPU ticks</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
<para><xref linkend="threadtimes"/> lists the top 20 processes currently taking up CPU time within a 5-second sample, along with the total number of CPU ticks made during the sample. The output of this script also notes the percentage of CPU time each process used, as well as whether that time was spent in kernel space or user space. </para>
<!--
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-traceio2.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-traceio2.xml
index 4422b764..6800adaa 100644
--- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-traceio2.xml
+++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-traceio2.xml
@@ -81,16 +81,16 @@ semantic error: field 'f_dentry' not found
</programlisting>-->
<indexterm>
<primary>script examples</primary>
-<secondary>stat -c</secondary>
+<secondary>stat -c, determining whole device number</secondary>
</indexterm>
<indexterm>
<primary>examples of SystemTap scripts</primary>
-<secondary>stat -c</secondary>
+<secondary>stat -c, determining whole device number</secondary>
</indexterm>
<indexterm>
-<primary>stat -c</primary>
+<primary>stat -c, determining whole device number</primary>
<secondary>examples of SystemTap scripts</secondary>
</indexterm>