diff options
author | Dave Brolley <brolley@redhat.com> | 2009-06-22 11:37:08 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-06-22 11:37:08 -0400 |
commit | d6454850dd3c9d74b700924b56378c4c9ab9fa57 (patch) | |
tree | 6665a24339ca689b1156ea7e93d4f93811c3f794 /testsuite/systemtap.examples | |
parent | d729143af5242b17645d3f405141918940680894 (diff) | |
parent | 4116c576d5654287b0af598aee4a14eb2af73224 (diff) | |
download | systemtap-steved-d6454850dd3c9d74b700924b56378c4c9ab9fa57.tar.gz systemtap-steved-d6454850dd3c9d74b700924b56378c4c9ab9fa57.tar.xz systemtap-steved-d6454850dd3c9d74b700924b56378c4c9ab9fa57.zip |
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'testsuite/systemtap.examples')
-rw-r--r-- | testsuite/systemtap.examples/index.html | 6 | ||||
-rw-r--r-- | testsuite/systemtap.examples/index.txt | 17 | ||||
-rw-r--r-- | testsuite/systemtap.examples/keyword-index.html | 18 | ||||
-rw-r--r-- | testsuite/systemtap.examples/keyword-index.txt | 52 | ||||
-rw-r--r-- | testsuite/systemtap.examples/network/sk_stream_wait_memory.meta | 13 | ||||
-rwxr-xr-x | testsuite/systemtap.examples/network/sk_stream_wait_memory.stp | 25 | ||||
-rw-r--r-- | testsuite/systemtap.examples/process/forktracker.meta | 13 | ||||
-rwxr-xr-x | testsuite/systemtap.examples/process/forktracker.stp | 23 |
8 files changed, 167 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html index b2ed3a3a..c485713c 100644 --- a/testsuite/systemtap.examples/index.html +++ b/testsuite/systemtap.examples/index.html @@ -97,6 +97,9 @@ keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-inde <li><a href="network/nettop.stp">network/nettop.stp</a> - Periodic Listing of Processes Using Network Interfaces<br> keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <a href="keyword-index.html#PER-PROCESS">PER-PROCESS</a> <br> <p>Every five seconds the nettop.stp script prints out a list of processed (PID and command) with the number of packets sent/received and the amount of data sent/received by the process during that interval.</p></li> +<li><a href="network/sk_stream_wait_memory.stp">network/sk_stream_wait_memory.stp</a> - Track Start and Stop of Processes Due to Network Buffer Space<br> +keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#BUFFER">BUFFER</a> <a href="keyword-index.html#MEMORY">MEMORY</a> <br> +<p>The sk_stream-wait_memory.stp prints a time stamp, executable, and pid each time a process blocks due to the send buffer being full. A similar entry is printed each time a process continues because there is room in the buffer.</p></li> <li><a href="network/socket-trace.stp">network/socket-trace.stp</a> - Trace Functions called in Network Socket Code<br> keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <br> <p>The script instrument each of the functions inn the Linux kernel's net/socket.c file. The script prints out trace. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The "->" and "<-" indicates function entry and function exit, respectively. The last element of the line is the function name.</p></li> @@ -109,6 +112,9 @@ keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-inde <li><a href="process/errsnoop.stp">process/errsnoop.stp</a> - tabulate system call errors<br> keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br> <p>The script prints a periodic tabular report about failing system calls, by process and by syscall failure. The first optional argument specifies the reporting interval (in seconds, default 5); the second optional argument gives a screen height (number of lines in the report, default 20).</p></li> +<li><a href="process/forktracker.stp">process/forktracker.stp</a> - Trace Creation of Processes<br> +keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <br> +<p>The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful for determine what process is creating a flurry of short-lived processes.</p></li> <li><a href="process/futexes.stp">process/futexes.stp</a> - System-Wide Futex Contention<br> keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#LOCKING">LOCKING</a> <a href="keyword-index.html#FUTEX">FUTEX</a> <br> <p>The script watches the futex syscall on the system. On exit the futexes address, the number of contentions, and the average time for each contention on the futex are printed from lowest pid number to highest.</p></li> diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt index 91fc66ae..caf1a5ff 100644 --- a/testsuite/systemtap.examples/index.txt +++ b/testsuite/systemtap.examples/index.txt @@ -176,6 +176,15 @@ keywords: network traffic per-process interval. +network/sk_stream_wait_memory.stp - Track Start and Stop of Processes Due to Network Buffer Space +keywords: network tcp buffer memory + + The sk_stream-wait_memory.stp prints a time stamp, executable, and + pid each time a process blocks due to the send buffer being full. A + similar entry is printed each time a process continues because there + is room in the buffer. + + network/socket-trace.stp - Trace Functions called in Network Socket Code keywords: network socket @@ -215,6 +224,14 @@ keywords: process syscall in the report, default 20). +process/forktracker.stp - Trace Creation of Processes +keywords: process scheduler + + The forktracker.stp script prints out a time-stamped entry showing + each fork and exec operation on the machine. This can be useful for + determine what process is creating a flurry of short-lived processes. + + process/futexes.stp - System-Wide Futex Contention keywords: syscall locking futex diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html index 7306c164..9852c992 100644 --- a/testsuite/systemtap.examples/keyword-index.html +++ b/testsuite/systemtap.examples/keyword-index.html @@ -57,6 +57,9 @@ keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#SCH <li><a href="network/dropwatch.stp">network/dropwatch.stp</a> - Watch Where Socket Buffers are Freed in the Kernel<br> keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <a href="keyword-index.html#BUFFER">BUFFER</a> <a href="keyword-index.html#FREE">FREE</a> <br> <p>Every five seconds the dropwatch.stp script lists the number of socket buffers freed at locations in the kernel.</p></li> +<li><a href="network/sk_stream_wait_memory.stp">network/sk_stream_wait_memory.stp</a> - Track Start and Stop of Processes Due to Network Buffer Space<br> +keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#BUFFER">BUFFER</a> <a href="keyword-index.html#MEMORY">MEMORY</a> <br> +<p>The sk_stream-wait_memory.stp prints a time stamp, executable, and pid each time a process blocks due to the send buffer being full. A similar entry is printed each time a process continues because there is room in the buffer.</p></li> </ul> <h3><a name="CALLGRAPH">CALLGRAPH</a></h3> <ul> @@ -162,6 +165,9 @@ keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <br> <li><a href="memory/pfaults.stp">memory/pfaults.stp</a> - Generate Log of Major and Minor Page Faults<br> keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <br> <p>The pfaults.stp script generates a simple log for each major and minor page fault that occurs on the system. Each line contains a timestamp (in microseconds) when the page fault servicing was completed, the pid of the process, the address of the page fault, the type of access (read or write), the type of fault (major or minor), and the elapsed time for page fault. This log can be examined to determine where the page faults are occuring.</p></li> +<li><a href="network/sk_stream_wait_memory.stp">network/sk_stream_wait_memory.stp</a> - Track Start and Stop of Processes Due to Network Buffer Space<br> +keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#BUFFER">BUFFER</a> <a href="keyword-index.html#MEMORY">MEMORY</a> <br> +<p>The sk_stream-wait_memory.stp prints a time stamp, executable, and pid each time a process blocks due to the send buffer being full. A similar entry is printed each time a process continues because there is room in the buffer.</p></li> </ul> <h3><a name="MONITOR">MONITOR</a></h3> <ul> @@ -177,6 +183,9 @@ keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-inde <li><a href="network/nettop.stp">network/nettop.stp</a> - Periodic Listing of Processes Using Network Interfaces<br> keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TRAFFIC">TRAFFIC</a> <a href="keyword-index.html#PER-PROCESS">PER-PROCESS</a> <br> <p>Every five seconds the nettop.stp script prints out a list of processed (PID and command) with the number of packets sent/received and the amount of data sent/received by the process during that interval.</p></li> +<li><a href="network/sk_stream_wait_memory.stp">network/sk_stream_wait_memory.stp</a> - Track Start and Stop of Processes Due to Network Buffer Space<br> +keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#BUFFER">BUFFER</a> <a href="keyword-index.html#MEMORY">MEMORY</a> <br> +<p>The sk_stream-wait_memory.stp prints a time stamp, executable, and pid each time a process blocks due to the send buffer being full. A similar entry is printed each time a process continues because there is room in the buffer.</p></li> <li><a href="network/socket-trace.stp">network/socket-trace.stp</a> - Trace Functions called in Network Socket Code<br> keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <br> <p>The script instrument each of the functions inn the Linux kernel's net/socket.c file. The script prints out trace. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The "->" and "<-" indicates function entry and function exit, respectively. The last element of the line is the function name.</p></li> @@ -201,6 +210,9 @@ keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-inde <li><a href="process/errsnoop.stp">process/errsnoop.stp</a> - tabulate system call errors<br> keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br> <p>The script prints a periodic tabular report about failing system calls, by process and by syscall failure. The first optional argument specifies the reporting interval (in seconds, default 5); the second optional argument gives a screen height (number of lines in the report, default 20).</p></li> +<li><a href="process/forktracker.stp">process/forktracker.stp</a> - Trace Creation of Processes<br> +keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <br> +<p>The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful for determine what process is creating a flurry of short-lived processes.</p></li> <li><a href="process/schedtimes.stp">process/schedtimes.stp</a> - Track Time Processes Spend in Various States using Tracepoints<br> keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br> <p>The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends running, sleeping, queued, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.</p></li> @@ -234,6 +246,9 @@ keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-inde </ul> <h3><a name="SCHEDULER">SCHEDULER</a></h3> <ul> +<li><a href="process/forktracker.stp">process/forktracker.stp</a> - Trace Creation of Processes<br> +keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <br> +<p>The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful for determine what process is creating a flurry of short-lived processes.</p></li> <li><a href="process/schedtimes.stp">process/schedtimes.stp</a> - Track Time Processes Spend in Various States using Tracepoints<br> keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br> <p>The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends running, sleeping, queued, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.</p></li> @@ -303,6 +318,9 @@ keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-inde </ul> <h3><a name="TCP">TCP</a></h3> <ul> +<li><a href="network/sk_stream_wait_memory.stp">network/sk_stream_wait_memory.stp</a> - Track Start and Stop of Processes Due to Network Buffer Space<br> +keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#BUFFER">BUFFER</a> <a href="keyword-index.html#MEMORY">MEMORY</a> <br> +<p>The sk_stream-wait_memory.stp prints a time stamp, executable, and pid each time a process blocks due to the send buffer being full. A similar entry is printed each time a process continues because there is room in the buffer.</p></li> <li><a href="network/tcp_connections.stp">network/tcp_connections.stp</a> - Track Creation of Incoming TCP Connections<br> keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-index.html#TCP">TCP</a> <a href="keyword-index.html#SOCKET">SOCKET</a> <br> <p>The tcp_connections.stp script prints information for each new incoming TCP connection accepted by the computer. The information includes the UID, the command accepting the connection, the PID of the command, the port the connection is on, and the IP address of the originator of the request.</p></li> diff --git a/testsuite/systemtap.examples/keyword-index.txt b/testsuite/systemtap.examples/keyword-index.txt index eee89e22..4778afc7 100644 --- a/testsuite/systemtap.examples/keyword-index.txt +++ b/testsuite/systemtap.examples/keyword-index.txt @@ -39,6 +39,15 @@ keywords: network tracepoint buffer free socket buffers freed at locations in the kernel. +network/sk_stream_wait_memory.stp - Track Start and Stop of Processes Due to Network Buffer Space +keywords: network tcp buffer memory + + The sk_stream-wait_memory.stp prints a time stamp, executable, and + pid each time a process blocks due to the send buffer being full. A + similar entry is printed each time a process continues because there + is room in the buffer. + + = CALLGRAPH = general/para-callgraph.stp - Callgraph tracing with arguments @@ -275,6 +284,15 @@ keywords: memory determine where the page faults are occuring. +network/sk_stream_wait_memory.stp - Track Start and Stop of Processes Due to Network Buffer Space +keywords: network tcp buffer memory + + The sk_stream-wait_memory.stp prints a time stamp, executable, and + pid each time a process blocks due to the send buffer being full. A + similar entry is printed each time a process continues because there + is room in the buffer. + + = MONITOR = io/ttyspy.stp - Monitor tty typing. @@ -303,6 +321,15 @@ keywords: network traffic per-process interval. +network/sk_stream_wait_memory.stp - Track Start and Stop of Processes Due to Network Buffer Space +keywords: network tcp buffer memory + + The sk_stream-wait_memory.stp prints a time stamp, executable, and + pid each time a process blocks due to the send buffer being full. A + similar entry is printed each time a process continues because there + is room in the buffer. + + network/socket-trace.stp - Trace Functions called in Network Socket Code keywords: network socket @@ -363,6 +390,14 @@ keywords: process syscall in the report, default 20). +process/forktracker.stp - Trace Creation of Processes +keywords: process scheduler + + The forktracker.stp script prints out a time-stamped entry showing + each fork and exec operation on the machine. This can be useful for + determine what process is creating a flurry of short-lived processes. + + process/schedtimes.stp - Track Time Processes Spend in Various States using Tracepoints keywords: process scheduler time tracepoint @@ -453,6 +488,14 @@ keywords: syscall read write time io = SCHEDULER = +process/forktracker.stp - Trace Creation of Processes +keywords: process scheduler + + The forktracker.stp script prints out a time-stamped entry showing + each fork and exec operation on the machine. This can be useful for + determine what process is creating a flurry of short-lived processes. + + process/schedtimes.stp - Track Time Processes Spend in Various States using Tracepoints keywords: process scheduler time tracepoint @@ -624,6 +667,15 @@ keywords: syscall wait4 = TCP = +network/sk_stream_wait_memory.stp - Track Start and Stop of Processes Due to Network Buffer Space +keywords: network tcp buffer memory + + The sk_stream-wait_memory.stp prints a time stamp, executable, and + pid each time a process blocks due to the send buffer being full. A + similar entry is printed each time a process continues because there + is room in the buffer. + + network/tcp_connections.stp - Track Creation of Incoming TCP Connections keywords: network tcp socket diff --git a/testsuite/systemtap.examples/network/sk_stream_wait_memory.meta b/testsuite/systemtap.examples/network/sk_stream_wait_memory.meta new file mode 100644 index 00000000..bc798f72 --- /dev/null +++ b/testsuite/systemtap.examples/network/sk_stream_wait_memory.meta @@ -0,0 +1,13 @@ +title: Track Start and Stop of Processes Due to Network Buffer Space +name: sk_stream_wait_memory.stp +version: 1.0 +author: Fabio Olive Leite at Red Hat +keywords: network tcp buffer memory +subsystem: kernel +status: production +exit: user-controlled +output: trace +scope: system-wide +description: The sk_stream-wait_memory.stp prints a time stamp, executable, and pid each time a process blocks due to the send buffer being full. A similar entry is printed each time a process continues because there is room in the buffer. +test_check: stap -p4 sk_stream_wait_memory.stp +test_installcheck: stap sk_stream_wait_memory.stp -c "sleep 1" diff --git a/testsuite/systemtap.examples/network/sk_stream_wait_memory.stp b/testsuite/systemtap.examples/network/sk_stream_wait_memory.stp new file mode 100755 index 00000000..159d77a6 --- /dev/null +++ b/testsuite/systemtap.examples/network/sk_stream_wait_memory.stp @@ -0,0 +1,25 @@ +# Simple probe to detect when a process is waiting for more socket send +# buffer memory. Usually means the process is doing writes larger than the +# socker send buffer size or there is a slow receiver at the other side. +# Increasing the socket's send buffer size might help decrease application +# latencies, but it might also make it worse, so buyer beware. +# +# Tipical output: timestamp in microseconds: procname(pid) event +# +# 1218230114875167: python(17631) blocked on full send buffer +# 1218230114876196: python(17631) recovered from full send buffer +# 1218230114876271: python(17631) blocked on full send buffer +# 1218230114876479: python(17631) recovered from full send buffer + +probe kernel.function("sk_stream_wait_memory") +{ + printf("%u: %s(%d) blocked on full send buffer\n", + gettimeofday_us(), execname(), pid()) +} + +probe kernel.function("sk_stream_wait_memory").return +{ + printf("%u: %s(%d) recovered from full send buffer\n", + gettimeofday_us(), execname(), pid()) +} + diff --git a/testsuite/systemtap.examples/process/forktracker.meta b/testsuite/systemtap.examples/process/forktracker.meta new file mode 100644 index 00000000..f3ef3709 --- /dev/null +++ b/testsuite/systemtap.examples/process/forktracker.meta @@ -0,0 +1,13 @@ +title: Trace Creation of Processes +name: forktracker.stp +version: 0.1 +author: Phil Muldoon at Red Hat +keywords: process scheduler +subsystem: scheduler +status: production +exit: user-controlled +output: trace +scope: system-wide +description: The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful for determine what process is creating a flurry of short-lived processes. +test_check: stap -p4 forktracker.stp +test_installcheck: stap forkracker.stp -c "sleep 1" diff --git a/testsuite/systemtap.examples/process/forktracker.stp b/testsuite/systemtap.examples/process/forktracker.stp new file mode 100755 index 00000000..525aa0a5 --- /dev/null +++ b/testsuite/systemtap.examples/process/forktracker.stp @@ -0,0 +1,23 @@ +#! /usr/bin/env stap +# +# This is a stap script to monitor process creations (fork(), exec()'s). +# Based off of stap script found: http://picobot.org/wordpress/?p=27 +# With some minor modifications (i.e. timestamping) +# +# Usage: stap forktracker.stp +# +# Sample output: +# +# timestamp: process_name (pid) new_pid +# +# Version 0.1 + +probe kprocess.create { + printf("%-25s: %s (%d) created %d\n", + ctime(gettimeofday_s()), execname(), pid(), new_pid) +} + +probe kprocess.exec { + printf("%-25s: %s (%d) is exec'ing %s\n", + ctime(gettimeofday_s()), execname(), pid(), filename) +} |