summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/buildok/task-embedded.stp4
-rwxr-xr-xtestsuite/buildok/task_test.stp2
-rw-r--r--testsuite/lib/stap_run2.exp23
-rwxr-xr-xtestsuite/semok/badvar.stp7
-rwxr-xr-xtestsuite/semok/cast.stp13
-rw-r--r--testsuite/systemtap.base/cast.exp4
-rw-r--r--testsuite/systemtap.base/cast.stp22
-rw-r--r--testsuite/systemtap.base/itrace.exp7
-rw-r--r--testsuite/systemtap.base/sdt.c2
-rw-r--r--testsuite/systemtap.base/sdt.exp39
-rw-r--r--testsuite/systemtap.base/sdt.stp20
-rw-r--r--testsuite/systemtap.base/static_uprobes.exp28
-rw-r--r--testsuite/systemtap.base/tracepoints.exp3
-rw-r--r--testsuite/systemtap.base/tracepoints.stp23
-rw-r--r--testsuite/systemtap.examples/index.html3
-rw-r--r--testsuite/systemtap.examples/index.txt13
-rw-r--r--testsuite/systemtap.examples/io/ioblktime.meta13
-rwxr-xr-xtestsuite/systemtap.examples/io/ioblktime.stp29
-rw-r--r--testsuite/systemtap.examples/keyword-index.html3
-rw-r--r--testsuite/systemtap.examples/keyword-index.txt13
-rw-r--r--testsuite/systemtap.examples/network/tcp.stp11
-rw-r--r--testsuite/systemtap.samples/ioblocktest.exp11
-rw-r--r--testsuite/systemtap.samples/ioblocktest.stp12
23 files changed, 233 insertions, 72 deletions
diff --git a/testsuite/buildok/task-embedded.stp b/testsuite/buildok/task-embedded.stp
index 4d1f5300..d35f3e0d 100755
--- a/testsuite/buildok/task-embedded.stp
+++ b/testsuite/buildok/task-embedded.stp
@@ -14,6 +14,8 @@ probe begin {
task_nice (0) +
task_cpu (0) +
task_open_file_handles (0) +
- task_max_file_handles (0))
+ task_max_file_handles (0) +
+ pid2task(0))
print (task_execname (0))
+ print (pid2execname (0))
}
diff --git a/testsuite/buildok/task_test.stp b/testsuite/buildok/task_test.stp
index c8da7da5..792f96ea 100755
--- a/testsuite/buildok/task_test.stp
+++ b/testsuite/buildok/task_test.stp
@@ -16,5 +16,7 @@ probe begin {
log(sprint(task_cpu(c)))
log(sprint(task_open_file_handles(c)))
log(sprint(task_max_file_handles(c)))
+ log(sprint(pid2task(pid())))
+ log(sprint(pid2execname(pid())))
exit()
}
diff --git a/testsuite/lib/stap_run2.exp b/testsuite/lib/stap_run2.exp
index cb1c6615..d1f02c83 100644
--- a/testsuite/lib/stap_run2.exp
+++ b/testsuite/lib/stap_run2.exp
@@ -10,12 +10,27 @@
proc stap_run2 { TEST_NAME args } {
# zap the srcdir prefix
- set test_file_name $TEST_NAME
+ set TEST_FILE $TEST_NAME
set TEST_NAME [regsub {.*/testsuite/} $TEST_NAME ""]
-
+ if {[llength $args] == 0} {
+ stap_run3 $TEST_NAME $TEST_FILE
+ } else {
+ stap_run3 $TEST_NAME $TEST_FILE $args
+ }
+}
+
+# stap_run3 TEST_NAME TEST_FILE
+# TEST_NAME is the name of the test as shown in PASS/FAIL/SKIPPED messages.
+# TEST_FILE is the path to the current test
+# Additional arguments are passed to stap as-is.
+#
+# global result_string must be set to the expected output
+
+proc stap_run3 { TEST_NAME TEST_FILE args } {
if {[info procs installtest_p] != "" && ![installtest_p]} { untested $TEST_NAME; return }
-
- set cmd [concat stap $args $test_file_name]
+
+ set cmd [concat stap $TEST_FILE $args]
+ send_log "executing: $cmd\n"
catch {eval exec $cmd} res
set n 0
diff --git a/testsuite/semok/badvar.stp b/testsuite/semok/badvar.stp
new file mode 100755
index 00000000..b3bd2d67
--- /dev/null
+++ b/testsuite/semok/badvar.stp
@@ -0,0 +1,7 @@
+#! stap --skip-badvars
+
+probe syscall.read {
+ if ($foo == 0)
+ printf ("Voila! It works..\n")
+ exit ()
+}
diff --git a/testsuite/semok/cast.stp b/testsuite/semok/cast.stp
new file mode 100755
index 00000000..93da18ef
--- /dev/null
+++ b/testsuite/semok/cast.stp
@@ -0,0 +1,13 @@
+#! stap -p2
+
+probe begin {
+ // basic @cast test, with and without specifying kernel
+ println(@cast(0, "task_struct")->tgid)
+ println(@cast(0, "task_struct", "kernel")->tgid)
+
+ // check module-search paths
+ println(@cast(0, "task_struct", "foo:kernel:bar")->tgid)
+
+ // would be nice to test usermode @cast too,
+ // but who knows what debuginfo is installed...
+}
diff --git a/testsuite/systemtap.base/cast.exp b/testsuite/systemtap.base/cast.exp
new file mode 100644
index 00000000..df3246e8
--- /dev/null
+++ b/testsuite/systemtap.base/cast.exp
@@ -0,0 +1,4 @@
+set test "cast"
+set ::result_string {PID OK
+execname OK}
+stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.base/cast.stp b/testsuite/systemtap.base/cast.stp
new file mode 100644
index 00000000..bec0cc9b
--- /dev/null
+++ b/testsuite/systemtap.base/cast.stp
@@ -0,0 +1,22 @@
+probe begin
+{
+ curr = task_current()
+
+ // Compare PIDs
+ pid = pid()
+ cast_pid = @cast(curr, "task_struct")->tgid
+ if (pid == cast_pid)
+ println("PID OK")
+ else
+ printf("PID %d != %d\n", pid, cast_pid)
+
+ // Compare execnames
+ name = execname()
+ cast_name = kernel_string(@cast(curr, "task_struct")->comm)
+ if (name == cast_name)
+ println("execname OK")
+ else
+ printf("execname \"%s\" != \"%s\"\n", name, cast_name)
+
+ exit()
+}
diff --git a/testsuite/systemtap.base/itrace.exp b/testsuite/systemtap.base/itrace.exp
index f19af977..e215bfe7 100644
--- a/testsuite/systemtap.base/itrace.exp
+++ b/testsuite/systemtap.base/itrace.exp
@@ -1,8 +1,5 @@
# itrace test
-# temporarily disabled
-return
-
# Initialize variables
set utrace_support_found 0
@@ -11,7 +8,7 @@ set exepath "[pwd]/ls_[pid]"
set itrace1_script {
global instrs = 0
probe begin { printf("systemtap starting probe\n") }
- probe process("%s").itrace
+ probe process("%s").insn
{
instrs += 1
if (instrs == 5)
@@ -28,7 +25,7 @@ set itrace1_script_output "itraced = 5\r\n"
set itrace2_script {
global instrs = 0, itrace_on = 0, start_timer = 0
probe begin { start_timer = 1; printf("systemtap starting probe\n") }
- probe process("%s").itrace if (itrace_on)
+ probe process("%s").insn if (itrace_on)
{
instrs += 1
if (instrs == 5)
diff --git a/testsuite/systemtap.base/sdt.c b/testsuite/systemtap.base/sdt.c
index 46f68664..7c7398e5 100644
--- a/testsuite/systemtap.base/sdt.c
+++ b/testsuite/systemtap.base/sdt.c
@@ -65,5 +65,7 @@ main (int argc, char **argv)
call8(a, b, c, d, e, f, g, h);
call9(a, b, c, d, e, f, g, h, i);
call10(a, b, c, d, e, f, g, h, i, j);
+ (void) argv;
+ (void) argc;
return 0;
}
diff --git a/testsuite/systemtap.base/sdt.exp b/testsuite/systemtap.base/sdt.exp
index 09aaaf8d..46fa5a28 100644
--- a/testsuite/systemtap.base/sdt.exp
+++ b/testsuite/systemtap.base/sdt.exp
@@ -10,54 +10,61 @@ set ::result_string {1
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 10}
-set extra_flags {{""} {additional_flags=-ansi}}
+set extra_flags {{""} {additional_flags=-std=gnu89} {additional_flags=-ansi} {additional_flags=-pedantic} {additional_flags=-ansi additional_flags=-pedantic} {additional_flags=-O2} {additional_flags="-O3"}}
# Iterate extra_flags, trying each with C and C++
for {set i 0} {$i < [llength $extra_flags]} {incr i} {
+set extra_flag [lindex $extra_flags $i]
+set testprog "sdt.c.exe.$i"
+
# C
set test_flags "additional_flags=-g"
set test_flags "$test_flags additional_flags=-I$srcdir/../includes/sys"
-set test_flags "$test_flags additional_flags=-std=gnu89"
set test_flags "$test_flags additional_flags=-Wall"
-set test_flags "$test_flags additional_flags=-Wdeclaration-after-statement"
+set test_flags "$test_flags additional_flags=-Wextra"
set test_flags "$test_flags additional_flags=-Werror"
-set res [target_compile $srcdir/$subdir/$test.c $test.prog executable [concat $test_flags " " [lindex $extra_flags $i]]]
+set saveidx 0
+
+set res [target_compile $srcdir/$subdir/$test.c $testprog executable "$test_flags $extra_flag"]
if { $res != "" } {
verbose "target_compile failed: $res" 2
- fail "compiling $test.c"
- return
+ fail "compiling $test.c $extra_flag"
+ untested "$test $extra_flag"
+ continue
} else {
- pass "compiling $test.c"
+ pass "compiling $test.c $extra_flag"
}
if {[installtest_p]} {
- stap_run2 $srcdir/$subdir/$test.stp -c ./$test.prog
+ stap_run3 "$test $extra_flag" $srcdir/$subdir/$test.stp $testprog -c ./$testprog
} else {
- untested "$test"
+ untested "$test $extra_flag"
}
# C++
+set testprog "sdt.cxx.exe.$i"
+
set test_flags "additional_flags=-g"
set test_flags "$test_flags additional_flags=-I$srcdir/../includes/sys"
set test_flags "$test_flags additional_flags=-Wall"
set test_flags "$test_flags additional_flags=-Werror"
set test_flags "$test_flags additional_flags=-x additional_flags=c++"
-set res [target_compile $srcdir/$subdir/$test.c $test.prog executable [concat $test_flags [lindex $extra_flags $i]]]
+set res [target_compile $srcdir/$subdir/$test.c $testprog executable "$test_flags $extra_flag"]
if { $res != "" } {
verbose "target_compile failed: $res" 2
- fail "compiling $test.c"
- return
+ fail "compiling $test.c c++ $extra_flag"
+ untested "$test $extra_flag"
+ continue
} else {
- pass "compiling $test.c"
+ pass "compiling $test.c c++ $extra_flag"
}
if {[installtest_p]} {
- stap_run2 $srcdir/$subdir/$test.stp -c ./$test.prog
+ stap_run3 "$test c++ $extra_flag" $srcdir/$subdir/$test.stp $testprog -c ./$testprog
} else {
- untested "$test"
+ untested "$test c++ $extra_flag"
}
}
-catch {exec rm -f $test.prog}
diff --git a/testsuite/systemtap.base/sdt.stp b/testsuite/systemtap.base/sdt.stp
index 1f075bca..5df1fdc9 100644
--- a/testsuite/systemtap.base/sdt.stp
+++ b/testsuite/systemtap.base/sdt.stp
@@ -1,49 +1,49 @@
-probe process("sdt.prog").mark("mark_a")
+probe process(@1).mark("mark_a")
{
printf("%d\n", $arg1);
}
-probe process("sdt.prog").mark("mark_b")
+probe process(@1).mark("mark_b")
{
printf("%d %d\n", $arg1, $arg2);
}
-probe process("sdt.prog").mark("mark_c")
+probe process(@1).mark("mark_c")
{
printf("%d %d %d\n", $arg1, $arg2, $arg3);
}
-probe process("sdt.prog").mark("mark_d")
+probe process(@1).mark("mark_d")
{
printf("%d %d %d %d\n", $arg1, $arg2, $arg3, $arg4);
}
-probe process("sdt.prog").mark("mark_e")
+probe process(@1).mark("mark_e")
{
printf("%d %d %d %d %d\n", $arg1, $arg2, $arg3, $arg4, $arg5);
}
-probe process("sdt.prog").mark("mark_f")
+probe process(@1).mark("mark_f")
{
printf("%d %d %d %d %d %d\n", $arg1, $arg2, $arg3, $arg4, $arg5, $arg6);
}
-probe process("sdt.prog").mark("mark_g")
+probe process(@1).mark("mark_g")
{
printf("%d %d %d %d %d %d %d\n", $arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7);
}
-probe process("sdt.prog").mark("mark_h")
+probe process(@1).mark("mark_h")
{
printf("%d %d %d %d %d %d %d %d\n", $arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7, $arg8);
}
-probe process("sdt.prog").mark("mark_i")
+probe process(@1).mark("mark_i")
{
printf("%d %d %d %d %d %d %d %d %d\n", $arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7, $arg8, $arg9);
}
-probe process("sdt.prog").mark("mark_j")
+probe process(@1).mark("mark_j")
{
printf("%d %d %d %d %d %d %d %d %d %d\n", $arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7, $arg8, $arg9, $arg10);
}
diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp
index a4bd5e2c..e407440e 100644
--- a/testsuite/systemtap.base/static_uprobes.exp
+++ b/testsuite/systemtap.base/static_uprobes.exp
@@ -1,5 +1,4 @@
-
-set test "sduprobes"
+set test "static_uprobes"
# Compile a C program to use as the user-space probing target
set sup_srcpath "[pwd]/static_uprobes.c"
@@ -104,7 +103,11 @@ if {[installtest_p]} {
set sdtdir $srcdir/../includes
}
-set sup_flags "additional_flags=-I$sdtdir additional_flags=-g additional_flags=-O additional_flags=-I."
+set sup_flags "additional_flags=-I$srcdir/../includes/sys"
+set sup_flags "$sup_flags additional_flags=-I$sdtdir"
+set sup_flags "$sup_flags additional_flags=-g"
+set sup_flags "$sup_flags additional_flags=-O"
+set sup_flags "$sup_flags additional_flags=-I."
set res [target_compile $sup_srcpath $sup_exepath executable $sup_flags]
if { $res != "" } {
verbose "target_compile failed: $res" 2
@@ -115,9 +118,7 @@ if { $res != "" } {
pass "$test compiling C -g"
}
-spawn mv $sup_srcpath "[pwd]/static_uprobes.cc"
-set sup_srcpath "[pwd]/static_uprobes.cc"
-set sup_flags "$sup_flags c++"
+set sup_flags "$sup_flags additional_flags=-x additional_flags=c++"
set res [target_compile $sup_srcpath $supcplus_exepath executable $sup_flags]
if { $res != "" } {
verbose "target_compile failed: $res" 2
@@ -163,9 +164,9 @@ if {$ok == 5} { pass "$test C" } { fail "$test C ($ok)" }
set ok 0
-# spawn objcopy -R .probes $supcplus_exepath $sup_exepath
-verbose -log "cp $supcplus_exepath $sup_exepath"
-spawn cp $supcplus_exepath $sup_exepath
+# Test setting a probe without .probes using only dwarf label info
+verbose -log "objcopy -R .probes $supcplus_exepath $sup_exepath"
+spawn objcopy -R .probes $supcplus_exepath $sup_exepath
verbose -log "spawn stap -c $sup_exepath $sup_stppath"
spawn stap -c $sup_exepath $sup_stppath
expect {
@@ -180,9 +181,10 @@ expect {
wait
-if {$ok == 5} { pass "$test C++" } { fail "$test C++ ($ok)" }
+# we now generate the probes via asm so there is no label debug info
+if {$ok == 5} { pass "$test C++" } { xfail "$test C++ ($ok)" }
-# catch {exec rm -f $sup_srcpath $sup_exepath $supcplus_exepath $sup_hpath $sup_stppath}
+if { $verbose == 0 } {
+catch {exec rm -f $sup_srcpath $sup_exepath $supcplus_exepath $sup_dpath $sup_hpath $sup_stppath}
+}
-# It's not so important to clean up, and it's unhelpful if
-# one needs to diagnose a test failure.
diff --git a/testsuite/systemtap.base/tracepoints.exp b/testsuite/systemtap.base/tracepoints.exp
new file mode 100644
index 00000000..bea461c4
--- /dev/null
+++ b/testsuite/systemtap.base/tracepoints.exp
@@ -0,0 +1,3 @@
+set test "tracepoints"
+set ::result_string {tracepoints OK}
+stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.base/tracepoints.stp b/testsuite/systemtap.base/tracepoints.stp
new file mode 100644
index 00000000..bdb4d730
--- /dev/null
+++ b/testsuite/systemtap.base/tracepoints.stp
@@ -0,0 +1,23 @@
+// This checks that we can compile and register every tracepoint
+// we can find, along with all of their context variables.
+global hits
+probe all_tracepoints = kernel.trace("*")
+{
+ if ($$name . $$vars . $$parms == "")
+ next
+
+ // Allow it to quit once we hit our hundredth tracepoint
+ if (++hits < 100)
+ next
+}
+
+// If there aren't any tracepoints in the kernel,
+// we use "begin" instead to quit right away.
+probe all_tracepoints!, begin {
+ println("tracepoints OK")
+ exit()
+}
+
+// give hits a use so there's no warning
+// when we don't have tracepoints
+probe never { hits++ }
diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html
index 7b76baa1..0f4b2572 100644
--- a/testsuite/systemtap.examples/index.html
+++ b/testsuite/systemtap.examples/index.html
@@ -58,6 +58,9 @@ keywords: <a href="keyword-index.html#DISK">DISK</a> <br>
<li><a href="io/io_submit.stp">io/io_submit.stp</a> - Tally Reschedule Reason During AIO io_submit Call<br>
keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
<p>When a reschedule occurs during an AIO io_submit call, accumulate the traceback in a histogram. When the script exits prints out a sorted list from most common to least common backtrace.</p></li>
+<li><a href="io/ioblktime.stp">io/ioblktime.stp</a> - Average Time Block IO Requests Spend in Queue <br>
+keywords: <a href="keyword-index.html#IO">IO</a> <br>
+<p>The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script compute the average time waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many oustanding block IO operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with "-DMAXMAPENTRIES=10000" option on the stap command line.</p></li>
<li><a href="io/iostats.stp">io/iostats.stp</a> - List Executables Reading and Writing the Most Data<br>
keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
<p> The iostat.stp script measures the amount of data successfully read and written by all the executables on the system. The output is sorted from most greatest sum of bytes read and written by an executable to the least. The output contains the count of operations (opens, reads, and writes), the totals and averages for the number of bytes read and written.</p></li>
diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt
index fdcd3b31..e31baf4f 100644
--- a/testsuite/systemtap.examples/index.txt
+++ b/testsuite/systemtap.examples/index.txt
@@ -52,6 +52,19 @@ keywords: io backtrace
list from most common to least common backtrace.
+io/ioblktime.stp - Average Time Block IO Requests Spend in Queue
+keywords: io
+
+ The ioblktime.stp script tracks the amount of time that each block IO
+ requests spend waiting for completion. The script compute the average
+ time waiting time for block IO per device and prints list every 10
+ seconds. In some cases there can be too many oustanding block IO
+ operations and the script may exceed the default number of
+ MAXMAPENTRIES allowed. In this case the allowed number can be
+ increased with "-DMAXMAPENTRIES=10000" option on the stap command
+ line.
+
+
io/iostats.stp - List Executables Reading and Writing the Most Data
keywords: io profiling
diff --git a/testsuite/systemtap.examples/io/ioblktime.meta b/testsuite/systemtap.examples/io/ioblktime.meta
new file mode 100644
index 00000000..18a8b168
--- /dev/null
+++ b/testsuite/systemtap.examples/io/ioblktime.meta
@@ -0,0 +1,13 @@
+title: Average Time Block IO Requests Spend in Queue
+name: ioblktime.stp
+version: 1.0
+author: William Cohen
+keywords: io
+subsystem: kernel
+status: production
+exit: user-controlled
+output: sorted-list
+scope: system-wide
+description: The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script computes the average time waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many oustanding block IO operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with "-DMAXMAPENTRIES=10000" option on the stap command line.
+test_check: stap -p4 ioblktime.stp
+test_installcheck: stap ioblktime.stp -c "sleep 1"
diff --git a/testsuite/systemtap.examples/io/ioblktime.stp b/testsuite/systemtap.examples/io/ioblktime.stp
new file mode 100755
index 00000000..5ff59cf7
--- /dev/null
+++ b/testsuite/systemtap.examples/io/ioblktime.stp
@@ -0,0 +1,29 @@
+#! /usr/bin/env stap
+
+global req_time, etimes
+
+probe ioblock.request
+{
+ req_time[$bio] = gettimeofday_us()
+}
+
+probe ioblock.end
+{
+ t = gettimeofday_us()
+ s = req_time[$bio]
+ delete req_time[$bio]
+ if (s) {
+ etimes[devname, bio_rw_str(rw)] <<< t - s
+ }
+}
+
+probe timer.s(10), end {
+ printf("\033[2J\033[1;1H") /* clear screen */
+ printf("%10s %3s %10s %10s %10s\n",
+ "device", "rw", "total (us)", "count", "avg (us)")
+ foreach ([dev,rw] in etimes - limit 20) {
+ printf("%10s %3s %10d %10d %10d\n", dev, rw,
+ @sum(etimes[dev,rw]), @count(etimes[dev,rw]), @avg(etimes[dev,rw]))
+ }
+ delete etimes
+}
diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html
index b3ea0943..75768709 100644
--- a/testsuite/systemtap.examples/keyword-index.html
+++ b/testsuite/systemtap.examples/keyword-index.html
@@ -102,6 +102,9 @@ keywords: <a href="keyword-index.html#INTERRUPT">INTERRUPT</a> <a href="keyword-
<li><a href="io/io_submit.stp">io/io_submit.stp</a> - Tally Reschedule Reason During AIO io_submit Call<br>
keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
<p>When a reschedule occurs during an AIO io_submit call, accumulate the traceback in a histogram. When the script exits prints out a sorted list from most common to least common backtrace.</p></li>
+<li><a href="io/ioblktime.stp">io/ioblktime.stp</a> - Average Time Block IO Requests Spend in Queue <br>
+keywords: <a href="keyword-index.html#IO">IO</a> <br>
+<p>The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script compute the average time waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many oustanding block IO operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with "-DMAXMAPENTRIES=10000" option on the stap command line.</p></li>
<li><a href="io/iostats.stp">io/iostats.stp</a> - List Executables Reading and Writing the Most Data<br>
keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
<p> The iostat.stp script measures the amount of data successfully read and written by all the executables on the system. The output is sorted from most greatest sum of bytes read and written by an executable to the least. The output contains the count of operations (opens, reads, and writes), the totals and averages for the number of bytes read and written.</p></li>
diff --git a/testsuite/systemtap.examples/keyword-index.txt b/testsuite/systemtap.examples/keyword-index.txt
index 5f382e75..d3a9617f 100644
--- a/testsuite/systemtap.examples/keyword-index.txt
+++ b/testsuite/systemtap.examples/keyword-index.txt
@@ -125,6 +125,19 @@ keywords: io backtrace
list from most common to least common backtrace.
+io/ioblktime.stp - Average Time Block IO Requests Spend in Queue
+keywords: io
+
+ The ioblktime.stp script tracks the amount of time that each block IO
+ requests spend waiting for completion. The script compute the average
+ time waiting time for block IO per device and prints list every 10
+ seconds. In some cases there can be too many oustanding block IO
+ operations and the script may exceed the default number of
+ MAXMAPENTRIES allowed. In this case the allowed number can be
+ increased with "-DMAXMAPENTRIES=10000" option on the stap command
+ line.
+
+
io/iostats.stp - List Executables Reading and Writing the Most Data
keywords: io profiling
diff --git a/testsuite/systemtap.examples/network/tcp.stp b/testsuite/systemtap.examples/network/tcp.stp
new file mode 100644
index 00000000..ebe72a1c
--- /dev/null
+++ b/testsuite/systemtap.examples/network/tcp.stp
@@ -0,0 +1,11 @@
+//A simple TCP tapset example
+
+probe begin {
+ printf("Expected IP 7.91.205.21 .... %s\n", ip_ntop(123456789))
+ printf("Expected IP 58.222.104.177 .... %s\n", ip_ntop(987654321))
+ printf("Expected IP 9.3.191.111 ... %s\n", ip_ntop(151240559))
+}
+
+probe tcp.recvmsg {
+ printf("received a message from %s on port %d from port %d\n", saddr, dport, sport)
+}
diff --git a/testsuite/systemtap.samples/ioblocktest.exp b/testsuite/systemtap.samples/ioblocktest.exp
deleted file mode 100644
index b5ab54c7..00000000
--- a/testsuite/systemtap.samples/ioblocktest.exp
+++ /dev/null
@@ -1,11 +0,0 @@
-# Test the functionality of the various ioblock probes.
-
-set test "ioblocktest"
-
-proc sleep_ten_secs {} {
- after 10000;
- return 0;
-}
-
-set output_string "ioblock: \\S+\t\\d+\t\[RW]\t\[01]\r\n"
-stap_run $srcdir/$subdir/$test.stp sleep_ten_secs $output_string
diff --git a/testsuite/systemtap.samples/ioblocktest.stp b/testsuite/systemtap.samples/ioblocktest.stp
deleted file mode 100644
index f8a1c568..00000000
--- a/testsuite/systemtap.samples/ioblocktest.stp
+++ /dev/null
@@ -1,12 +0,0 @@
-#! stap
-global teststr
-probe begin { println("systemtap starting probe") }
-
-probe ioblock.request, ioblock.end {
- teststr = sprintf("ioblock: %s\t%d\t%s\t%d\n", devname, sector,
- bio_rw_str(rw), bio_rw_num(rw))
-}
-probe end {
- println("systemtap ending probe")
- printf("%s", teststr)
-}