diff options
author | Dave Brolley <brolley@redhat.com> | 2009-02-02 16:00:01 -0500 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-02-02 16:00:01 -0500 |
commit | d777f0978faec5ee006deb83a15dec707e920c01 (patch) | |
tree | d3014c81bf9bb89785fda9028292826065b100e8 /testsuite | |
parent | f9cf4e363d1372324bf83ca7fc0531319975cb18 (diff) | |
parent | 0d65057a8a8b418568a18eb394d3e57f5a8051a5 (diff) | |
download | systemtap-steved-d777f0978faec5ee006deb83a15dec707e920c01.tar.gz systemtap-steved-d777f0978faec5ee006deb83a15dec707e920c01.tar.xz systemtap-steved-d777f0978faec5ee006deb83a15dec707e920c01.zip |
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Conflicts:
ChangeLog
NEWS
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/ChangeLog | 39 | ||||
-rwxr-xr-x | testsuite/semok/twenty.stp | 7 | ||||
-rw-r--r-- | testsuite/systemtap.base/labels.exp | 67 | ||||
-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 | ||||
-rw-r--r-- | testsuite/systemtap.samples/queue_demo.exp | 13 | ||||
-rw-r--r-- | testsuite/systemtap.samples/queue_demo.stp | 32 | ||||
-rw-r--r-- | testsuite/systemtap.samples/tcp_connections.stp | 49 | ||||
-rw-r--r-- | testsuite/systemtap.samples/tcp_connections_wa.stp | 55 | ||||
-rw-r--r-- | testsuite/systemtap.samples/topsys.stp | 69 |
16 files changed, 255 insertions, 221 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index e374565d..4c0a85a9 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,10 +1,47 @@ +2009-02-02 Will Cohen <wcohen@redhat.com> + + * systemtap.samples/topsys.stp: Revised and moved to examples. + * systemtap.examples/profiling/topsys.stp: + * systemtap.examples/profiling/topsys.meta: New. + * systemtap.examples/index.html: + * systemtap.examples/index.txt: + * systemtap.examples/keyword-index.html: + * systemtap.examples/keyword-index.txt: Regenerate. + +2009-02-02 Will Cohen <wcohen@redhat.com> + + * systemtap.samples/tcp_connections.stp: Revised and moved to examples. + * systemtap.examples/network/tcp_connections.stp: + * systemtap.examples/network/tcp_connections.meta: New. + * systemtap.examples/index.html: + * systemtap.examples/index.txt: + * systemtap.examples/keyword-index.html: + * systemtap.examples/keyword-index.txt: Regenerate. + +2009-02-02 Will Cohen <wcohen@redhat.com> + + * systemtap.samples/tcp_connections_wa.stp: Remove. + +2009-02-01 Stan Cox <scox@redhat.com> + + * systemtap.base/labels.exp: New. + +2009-01-30 Will Cohen <wcohen@redhat.com> + + * systemtap.samples/queue_demo.exp: + * systemtap.samples/queue_demo.stp: Remove. + +2009-01-30 Frank Ch. Eigler <fche@elastic.org> + + * semok/twenty.stp: Don't spew so much into systemtap.log. + 2009-01-30 Dave Brolley <brolley@redhat.com> * lib/systemtap.exp (setup_systemtap_environment): Make sure that the build directory is on the path if using a server for 'make check'. Use a string to check $server_pid. -2009-01-23 Will Cohen <wcohen@redhat.com> +2009-01-30 Will Cohen <wcohen@redhat.com> * systemtap.samples/scf.stp: * systemtap.samples/scf2.stp: Remove diff --git a/testsuite/semok/twenty.stp b/testsuite/semok/twenty.stp index 46dcefca..73dbb3bf 100755 --- a/testsuite/semok/twenty.stp +++ b/testsuite/semok/twenty.stp @@ -1,5 +1,7 @@ -#! stap -wp2 +#! /bin/sh +set -e +stap -wp2 -e ' probe kernel.function("*") {} probe module("*").function("*") {} probe kernel.function("*").call {} @@ -8,3 +10,6 @@ probe kernel.function("*").return {} probe module("*").function("*").return {} probe kernel.function("*").inline {} probe module("*").function("*").inline {} +' | wc + +# without the |wc, we'd log the humongous list of stuff stap -p2 prints diff --git a/testsuite/systemtap.base/labels.exp b/testsuite/systemtap.base/labels.exp new file mode 100644 index 00000000..6c62d576 --- /dev/null +++ b/testsuite/systemtap.base/labels.exp @@ -0,0 +1,67 @@ +set test "labels" +if {![installtest_p]} {untested $test; return} + +# Try to find utrace_attach symbol in /proc/kallsyms +# copy from utrace_p5.exp +set utrace_support_found 0 +set path "/proc/kallsyms" +if {! [catch {exec grep -q utrace_attach $path} dummy]} { + set utrace_support_found 1 +} +if {$utrace_support_found == 0} { untested "$test"; return } + +# Compile a C program to use as the user-space probing target +set label_srcpath "[pwd]/labels.c" +set label_exepath "[pwd]/labels.x" +set label_flags "additional_flags=-g" +set fp [open $label_srcpath "w"] +puts $fp " +int +main () +{ + sleep(5); + int a = 0; + int b = 0; + char *c; +init_an_int: + a = 2; +init_another_int: + b = 3; + c = \"abc\"; +ptr_inited: + return 1; +} +" +close $fp + +set fp [open "[pwd]/labels.stp" "w"] +puts $fp " +probe process(\"labels.x\").function(\"main*@labels.c\").label(\"init_*\") {printf (\"VARS %s\\n\",\$\$vars)} +probe process(\"labels.x\").function(\"main*@labels.c\").label(\"ptr_inited\") {printf (\"VARS %s\\n\",\$\$vars)} +" +close $fp + +set ok 0 + +set res [target_compile $label_srcpath $label_exepath executable $label_flags] +if { $res != "" } { + verbose "target_compile failed: $res" 2 + fail "compiling labels.c -g" + return +} else { + pass "compiling labels.c -g" +} + +verbose -log "spawn stap -c $label_exepath [pwd]/labels.stp" +spawn stap -c $label_exepath [pwd]/labels.stp + +expect { + -timeout 180 + -re {VARS a=0x0 b=0x0.*VARS a=0x2 b=0x0.*VARS a=0x2 b=0x3 c=0x[a-f01-9]} { incr ok; exp_continue } + timeout { fail "$test (timeout)" } + eof { } +} + +wait + +if {$ok == 1} { pass "$test" } { fail "$test ($ok)" } 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") +} diff --git a/testsuite/systemtap.samples/queue_demo.exp b/testsuite/systemtap.samples/queue_demo.exp deleted file mode 100644 index 49dfac05..00000000 --- a/testsuite/systemtap.samples/queue_demo.exp +++ /dev/null @@ -1,13 +0,0 @@ -set test "queue_demo" -if {![installtest_p]} { untested $test; return } - -spawn stap $srcdir/$subdir/queue_demo.stp -set ok 0 -expect { - -timeout 240 - -re {block-[^\r]*} { incr ok; exp_continue } - timeout { fail "$test (timeout)" } - eof { } -} - -if {$ok > 4 && $ok < 10} { pass "$test" } { fail "$test" } diff --git a/testsuite/systemtap.samples/queue_demo.stp b/testsuite/systemtap.samples/queue_demo.stp deleted file mode 100644 index 61a3b6d1..00000000 --- a/testsuite/systemtap.samples/queue_demo.stp +++ /dev/null @@ -1,32 +0,0 @@ - -probe begin { - qsq_start ("block-read") - qsq_start ("block-write") -} - -probe timer.ms(3500), end { - qsq_print ("block-read") - qsq_start ("block-read") - qsq_print ("block-write") - qsq_start ("block-write") -} - -probe timer.ms(10000) { exit () } - - -# synthesize queue work/service using three randomized "threads" for each queue. - -global tc -function qs_doit (thread, name) { - n = tc[thread] = (tc[thread]+1) % 3 # per-thread state counter - if (n==1) qs_wait (name) - else if (n==2) qs_run (name) - else if (n==0) qs_done (name) -} - -probe timer.ms(100).randomize(100) { qs_doit (0, "block-read") } -probe timer.ms(100).randomize(100) { qs_doit (1, "block-read") } -probe timer.ms(100).randomize(100) { qs_doit (2, "block-read") } -probe timer.ms(100).randomize(100) { qs_doit (3, "block-write") } -probe timer.ms(100).randomize(100) { qs_doit (4, "block-write") } -probe timer.ms(100).randomize(100) { qs_doit (5, "block-write") } diff --git a/testsuite/systemtap.samples/tcp_connections.stp b/testsuite/systemtap.samples/tcp_connections.stp deleted file mode 100644 index a4449b60..00000000 --- a/testsuite/systemtap.samples/tcp_connections.stp +++ /dev/null @@ -1,49 +0,0 @@ -#! stap - -%{ -#include <linux/version.h> -#include <net/sock.h> -#include <net/tcp.h> - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) -#define LPORT (inet->inet.num) -#define DADDR (&inet->inet.daddr) -#else -#define LPORT (inet->num) -#define DADDR (&inet->daddr) -#endif -%} - -function get_local_port:long(sock) -%{ - unsigned long ptr = (unsigned long) THIS->sock; - - struct inet_sock *inet = (struct inet_sock *) ptr; - THIS->__retvalue = (long long) LPORT; -%} - -function get_ip_source:string(sock) -%{ - unsigned long ptr = (unsigned long) THIS->sock; - struct inet_sock *inet = (struct inet_sock *) ptr; - unsigned char addr[4]; - memcpy(addr, DADDR, sizeof(addr)); - sprintf(THIS->__retvalue, "%d.%d.%d.%d", - addr[0], addr[1], addr[2], addr[3]); - -%} - - -probe begin { - log ("UID\tCMD\t\tPID\t\tPORT\tIP_SOURCE") -} - -probe kernel.function("tcp_accept").return { - sock = $return - if (sock != 0) - log(sprint(uid())."\t". - execname()."\t\t". - sprint(pid())."\t\t ". - sprint(get_local_port(sock))."\t". - get_ip_source(sock)) -} diff --git a/testsuite/systemtap.samples/tcp_connections_wa.stp b/testsuite/systemtap.samples/tcp_connections_wa.stp deleted file mode 100644 index 4c5e2399..00000000 --- a/testsuite/systemtap.samples/tcp_connections_wa.stp +++ /dev/null @@ -1,55 +0,0 @@ -%{ -#include <linux/version.h> -#include <net/sock.h> -#include <net/tcp.h> - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) -#define LPORT (inet->inet.num) -#define DADDR (&inet->inet.daddr) -#else -#define LPORT (inet->num) -#define DADDR (&inet->daddr) -#endif -%} - - -function get_eax:long () %{ - if (CONTEXT && CONTEXT->regs) - THIS->__retvalue = CONTEXT->regs->eax; - else - THIS->__retvalue = 0; -%} - -function get_local_port:long(sock) -%{ - unsigned long ptr = (unsigned long) THIS->sock; - - struct inet_sock *inet = (struct inet_sock *) ptr; - THIS->__retvalue = (long long) LPORT; -%} - -function get_ip_source:string(sock) -%{ - unsigned long ptr = (unsigned long) THIS->sock; - struct inet_sock *inet = (struct inet_sock *) ptr; - unsigned char addr[4]; - memcpy(addr, DADDR, sizeof(addr)); - sprintf(THIS->__retvalue, "%d.%d.%d.%d", - addr[0], addr[1], addr[2], addr[3]); - -%} - -probe begin { - log ("UID\tCMD\t\tPID\t\tPORT\tIP_SOURCE") -} -probe kernel.function("tcp_accept").return { - sock = get_eax() - if (sock != 0) - log(sprint(uid())."\t". - execname()."\t\t". - sprint(pid())."\t\t ". - sprint(get_local_port(sock))."\t". - get_ip_source(sock)) -} - - diff --git a/testsuite/systemtap.samples/topsys.stp b/testsuite/systemtap.samples/topsys.stp deleted file mode 100644 index da31c858..00000000 --- a/testsuite/systemtap.samples/topsys.stp +++ /dev/null @@ -1,69 +0,0 @@ -#! stap -g -# -# This script continuously lists the top 20 systemcalls in the interval -# of 2000 jiffies. -# - -global syscalls_count, syscalls - -function syscall_name:string () %{ - char *str, buff[80]; - char *tok; - str = buff; - strlcpy(str, CONTEXT->probe_point, sizeof(buff)); - tok = strsep(&str, "\""); - tok = strsep(&str, "@"); - sprintf(str, "%-25s", tok); - strlcpy(THIS->__retvalue, str, MAXSTRINGLEN); -%} - -function reset_maxaction () %{ - if (CONTEXT && CONTEXT->actioncount) - CONTEXT->actioncount=0; -%} - -function accumulate () { - syscall=syscall_name() - syscalls_count[syscall]++ - # I use this array to refer to syscalls_count array in - # the reset_syscalls_count. Initalize with a non-zero. - syscalls[syscall]=1 -} - - -function print_top () { - lcnt=0 - reset_maxaction () - foreach ([syscall] in syscalls_count-) { - sys_cnt = syscalls_count[syscall] - log (syscall . "\t\t\t\t" . sprint(sys_cnt)) - if (lcnt++ == 20) - break; - } - syscalls_count[lsyscall]=0 -} - -function reset_syscalls_count () { - # For some reason, I have to do this to get pass the elaboration - # phase on RHEL4 (seg fault). Under FC4, it works fine with out - # the 'dummy_init' - syscalls["dummy_init"]=0 - foreach ([sys] in syscalls) - syscalls_count[sys]=0 -} - -function print_systop () { - log ("SYSCALL \t\t\t\tCOUNT") - print_top() - reset_syscalls_count () -} - -probe kernel.function("sys_*").call { - accumulate () -} - -probe timer.jiffies(2000) { - print_systop () - log("--------------------------------------------------------------") -} - |