diff options
Diffstat (limited to 'testsuite/systemtap.examples')
-rw-r--r-- | testsuite/systemtap.examples/index.html | 6 | ||||
-rw-r--r-- | testsuite/systemtap.examples/index.txt | 18 | ||||
-rw-r--r-- | testsuite/systemtap.examples/keyword-index.html | 17 | ||||
-rw-r--r-- | testsuite/systemtap.examples/keyword-index.txt | 40 | ||||
-rw-r--r-- | testsuite/systemtap.examples/network/tcp_connections.meta | 13 | ||||
-rw-r--r-- | testsuite/systemtap.examples/network/tcp_connections.stp | 14 | ||||
-rw-r--r-- | testsuite/systemtap.examples/profiling/topsys.meta | 13 | ||||
-rw-r--r-- | testsuite/systemtap.examples/profiling/topsys.stp | 24 |
8 files changed, 144 insertions, 1 deletions
diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html index 87a5a50e..e02ab867 100644 --- a/testsuite/systemtap.examples/index.html +++ b/testsuite/systemtap.examples/index.html @@ -76,6 +76,9 @@ keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-inde <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> +<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> <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> @@ -118,6 +121,9 @@ keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br> <li><a href="profiling/timeout.stp">profiling/timeout.stp</a> - Show Processes Doing Polling Operations<br> keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br> <p>The timeout.stp script is based on a blog entry (http://udrepper.livejournal.com/19041.html) mentioning a need for a tool to help developers find applications that are polling. The timeout.stp script monitors systemcall used for polling and records the systemcalls that timed out rather than returned because some action occurred. The script updates the screen once a second with the top twenty processes.</p></li> +<li><a href="profiling/topsys.stp">profiling/topsys.stp</a> - Show Processes Doing Polling Operations<br> +keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br> +<p> The topsys.stp script lists out the top twenty systemcalls for the previous 5 seconds. The output is sorted from most frequent to least frequent.</p></li> </ul> </td> </tr> diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt index 5ffc341a..0076afaa 100644 --- a/testsuite/systemtap.examples/index.txt +++ b/testsuite/systemtap.examples/index.txt @@ -109,6 +109,16 @@ keywords: network socket element of the line is the function name. +network/tcp_connections.stp - Track Creation of Incoming TCP Connections +keywords: network tcp socket + + 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. + + process/futexes.stp - System-Wide Futex Contention keywords: syscall locking futex @@ -233,3 +243,11 @@ keywords: profiling top twenty processes. +profiling/topsys.stp - Show Processes Doing Polling Operations +keywords: profiling + + The topsys.stp script lists out the top twenty systemcalls for the + previous 5 seconds. The output is sorted from most frequent to least + frequent. + + diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html index 9ff68c8d..3156cc08 100644 --- a/testsuite/systemtap.examples/keyword-index.html +++ b/testsuite/systemtap.examples/keyword-index.html @@ -39,7 +39,7 @@ </ul> <h2>Examples by Keyword</h2> -<p><tt><a href="#BACKTRACE">BACKTRACE</a> <a href="#CALLGRAPH">CALLGRAPH</a> <a href="#CPU">CPU</a> <a href="#DISK">DISK</a> <a href="#FUNCTIONS">FUNCTIONS</a> <a href="#FUTEX">FUTEX</a> <a href="#GRAPH">GRAPH</a> <a href="#INTERRUPT">INTERRUPT</a> <a href="#IO">IO</a> <a href="#LOCKING">LOCKING</a> <a href="#NETWORK">NETWORK</a> <a href="#PER-PROCESS">PER-PROCESS</a> <a href="#PROFILING">PROFILING</a> <a href="#READ">READ</a> <a href="#SCHEDULER">SCHEDULER</a> <a href="#SIGNALS">SIGNALS</a> <a href="#SIMPLE">SIMPLE</a> <a href="#SLEEP">SLEEP</a> <a href="#SOCKET">SOCKET</a> <a href="#SYSCALL">SYSCALL</a> <a href="#TIME">TIME</a> <a href="#TRACE">TRACE</a> <a href="#TRAFFIC">TRAFFIC</a> <a href="#USE">USE</a> <a href="#WAIT4">WAIT4</a> <a href="#WRITE">WRITE</a> </tt></p> +<p><tt><a href="#BACKTRACE">BACKTRACE</a> <a href="#CALLGRAPH">CALLGRAPH</a> <a href="#CPU">CPU</a> <a href="#DISK">DISK</a> <a href="#FUNCTIONS">FUNCTIONS</a> <a href="#FUTEX">FUTEX</a> <a href="#GRAPH">GRAPH</a> <a href="#INTERRUPT">INTERRUPT</a> <a href="#IO">IO</a> <a href="#LOCKING">LOCKING</a> <a href="#NETWORK">NETWORK</a> <a href="#PER-PROCESS">PER-PROCESS</a> <a href="#PROFILING">PROFILING</a> <a href="#READ">READ</a> <a href="#SCHEDULER">SCHEDULER</a> <a href="#SIGNALS">SIGNALS</a> <a href="#SIMPLE">SIMPLE</a> <a href="#SLEEP">SLEEP</a> <a href="#SOCKET">SOCKET</a> <a href="#SYSCALL">SYSCALL</a> <a href="#TCP">TCP</a> <a href="#TIME">TIME</a> <a href="#TRACE">TRACE</a> <a href="#TRAFFIC">TRAFFIC</a> <a href="#USE">USE</a> <a href="#WAIT4">WAIT4</a> <a href="#WRITE">WRITE</a> </tt></p> <h3><a name="BACKTRACE">BACKTRACE</a></h3> <ul> <li><a href="interrupt/scf.stp">interrupt/scf.stp</a> - Tally Backtraces for Inter-Processor Interrupt (IPI)<br> @@ -132,6 +132,9 @@ keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-inde <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> +<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> </ul> <h3><a name="PER-PROCESS">PER-PROCESS</a></h3> <ul> @@ -153,6 +156,9 @@ keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br> <li><a href="profiling/timeout.stp">profiling/timeout.stp</a> - Show Processes Doing Polling Operations<br> keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br> <p>The timeout.stp script is based on a blog entry (http://udrepper.livejournal.com/19041.html) mentioning a need for a tool to help developers find applications that are polling. The timeout.stp script monitors systemcall used for polling and records the systemcalls that timed out rather than returned because some action occurred. The script updates the screen once a second with the top twenty processes.</p></li> +<li><a href="profiling/topsys.stp">profiling/topsys.stp</a> - Show Processes Doing Polling Operations<br> +keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br> +<p> The topsys.stp script lists out the top twenty systemcalls for the previous 5 seconds. The output is sorted from most frequent to least frequent.</p></li> </ul> <h3><a name="READ">READ</a></h3> <ul> @@ -198,6 +204,9 @@ keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-inde <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> +<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> </ul> <h3><a name="SYSCALL">SYSCALL</a></h3> <ul> @@ -220,6 +229,12 @@ keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <br> keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#WAIT4">WAIT4</a> <br> <p>The script watches each wait4 syscall on the system. At the end of each wait4 syscall the script prints out a line with a timestamp in microseconds, the pid, the executable name in paretheses, the "wait4:" key, the duration of the wait and the PID that the wait4 was waiting for. If the waited for PID is not specified , it is "-1".</p></li> </ul> +<h3><a name="TCP">TCP</a></h3> +<ul> +<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> +</ul> <h3><a name="TIME">TIME</a></h3> <ul> <li><a href="io/iotime.stp">io/iotime.stp</a> - Trace Time Spent in Read and Write for Files <br> diff --git a/testsuite/systemtap.examples/keyword-index.txt b/testsuite/systemtap.examples/keyword-index.txt index 0127f3a8..a940ccfa 100644 --- a/testsuite/systemtap.examples/keyword-index.txt +++ b/testsuite/systemtap.examples/keyword-index.txt @@ -204,6 +204,16 @@ keywords: network socket element of the line is the function name. +network/tcp_connections.stp - Track Creation of Incoming TCP Connections +keywords: network tcp socket + + 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. + + = PER-PROCESS = network/nettop.stp - Periodic Listing of Processes Using Network Interfaces @@ -256,6 +266,14 @@ keywords: profiling top twenty processes. +profiling/topsys.stp - Show Processes Doing Polling Operations +keywords: profiling + + The topsys.stp script lists out the top twenty systemcalls for the + previous 5 seconds. The output is sorted from most frequent to least + frequent. + + = READ = io/iotime.stp - Trace Time Spent in Read and Write for Files @@ -352,6 +370,16 @@ keywords: network socket element of the line is the function name. +network/tcp_connections.stp - Track Creation of Incoming TCP Connections +keywords: network tcp socket + + 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. + + = SYSCALL = io/iotime.stp - Trace Time Spent in Read and Write for Files @@ -415,6 +443,18 @@ keywords: syscall wait4 waiting for. If the waited for PID is not specified , it is "-1". += TCP = + +network/tcp_connections.stp - Track Creation of Incoming TCP Connections +keywords: network tcp socket + + 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. + + = TIME = io/iotime.stp - Trace Time Spent in Read and Write for Files diff --git a/testsuite/systemtap.examples/network/tcp_connections.meta b/testsuite/systemtap.examples/network/tcp_connections.meta new file mode 100644 index 00000000..0bc9bcb1 --- /dev/null +++ b/testsuite/systemtap.examples/network/tcp_connections.meta @@ -0,0 +1,13 @@ +title: Track Creation of Incoming TCP Connections +name: tcp_connections.stp +version: 1.0 +author: anonymous +keywords: network tcp socket +subsystem: kernel +status: production +exit: user-controlled +output: trace +scope: system-wide +description: 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. +test_check: stap -p4 tcp_connections.stp +test_installcheck: stap tcp_connections.stp -c "sleep 1" diff --git a/testsuite/systemtap.examples/network/tcp_connections.stp b/testsuite/systemtap.examples/network/tcp_connections.stp new file mode 100644 index 00000000..bd2db76a --- /dev/null +++ b/testsuite/systemtap.examples/network/tcp_connections.stp @@ -0,0 +1,14 @@ +#! /usr/bin/env stap + +probe begin { + printf("%6s %16s %6s %6s %16s\n", + "UID", "CMD", "PID", "PORT", "IP_SOURCE") +} + +probe kernel.function("tcp_accept").return?, + kernel.function("inet_csk_accept").return? { + sock = $return + if (sock != 0) + printf("%6d %16s %6d %6d %16s\n", uid(), execname(), pid(), + inet_get_local_port(sock), inet_get_ip_source(sock)) +} diff --git a/testsuite/systemtap.examples/profiling/topsys.meta b/testsuite/systemtap.examples/profiling/topsys.meta new file mode 100644 index 00000000..3642713d --- /dev/null +++ b/testsuite/systemtap.examples/profiling/topsys.meta @@ -0,0 +1,13 @@ +title: Show Processes Doing Polling Operations +name: topsys.stp +version: 1.0 +author: anonymous +keywords: profiling +subsystem: kernel syscalls +status: production +exit: user-controlled +output: sorted-list +scope: system-wide +description: The topsys.stp script lists out the top twenty systemcalls for the previous 5 seconds. The output is sorted from most frequent to least frequent. +test_check: stap -p4 topsys.stp +test_installcheck: stap topsys.stp -c "sleep 1" diff --git a/testsuite/systemtap.examples/profiling/topsys.stp b/testsuite/systemtap.examples/profiling/topsys.stp new file mode 100644 index 00000000..34cf826c --- /dev/null +++ b/testsuite/systemtap.examples/profiling/topsys.stp @@ -0,0 +1,24 @@ +#! /usr/bin/env stap +# +# This script continuously lists the top 20 systemcalls in the interval +# 5 seconds +# + +global syscalls_count + +probe syscall.* { + syscalls_count[name]++ +} + +function print_systop () { + printf ("%25s %10s\n", "SYSCALL", "COUNT") + foreach (syscall in syscalls_count- limit 20) { + printf("%25s %10d\n", syscall, syscalls_count[syscall]) + } + delete syscalls_count +} + +probe timer.s(5) { + print_systop () + printf("--------------------------------------------------------------\n") +} |