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.exp30
-rw-r--r--testsuite/lib/systemtap.exp124
-rwxr-xr-xtestsuite/semok/badvar.stp7
-rwxr-xr-xtestsuite/semok/cast.stp13
-rw-r--r--testsuite/systemtap.base/cache.exp1
-rw-r--r--testsuite/systemtap.base/cast.exp4
-rw-r--r--testsuite/systemtap.base/cast.stp22
-rw-r--r--testsuite/systemtap.base/ctime.exp3
-rw-r--r--testsuite/systemtap.base/gtod_init.exp29
-rw-r--r--testsuite/systemtap.base/labels.exp86
-rw-r--r--testsuite/systemtap.base/limits.exp3
-rw-r--r--testsuite/systemtap.base/overflow_error.exp32
-rw-r--r--testsuite/systemtap.base/overflow_error.stp22
-rw-r--r--testsuite/systemtap.base/sdt.c71
-rw-r--r--testsuite/systemtap.base/sdt.exp64
-rw-r--r--testsuite/systemtap.base/sdt.stp49
-rw-r--r--testsuite/systemtap.base/static_uprobes.exp11
-rw-r--r--testsuite/systemtap.base/stmt_rel.exp3
-rw-r--r--testsuite/systemtap.base/tracepoints.exp3
-rw-r--r--testsuite/systemtap.base/tracepoints.stp23
-rwxr-xr-x[-rw-r--r--]testsuite/systemtap.examples/interrupt/scf.stp0
-rwxr-xr-x[-rw-r--r--]testsuite/systemtap.examples/io/iostats.stp0
-rwxr-xr-x[-rw-r--r--]testsuite/systemtap.examples/memory/pfaults.stp0
-rwxr-xr-x[-rw-r--r--]testsuite/systemtap.examples/network/tcp_connections.stp0
-rwxr-xr-x[-rw-r--r--]testsuite/systemtap.examples/profiling/latencytap.stp0
-rwxr-xr-x[-rw-r--r--]testsuite/systemtap.examples/profiling/timeout.stp0
-rwxr-xr-x[-rw-r--r--]testsuite/systemtap.examples/profiling/topsys.stp0
-rwxr-xr-xtestsuite/systemtap.maps/exists.exp3
-rw-r--r--testsuite/systemtap.maps/foreach_foreach.exp3
-rw-r--r--testsuite/systemtap.maps/foreach_limit.exp3
-rw-r--r--testsuite/systemtap.maps/foreach_limit2.exp3
-rw-r--r--testsuite/systemtap.maps/ii.exp3
-rw-r--r--testsuite/systemtap.maps/iiiiii.exp3
-rw-r--r--testsuite/systemtap.maps/is.exp3
-rw-r--r--testsuite/systemtap.maps/ix.exp3
-rw-r--r--testsuite/systemtap.maps/linear.exp1
-rw-r--r--testsuite/systemtap.maps/linear_empty.exp3
-rw-r--r--testsuite/systemtap.maps/linear_large.exp1
-rw-r--r--testsuite/systemtap.maps/linear_large_neg.exp1
-rw-r--r--testsuite/systemtap.maps/linear_over.exp1
-rw-r--r--testsuite/systemtap.maps/linear_overunder.exp1
-rw-r--r--testsuite/systemtap.maps/linear_under.exp1
-rw-r--r--testsuite/systemtap.maps/log.exp1
-rw-r--r--testsuite/systemtap.maps/log_edge.exp3
-rw-r--r--testsuite/systemtap.maps/si.exp3
-rw-r--r--testsuite/systemtap.maps/ss.exp3
-rw-r--r--testsuite/systemtap.printf/basic3.exp3
-rw-r--r--testsuite/systemtap.printf/bin6.expbin1225 -> 1224 bytes
-rw-r--r--testsuite/systemtap.printf/char1.exp5
-rw-r--r--testsuite/systemtap.printf/int1.exp3
-rw-r--r--testsuite/systemtap.printf/memory1.exp3
-rw-r--r--testsuite/systemtap.printf/print.exp3
-rw-r--r--testsuite/systemtap.printf/print_char.exp3
-rw-r--r--testsuite/systemtap.printf/println.exp3
-rw-r--r--testsuite/systemtap.printf/ptr.exp6
-rw-r--r--testsuite/systemtap.printf/string1.exp3
-rwxr-xr-xtestsuite/systemtap.server/hello.stp8
-rw-r--r--testsuite/systemtap.server/server.exp39
-rw-r--r--testsuite/systemtap.string/dot.exp3
-rw-r--r--testsuite/systemtap.string/isinstr.exp3
-rw-r--r--testsuite/systemtap.string/sprint.exp3
-rw-r--r--testsuite/systemtap.string/strlen.exp3
-rw-r--r--testsuite/systemtap.string/strtol.exp3
-rw-r--r--testsuite/systemtap.string/substr.exp3
66 files changed, 617 insertions, 129 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 9849aefb..b734a1e7 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 $args $TEST_FILE]
+ send_log "executing: $cmd\n"
catch {eval exec $cmd} res
set n 0
@@ -29,5 +44,10 @@ proc stap_run2 { TEST_NAME args } {
}
incr n
}
- pass "$TEST_NAME"
+ if {[expr $n == [llength $expected]]} {
+ pass "$TEST_NAME"
+ } else {
+ fail "$TEST_NAME"
+ send_log "too few lines of output, got $n, expected [llength $expected]\n"
+ }
}
diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp
index 5bf125b9..c80ad171 100644
--- a/testsuite/lib/systemtap.exp
+++ b/testsuite/lib/systemtap.exp
@@ -37,7 +37,7 @@ proc print_systemtap_version {} {
proc setup_systemtap_environment {} {
- global srcdir prefix env server_pid net_path
+ global srcdir env
# need an absolute SRCDIR for the top-level src/ tree
# XXX: or, we could change nearby uses of ${SRCDIR}/testsuite to ${SRCDIR}
@@ -53,40 +53,9 @@ proc setup_systemtap_environment {} {
# Find or start a systemtap server, if requested.
if {[use_server_p]} then {
- print "Testing using a systemtap server"
-
- # A place for some temporary files and scripts.
- set net_path [exec pwd]/net
- exec /bin/mkdir -p $net_path
-
- # Server management scripts and data are installed if this is an
- # install test, otherwise there is some setup to do.
- if {! [installtest_p]} then {
- # Make sure the server management scripts and tools are on the $PATH.
- set env(PATH) "$srcdir/..:[exec pwd]/..:$env(PATH)"
+ if {! [setup_server]} then {
+ return 0
}
-
- # Try to find or start the server.
- set server_pid [exec stap-find-or-start-server]
- if { "$server_pid" == "-1" } then {
- print "Cannot find or start a systemtap server"
- set server_pid 0
- # TODO: How do we abort here?
- } elseif { "$server_pid" == "0" } then {
- print "A compatible systemtap server is already available"
- } else {
- print "Started a systemtap server as PID==$server_pid"
- }
-
- # Make a copy of 'stap-client' as 'stap' and make sure it's at the
- # beginning of the $PATH. Do this after starting the server so that
- # The server does not call this instance of 'stap'
- if {[installtest_p]} then {
- exec /bin/cp -p [exec which stap-client] $net_path/stap
- } else {
- exec /bin/cp -p $srcdir/../stap-client $net_path/stap
- }
- set env(PATH) "$net_path:$env(PATH)"
}
# PATH, SYSTEMTAP_TAPSET, SYSTEMTAP_RUNTIME, LD_LIBRARY_PATH are already set.
@@ -95,6 +64,78 @@ proc setup_systemtap_environment {} {
verbose -log "env $var = $env($var)"
}
}
+
+ return 1
+}
+
+# Set up the environment so that tests will be performed using the systemtap
+# client and server.
+proc setup_server {} {
+ global srcdir env server_pid net_path
+
+ # Make sure that the necessary resources are available to run the client/server.
+ if {[installtest_p]} then {
+ if {[exec /usr/bin/which stap-client-connect] == ""} then {
+ print "Unable to start a server: stap-client-connect is not found in PATH"
+ return 0
+ }
+ } elseif {! [file exists [exec pwd]/../stap-client-connect]} then {
+ print "Unable to start a server: [exec pwd]/../stap-client-connect is not found"
+ return 0
+ }
+ if {[exec /usr/bin/which avahi-publish-service] == ""} then {
+ print "Unable to start a server: avahi-publish-service is not found in PATH"
+ return 0
+ }
+
+ print "Testing using a systemtap server"
+
+ # A place for some temporary files and scripts.
+ set net_path [exec pwd]/net
+ exec /bin/mkdir -p $net_path
+
+ # Server management scripts and data are installed if this is an
+ # install test, otherwise there is some setup to do.
+ if {! [installtest_p]} then {
+ # Make sure the server management scripts and tools are on the $PATH.
+ set env(PATH) "$srcdir/..:[exec pwd]/..:$env(PATH)"
+ }
+
+ # Try to find or start the server.
+ set server_pid [exec stap-find-or-start-server]
+ if { "$server_pid" == "-1" } then {
+ print "Cannot find or start a systemtap server"
+ set server_pid 0
+ return 0
+ } elseif { "$server_pid" == "0" } then {
+ print "A compatible systemtap server is already available"
+ } else {
+ print "Started a systemtap server as PID==$server_pid"
+ }
+
+ # Make a copy of 'stap-client' as 'stap' and make sure it's at the
+ # beginning of the $PATH. Do this after starting the server so that
+ # The server does not call this instance of 'stap'
+ if {[installtest_p]} then {
+ exec /bin/cp -p [exec which stap-client] $net_path/stap
+ } else {
+ exec /bin/cp -p $srcdir/../stap-client $net_path/stap
+ }
+ set env(PATH) "$net_path:$env(PATH)"
+
+ return 1
+}
+
+proc shutdown_server {} {
+ global server_pid net_path
+
+ if { $server_pid != 0 } then {
+ print "Stopping the systemtap server with PID==$server_pid"
+ exec stap-stop-server $server_pid
+ }
+
+ # Remove the temporary stap script
+ exec /bin/rm -fr $net_path
}
proc get_system_info {} {
@@ -116,7 +157,10 @@ proc get_system_info {} {
if [file exists /etc/debian_version] {set Distro [exec /bin/cat /etc/debian_version]}
}
-setup_systemtap_environment
+if {! [setup_systemtap_environment]} then {
+ return 0
+}
+
print_systemtap_version
get_system_info
@@ -124,17 +168,9 @@ proc systemtap_init {args} {}
proc systemtap_version {} {}
proc systemtap_exit {} {
- global server_pid net_path
-
# Stop the stap server, if we started it.
if {[use_server_p]} then {
- if { $server_pid != 0 } then {
- print "Stopping the systemtap server with PID==$server_pid"
- exec stap-stop-server $server_pid
- }
-
- # Remove the temporary stap script
- exec /bin/rm -fr $net_path
+ shutdown_server
}
}
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/cache.exp b/testsuite/systemtap.base/cache.exp
index 390af054..b10a4f28 100644
--- a/testsuite/systemtap.base/cache.exp
+++ b/testsuite/systemtap.base/cache.exp
@@ -116,6 +116,7 @@ set env(SYSTEMTAP_DIR) /dev/null
stap_compile DISABLED1 [F_UNCACHED_COMPILE] $basic_script1
stap_compile DISABLED2 [F_UNCACHED_COMPILE] $basic_script1
set env(SYSTEMTAP_DIR) $local_systemtap_dir
+eval [list exec /bin/rm -f] [glob "stap_*.ko"]
# Disable the cache with '-m'
stap_compile MODNAM1 [F_UNCACHED_COMPILE] $basic_script1 -m modnam
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/ctime.exp b/testsuite/systemtap.base/ctime.exp
index f6db096a..d5ae07d5 100644
--- a/testsuite/systemtap.base/ctime.exp
+++ b/testsuite/systemtap.base/ctime.exp
@@ -13,6 +13,5 @@ a long, long time ago...
Tue Jan 19 03:14:07 2038
far far in the future...
a long, long time ago...
-far far in the future...
-}
+far far in the future...}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.base/gtod_init.exp b/testsuite/systemtap.base/gtod_init.exp
new file mode 100644
index 00000000..48616b1f
--- /dev/null
+++ b/testsuite/systemtap.base/gtod_init.exp
@@ -0,0 +1,29 @@
+# test for checking initialization of the time subsystem
+set test "gtod_init"
+
+# check that init and kill are both present with a gettimeofday
+set time_init 0
+set time_kill 0
+spawn stap -p2 -e {probe begin { println(gettimeofday_s()) }}
+expect {
+ -timeout 120
+ -re {\n_gettimeofday_init:} { incr time_init; exp_continue }
+ -re {\n_gettimeofday_kill:} { incr time_kill; exp_continue }
+ timeout { fail "$test (timeout)" }
+ eof {
+ if {$time_init == 1} { pass "$test (init)" } { fail "$test (init $time_init)" }
+ if {$time_kill == 1} { pass "$test (kill)" } { fail "$test (kill $time_kill)" }
+ }
+}
+wait
+
+# check that init and kill are both NOT present without a gettimeofday
+spawn stap -p2 -e {probe begin { println(get_cycles()) }}
+expect {
+ -timeout 120
+ -re {\n_gettimeofday_init:} { fail "$test (bad init)" }
+ -re {\n_gettimeofday_kill:} { fail "$test (bad kill)" }
+ timeout { fail "$test (timeout)" }
+ eof { pass "$test (no init/kill)" }
+}
+wait
diff --git a/testsuite/systemtap.base/labels.exp b/testsuite/systemtap.base/labels.exp
index 9c92d69c..6db81c54 100644
--- a/testsuite/systemtap.base/labels.exp
+++ b/testsuite/systemtap.base/labels.exp
@@ -13,6 +13,7 @@ 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_sopath "[pwd]/labels.so"
set label_flags "additional_flags=-g"
set fp [open $label_srcpath "w"]
puts $fp "
@@ -54,9 +55,12 @@ if { $res != "" } {
pass "compiling labels.c -g"
}
+# label in an executable
+
verbose -log "spawn stap -c $label_exepath $label_stppath"
spawn stap -c $label_exepath $label_stppath
+wait
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 }
@@ -64,7 +68,83 @@ expect {
eof { }
}
-wait
+if {$ok == 1} { pass "$test exe .label" } { fail "$test exe .label" }
+
+# address of label in an executable
+
+set label_shpath "[pwd]/label.sh"
+set fp [open $label_shpath "w"]
+puts $fp "
+readelf --debug-dump $label_exepath | awk \"
+/init_another_int/ {have_label=1}
+/DW_AT_low_pc/ {if (have_label) {print \$3;exit;}}
+\"
+"
+close $fp
+spawn sh $label_shpath
+expect {
+ -re {0x[0-9a-f]*}
+}
+set nomatch 0
+spawn stap -p2 -l "process\(\"$label_exepath\"\).statement($expect_out(0,string))"
+expect {
+ -timeout 180
+ -re {semantic error: no match} { incr nomatch; exp_continue }
+ timeout { fail "$test (timeout)" }
+ eof { }
+}
+
+if {$nomatch == 0} { pass "$test exe .statement" } { fail "$test exe .statement" }
+
+set ok 0
+
+set label_flags "additional_flags=-g additional_flags=-shared additional_flags=-fPIC"
+set res [target_compile $label_srcpath $label_sopath executable $label_flags]
+if { $res != "" } {
+ verbose "target_compile failed: $res" 2
+ fail "compiling labels.c -g"
+ catch {exec rm -f $label_srcpath $label_stppath}
+ return
+} else {
+ pass "compiling labels.c -g"
+}
+
+# label in a shared object
+
+spawn stap -p2 -l "process\(\"$label_sopath\"\).function\(\"\*\"\).label\(\"init_another_int\"\)"
+expect {
+ -timeout 180
+ -re {process.*function} { incr ok; exp_continue }
+ timeout { fail "$test (timeout)" }
+ eof { }
+}
+
+if {$ok == 1} { pass "$test so .label" } { fail "$test so .label" }
+
+# address of label in a shared object
+
+set label_shpath "[pwd]/label.sh"
+set fp [open $label_shpath "w"]
+puts $fp "
+readelf --debug-dump $label_sopath | awk \"
+/init_another_int/ {have_label=1}
+/DW_AT_low_pc/ {if (have_label) {print \$3;exit;}}
+\"
+"
+close $fp
+spawn sh $label_shpath
+expect {
+ -re {0x[0-9a-f]*}
+}
+set nomatch 0
+spawn stap -p2 -l "process\(\"$label_sopath\"\).statement($expect_out(0,string))"
+expect {
+ -timeout 180
+ -re {semantic error: no match} { incr nomatch; exp_continue }
+ timeout { fail "$test (timeout)" }
+ eof { }
+}
+
+if {$nomatch == 0} { pass "$test so .statement" } { fail "$test so .statement" }
-if {$ok == 1} { pass "$test" } { fail "$test ($ok)" }
-catch {exec rm -f $label_srcpath $label_stppath $label_exepath}
+catch {exec rm -f $label_srcpath $label_stppath $label_exepath $label_shpath $label_sopath}
diff --git a/testsuite/systemtap.base/limits.exp b/testsuite/systemtap.base/limits.exp
index c5328e8f..c04d507d 100644
--- a/testsuite/systemtap.base/limits.exp
+++ b/testsuite/systemtap.base/limits.exp
@@ -32,7 +32,6 @@ Minimum signed 64-bit number
-9223372036854775808 0x8000000000000000
-9223372036854775808 0x8000000000000000
-9223372036854775808 0x8000000000000000
--9223372036854775808 0x8000000000000000
-}
+-9223372036854775808 0x8000000000000000}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.base/overflow_error.exp b/testsuite/systemtap.base/overflow_error.exp
new file mode 100644
index 00000000..33be90a7
--- /dev/null
+++ b/testsuite/systemtap.base/overflow_error.exp
@@ -0,0 +1,32 @@
+# Test overflow errors point to the correct thing.
+
+set test "overflow_error"
+if {![installtest_p]} { untested $test; return }
+
+set error_msg1 "ERROR: Array overflow, check size limit (3) near identifier 'overflow1' at $srcdir/$subdir/$test.stp"
+set error_msg2 "ERROR: Array overflow, check size limit (5) near identifier 'overflow2' at $srcdir/$subdir/$test.stp"
+set exit_warning "WARNING: Number of errors: 2, skipped probes: 0"
+
+set pass 0
+
+spawn stap -DMAXERRORS=1 $srcdir/$subdir/$test.stp
+expect {
+ $error_msg1 {incr pass; exp_continue}
+ $error_msg2 {incr pass; exp_continue}
+ $exit_warning {incr pass; exp_continue}
+ timeout {
+ exec kill -INT -[exp_pid]
+ fail "$test timed out"
+ }
+ eof {}
+}
+catch { close }
+wait
+
+if {$pass == 3} {
+ pass $test
+} else {
+ fail "$test ($pass)"
+}
+
+
diff --git a/testsuite/systemtap.base/overflow_error.stp b/testsuite/systemtap.base/overflow_error.stp
new file mode 100644
index 00000000..f5a3e917
--- /dev/null
+++ b/testsuite/systemtap.base/overflow_error.stp
@@ -0,0 +1,22 @@
+# overflow some stuff to see if error message point to the correct thing.
+global count;
+global overflow1[3];
+global overflow2[5];
+
+probe timer.ms(10)
+{
+ if (count <= 3)
+ {
+ overflow1[count++] = gettimeofday_ns();
+ }
+ else
+ {
+ overflow2[count++] <<< gettimeofday_ns();
+ }
+}
+
+probe timer.s(3)
+{
+ exit();
+}
+
diff --git a/testsuite/systemtap.base/sdt.c b/testsuite/systemtap.base/sdt.c
new file mode 100644
index 00000000..7c7398e5
--- /dev/null
+++ b/testsuite/systemtap.base/sdt.c
@@ -0,0 +1,71 @@
+#include "sdt.h" /* Really <sys/sdt.h>, but pick current source version. */
+
+static void call1(int a)
+{
+ STAP_PROBE1(test, mark_a, a);
+}
+
+static void call2(int a, int b)
+{
+ STAP_PROBE2(test, mark_b, a, b);
+}
+
+static void call3(int a, int b, int c)
+{
+ STAP_PROBE3(test, mark_c, a, b, c);
+}
+
+static void call4(int a, int b, int c, int d)
+{
+ STAP_PROBE4(test, mark_d, a, b, c, d);
+}
+
+static void call5(int a, int b, int c, int d, int e)
+{
+ STAP_PROBE5(test, mark_e, a, b, c, d, e);
+}
+
+static void call6(int a, int b, int c, int d, int e, int f)
+{
+ STAP_PROBE6(test, mark_f, a, b, c, d, e, f);
+}
+
+static void call7(int a, int b, int c, int d, int e, int f, int g)
+{
+ STAP_PROBE7(test, mark_g, a, b, c, d, e, f, g);
+}
+
+static void call8(int a, int b, int c, int d, int e, int f, int g, int h)
+{
+ STAP_PROBE8(test, mark_h, a, b, c, d, e, f, g, h);
+}
+
+static void call9(int a, int b, int c, int d, int e, int f, int g, int h, int i)
+{
+ STAP_PROBE9(test, mark_i, a, b, c, d, e, f, g, h, i);
+}
+
+static void call10(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j)
+{
+ STAP_PROBE10(test, mark_j, a, b, c, d, e, f, g, h, i, j);
+}
+
+int
+main (int argc, char **argv)
+{
+ int a, b, c, d, e, f, g, h, i, j;
+ a = 1; b = 2; c = 3; d = 4; e = 5; f = 6; g = 7; h = 8; i = 9; j = 10;
+ call1(a);
+ call2(a, b);
+ call3(a, b, c);
+ call4(a, b, c, d);
+ call5(a, b, c, d, e);
+ call6(a, b, c, d, e, f);
+ call7(a, b, c, d, e, f, g);
+ 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
new file mode 100644
index 00000000..21b94810
--- /dev/null
+++ b/testsuite/systemtap.base/sdt.exp
@@ -0,0 +1,64 @@
+set test "sdt"
+set ::result_string {1
+1 2
+1 2 3
+1 2 3 4
+1 2 3 4 5
+1 2 3 4 5 6
+1 2 3 4 5 6 7
+1 2 3 4 5 6 7 8
+1 2 3 4 5 6 7 8 9
+1 2 3 4 5 6 7 8 9 10}
+
+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]
+
+# 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=-Wall"
+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 "$test_flags $extra_flag"]
+if { $res != "" } {
+ verbose "target_compile failed: $res" 2
+ fail "compiling $test.c $extra_flag"
+ return
+} else {
+ pass "compiling $test.c $extra_flag"
+}
+
+if {[installtest_p]} {
+ stap_run3 "$test $extra_flag" $srcdir/$subdir/$test.stp -c ./$test.prog
+} else {
+ untested "$test $extra_flag"
+}
+
+# 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=-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 "$test_flags $extra_flag"]
+if { $res != "" } {
+ verbose "target_compile failed: $res" 2
+ fail "compiling $test.c c++ $extra_flag"
+ return
+} else {
+ pass "compiling $test.c c++ $extra_flag"
+}
+
+if {[installtest_p]} {
+ stap_run3 "$test c++ $extra_flag" $srcdir/$subdir/$test.stp -c ./$test.prog
+} else {
+ 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
new file mode 100644
index 00000000..1f075bca
--- /dev/null
+++ b/testsuite/systemtap.base/sdt.stp
@@ -0,0 +1,49 @@
+probe process("sdt.prog").mark("mark_a")
+{
+ printf("%d\n", $arg1);
+}
+
+probe process("sdt.prog").mark("mark_b")
+{
+ printf("%d %d\n", $arg1, $arg2);
+}
+
+probe process("sdt.prog").mark("mark_c")
+{
+ printf("%d %d %d\n", $arg1, $arg2, $arg3);
+}
+
+probe process("sdt.prog").mark("mark_d")
+{
+ printf("%d %d %d %d\n", $arg1, $arg2, $arg3, $arg4);
+}
+
+probe process("sdt.prog").mark("mark_e")
+{
+ printf("%d %d %d %d %d\n", $arg1, $arg2, $arg3, $arg4, $arg5);
+}
+
+probe process("sdt.prog").mark("mark_f")
+{
+ printf("%d %d %d %d %d %d\n", $arg1, $arg2, $arg3, $arg4, $arg5, $arg6);
+}
+
+probe process("sdt.prog").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")
+{
+ 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")
+{
+ 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")
+{
+ 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 11fec9b1..a4bd5e2c 100644
--- a/testsuite/systemtap.base/static_uprobes.exp
+++ b/testsuite/systemtap.base/static_uprobes.exp
@@ -14,6 +14,7 @@ puts $fp "
void
bar (int i)
{
+ STATIC_UPROBES_TEST_PROBE_2(i);
if (i == 0)
i = 1000;
STAP_PROBE1(static_uprobes,test_probe_2,i);
@@ -88,6 +89,7 @@ if {[installtest_p]} {
if {[catch {exec $dtrace -h -s $sup_dpath} res]} {
verbose -log "unable to run $dtrace: $res"
}
+catch {exec rm -f $sup_dpath}
if {[file exists $sup_hpath]} then {
pass "$test generating header"
} else {
@@ -96,8 +98,6 @@ if {[file exists $sup_hpath]} then {
return
}
-catch {exec rm -f $sup_dpath}
-
if {[installtest_p]} {
set sdtdir $env(SYSTEMTAP_INCLUDES)
} else {
@@ -159,7 +159,7 @@ expect {
wait
-if {$ok == 4} { pass "$test C" } { fail "$test C ($ok)" }
+if {$ok == 5} { pass "$test C" } { fail "$test C ($ok)" }
set ok 0
@@ -170,7 +170,6 @@ verbose -log "spawn stap -c $sup_exepath $sup_stppath"
spawn stap -c $sup_exepath $sup_stppath
expect {
-timeout 180
- -re {In test_probe_1 probe} { incr ok; exp_continue }
-re {In test_probe_2 probe 0x2} { incr ok; exp_continue }
-re {In test_probe_0 probe 0x3} { incr ok; exp_continue }
-re {In test_probe_3 probe 0x3 0x[0-9a-f][0-9a-f]} { incr ok; exp_continue }
@@ -181,9 +180,9 @@ expect {
wait
-if {$ok == 4} { pass "$test C++" } { fail "$test C++ ($ok)" }
+if {$ok == 5} { pass "$test C++" } { fail "$test C++ ($ok)" }
# catch {exec rm -f $sup_srcpath $sup_exepath $supcplus_exepath $sup_hpath $sup_stppath}
# It's not so important to clean up, and it's unhelpful if
-# one needs to diagnose a test failure. \ No newline at end of file
+# one needs to diagnose a test failure.
diff --git a/testsuite/systemtap.base/stmt_rel.exp b/testsuite/systemtap.base/stmt_rel.exp
index 25156d9b..be51fef9 100644
--- a/testsuite/systemtap.base/stmt_rel.exp
+++ b/testsuite/systemtap.base/stmt_rel.exp
@@ -3,7 +3,6 @@
set test "stmt_rel"
set ::result_string {PASS bio_init
PASS line number
-PASS wildcard
-}
+PASS wildcard}
stap_run2 $srcdir/$subdir/$test.stp
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/interrupt/scf.stp b/testsuite/systemtap.examples/interrupt/scf.stp
index f84c2494..f84c2494 100644..100755
--- a/testsuite/systemtap.examples/interrupt/scf.stp
+++ b/testsuite/systemtap.examples/interrupt/scf.stp
diff --git a/testsuite/systemtap.examples/io/iostats.stp b/testsuite/systemtap.examples/io/iostats.stp
index 90bb4f5b..90bb4f5b 100644..100755
--- a/testsuite/systemtap.examples/io/iostats.stp
+++ b/testsuite/systemtap.examples/io/iostats.stp
diff --git a/testsuite/systemtap.examples/memory/pfaults.stp b/testsuite/systemtap.examples/memory/pfaults.stp
index 5bf1a8a6..5bf1a8a6 100644..100755
--- a/testsuite/systemtap.examples/memory/pfaults.stp
+++ b/testsuite/systemtap.examples/memory/pfaults.stp
diff --git a/testsuite/systemtap.examples/network/tcp_connections.stp b/testsuite/systemtap.examples/network/tcp_connections.stp
index bd2db76a..bd2db76a 100644..100755
--- a/testsuite/systemtap.examples/network/tcp_connections.stp
+++ b/testsuite/systemtap.examples/network/tcp_connections.stp
diff --git a/testsuite/systemtap.examples/profiling/latencytap.stp b/testsuite/systemtap.examples/profiling/latencytap.stp
index 28956129..28956129 100644..100755
--- a/testsuite/systemtap.examples/profiling/latencytap.stp
+++ b/testsuite/systemtap.examples/profiling/latencytap.stp
diff --git a/testsuite/systemtap.examples/profiling/timeout.stp b/testsuite/systemtap.examples/profiling/timeout.stp
index 48d6d21d..48d6d21d 100644..100755
--- a/testsuite/systemtap.examples/profiling/timeout.stp
+++ b/testsuite/systemtap.examples/profiling/timeout.stp
diff --git a/testsuite/systemtap.examples/profiling/topsys.stp b/testsuite/systemtap.examples/profiling/topsys.stp
index 34cf826c..34cf826c 100644..100755
--- a/testsuite/systemtap.examples/profiling/topsys.stp
+++ b/testsuite/systemtap.examples/profiling/topsys.stp
diff --git a/testsuite/systemtap.maps/exists.exp b/testsuite/systemtap.maps/exists.exp
index ea043a6b..bbdac737 100755
--- a/testsuite/systemtap.maps/exists.exp
+++ b/testsuite/systemtap.maps/exists.exp
@@ -9,8 +9,7 @@ comlete list for b: [0,0] [1,10] [2,20] [3,30] [4,40] [5,50] [6,60] [7,70] [8,80
[0,0] is still there
emtpy string there
hello there
-emtpy string still there
-}
+emtpy string still there}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/foreach_foreach.exp b/testsuite/systemtap.maps/foreach_foreach.exp
index f79d290a..07a2d871 100644
--- a/testsuite/systemtap.maps/foreach_foreach.exp
+++ b/testsuite/systemtap.maps/foreach_foreach.exp
@@ -114,8 +114,7 @@ bar[21] = 9261
bar[22] = 10648
bar[23] = 12167
bar[24] = 13824
-foo[10] = 100
-}
+foo[10] = 100}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/foreach_limit.exp b/testsuite/systemtap.maps/foreach_limit.exp
index 97305c4b..4cc87ec8 100644
--- a/testsuite/systemtap.maps/foreach_limit.exp
+++ b/testsuite/systemtap.maps/foreach_limit.exp
@@ -94,8 +94,7 @@ bucket 69: 13
bucket 70: 28
loop had 71 iterations
-Done.
-}
+Done.}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/foreach_limit2.exp b/testsuite/systemtap.maps/foreach_limit2.exp
index 00696fe1..224a0aa7 100644
--- a/testsuite/systemtap.maps/foreach_limit2.exp
+++ b/testsuite/systemtap.maps/foreach_limit2.exp
@@ -82,8 +82,7 @@ agg_array[6]: count:2 sum:18 avg:9 min:6 max:12
loop had 4 iterations
x ended up as 5
-Done.
-}
+Done.}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/ii.exp b/testsuite/systemtap.maps/ii.exp
index f7ce95fb..1f4a972a 100644
--- a/testsuite/systemtap.maps/ii.exp
+++ b/testsuite/systemtap.maps/ii.exp
@@ -61,8 +61,7 @@ foo[6] = 91
foo[7] = 140
foo[8] = 204
foo[9] = 285
-foo[10] = 385
-}
+foo[10] = 385}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/iiiiii.exp b/testsuite/systemtap.maps/iiiiii.exp
index 3c8dbaf0..aeddbbac 100644
--- a/testsuite/systemtap.maps/iiiiii.exp
+++ b/testsuite/systemtap.maps/iiiiii.exp
@@ -64,8 +64,7 @@ foo[1,1,0,1,1] = 4
foo[1,1,1,0,0] = 3
foo[1,1,1,0,1] = 4
foo[1,1,1,1,0] = 4
-foo[1,1,1,1,1] = 5
-}
+foo[1,1,1,1,1] = 5}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/is.exp b/testsuite/systemtap.maps/is.exp
index 5dffb850..31e96e77 100644
--- a/testsuite/systemtap.maps/is.exp
+++ b/testsuite/systemtap.maps/is.exp
@@ -61,8 +61,7 @@ foo[6] = # 36
foo[7] = # 49
foo[8] = # 64
foo[9] = # 81
-foo[10] = # 100
-}
+foo[10] = # 100}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/ix.exp b/testsuite/systemtap.maps/ix.exp
index 578e8e38..11de73c1 100644
--- a/testsuite/systemtap.maps/ix.exp
+++ b/testsuite/systemtap.maps/ix.exp
@@ -41,8 +41,7 @@ foo[9]: count:4 sum:117 avg:29 min:-2 max:100
foo[10]: count:4 sum:118 avg:29 min:-2 max:100
Run a quick foreach without sorting...
-complete sum of foo:1243
-}
+complete sum of foo:1243}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/linear.exp b/testsuite/systemtap.maps/linear.exp
index 5519ee11..23b5f871 100644
--- a/testsuite/systemtap.maps/linear.exp
+++ b/testsuite/systemtap.maps/linear.exp
@@ -38,7 +38,6 @@ value |-------------------------------------------------- count
1400 | 3
1450 | 3
1500 | 0
-
}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/linear_empty.exp b/testsuite/systemtap.maps/linear_empty.exp
index 88a53a31..922ff0b9 100644
--- a/testsuite/systemtap.maps/linear_empty.exp
+++ b/testsuite/systemtap.maps/linear_empty.exp
@@ -1,8 +1,7 @@
# Test empty linear histogram
set test "linear_empty"
-set ::result_string {count=0
-}
+set ::result_string {count=0}
stap_run2 $srcdir/$subdir/$test.stp -w
diff --git a/testsuite/systemtap.maps/linear_large.exp b/testsuite/systemtap.maps/linear_large.exp
index 51df3c92..d2a03f0a 100644
--- a/testsuite/systemtap.maps/linear_large.exp
+++ b/testsuite/systemtap.maps/linear_large.exp
@@ -19,7 +19,6 @@ avg=1115333333
900000000 | 0
1000000000 |@@@@ 4
>1000000000 |@ 1
-
}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/linear_large_neg.exp b/testsuite/systemtap.maps/linear_large_neg.exp
index bdffba7b..470414a3 100644
--- a/testsuite/systemtap.maps/linear_large_neg.exp
+++ b/testsuite/systemtap.maps/linear_large_neg.exp
@@ -19,7 +19,6 @@ avg=-1284615384
-200000000 | 0
-100000000 |@@ 2
0 |@ 1
-
}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/linear_over.exp b/testsuite/systemtap.maps/linear_over.exp
index 5b0fafa4..25eca1e1 100644
--- a/testsuite/systemtap.maps/linear_over.exp
+++ b/testsuite/systemtap.maps/linear_over.exp
@@ -10,7 +10,6 @@ value |-------------------------------------------------- count
90 | 0
100 | 0
>100 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9000
-
}
stap_run2 $srcdir/$subdir/$test.stp -DMAXACTION=10000
diff --git a/testsuite/systemtap.maps/linear_overunder.exp b/testsuite/systemtap.maps/linear_overunder.exp
index 80b74c72..e5275524 100644
--- a/testsuite/systemtap.maps/linear_overunder.exp
+++ b/testsuite/systemtap.maps/linear_overunder.exp
@@ -25,7 +25,6 @@ value |-------------------------------------------------- count
950 |@ 27
1000 |@ 23
>1000 |@@@@@@@ 102
-
}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/linear_under.exp b/testsuite/systemtap.maps/linear_under.exp
index 8efc45be..28d24886 100644
--- a/testsuite/systemtap.maps/linear_under.exp
+++ b/testsuite/systemtap.maps/linear_under.exp
@@ -10,7 +10,6 @@ value |-------------------------------------------------- count
<1800 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 100
1800 | 0
1900 | 0
-
}
stap_run2 $srcdir/$subdir/$test.stp -DMAXACTION=10000
diff --git a/testsuite/systemtap.maps/log.exp b/testsuite/systemtap.maps/log.exp
index 2bc54a33..d19082b4 100644
--- a/testsuite/systemtap.maps/log.exp
+++ b/testsuite/systemtap.maps/log.exp
@@ -130,7 +130,6 @@ set ::result_string { value |-------------------------------------
1152921504606846976 |@ 1
2305843009213693952 |@ 1
4611686018427387904 |@ 1
-
}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/log_edge.exp b/testsuite/systemtap.maps/log_edge.exp
index 051021b1..6ce546d9 100644
--- a/testsuite/systemtap.maps/log_edge.exp
+++ b/testsuite/systemtap.maps/log_edge.exp
@@ -43,8 +43,7 @@ value |-------------------------------------------------- count
bucket 65: 1
bucket 66: 2
-bucket 67: 1
-}
+bucket 67: 1}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/si.exp b/testsuite/systemtap.maps/si.exp
index 600687ed..eb1b05c7 100644
--- a/testsuite/systemtap.maps/si.exp
+++ b/testsuite/systemtap.maps/si.exp
@@ -61,8 +61,7 @@ foo[6] = 91
foo[7] = 140
foo[8] = 204
foo[9] = 285
-foo[10] = 385
-}
+foo[10] = 385}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/ss.exp b/testsuite/systemtap.maps/ss.exp
index 548a888e..9978ead0 100644
--- a/testsuite/systemtap.maps/ss.exp
+++ b/testsuite/systemtap.maps/ss.exp
@@ -61,7 +61,6 @@ foo[6] = # 36
foo[7] = # 49
foo[8] = # 64
foo[9] = # 81
-foo[10] = # 100
-}
+foo[10] = # 100}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.printf/basic3.exp b/testsuite/systemtap.printf/basic3.exp
index e3beb9ed..5c4f7e79 100644
--- a/testsuite/systemtap.printf/basic3.exp
+++ b/testsuite/systemtap.printf/basic3.exp
@@ -1,5 +1,4 @@
set test "basic3"
set ::result_string {Hello
-World
-}
+World}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.printf/bin6.exp b/testsuite/systemtap.printf/bin6.exp
index 0de41e78..4c5e7f2b 100644
--- a/testsuite/systemtap.printf/bin6.exp
+++ b/testsuite/systemtap.printf/bin6.exp
Binary files differ
diff --git a/testsuite/systemtap.printf/char1.exp b/testsuite/systemtap.printf/char1.exp
index 0e9232e9..35aa479f 100644
--- a/testsuite/systemtap.printf/char1.exp
+++ b/testsuite/systemtap.printf/char1.exp
@@ -1,4 +1,3 @@
set test "char1"
-set ::result_string {stap
-}
-stap_run2 $srcdir/$subdir/$test.stp \ No newline at end of file
+set ::result_string {stap}
+stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.printf/int1.exp b/testsuite/systemtap.printf/int1.exp
index bb30b4f3..b308848c 100644
--- a/testsuite/systemtap.printf/int1.exp
+++ b/testsuite/systemtap.printf/int1.exp
@@ -19,6 +19,5 @@ set ::result_string {1,10,9000000000000,-1,-1024
1,12,202757163310000,1777777777777777777777,1777777777777777776000
1,12,202757163310000,1777777777777777777777,1777777777777777776000
1, 12, 202757163310000,1777777777777777777777,1777777777777777776000
-0000000000000001,0000000000000012,0202757163310000,1777777777777777777777,1777777777777777776000
-}
+0000000000000001,0000000000000012,0202757163310000,1777777777777777777777,1777777777777777776000}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.printf/memory1.exp b/testsuite/systemtap.printf/memory1.exp
index 7b55a3d7..c5f03610 100644
--- a/testsuite/systemtap.printf/memory1.exp
+++ b/testsuite/systemtap.printf/memory1.exp
@@ -1,4 +1,3 @@
set test "memory1"
-set ::result_string {Test passed
-}
+set ::result_string {Test passed}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.printf/print.exp b/testsuite/systemtap.printf/print.exp
index 3a4de529..151de10d 100644
--- a/testsuite/systemtap.printf/print.exp
+++ b/testsuite/systemtap.printf/print.exp
@@ -13,6 +13,5 @@ foo99
888
123456789
hello999
-999hello
-}
+999hello}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.printf/print_char.exp b/testsuite/systemtap.printf/print_char.exp
index bab056dd..a9d63be6 100644
--- a/testsuite/systemtap.printf/print_char.exp
+++ b/testsuite/systemtap.printf/print_char.exp
@@ -1,5 +1,4 @@
set test "print_char"
set ::result_string {ABC
-ABCDEFGHIJKLMNOPQRSTUVWXYZ
-}
+ABCDEFGHIJKLMNOPQRSTUVWXYZ}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.printf/println.exp b/testsuite/systemtap.printf/println.exp
index 8deba53f..fcbe0c82 100644
--- a/testsuite/systemtap.printf/println.exp
+++ b/testsuite/systemtap.printf/println.exp
@@ -13,6 +13,5 @@ foo99
99foo
123456789
hello999
-999hello
-}
+999hello}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.printf/ptr.exp b/testsuite/systemtap.printf/ptr.exp
index f25a7a02..3eb412a7 100644
--- a/testsuite/systemtap.printf/ptr.exp
+++ b/testsuite/systemtap.printf/ptr.exp
@@ -29,8 +29,7 @@ if {$::tcl_platform(wordSize) == 8} {
0x000001X
0x12345678X
0x12345678abcdef00X
-0x12345678X
-"
+0x12345678X"
} else {
set ::result_string "0x00000000
0x00000001
@@ -60,7 +59,6 @@ if {$::tcl_platform(wordSize) == 8} {
0x000001X
0x12345678X
0xabcdef00X
-0x12345678X
-"
+0x12345678X"
}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.printf/string1.exp b/testsuite/systemtap.printf/string1.exp
index aee0b71a..7c94d645 100644
--- a/testsuite/systemtap.printf/string1.exp
+++ b/testsuite/systemtap.printf/string1.exp
@@ -1,6 +1,5 @@
set test "string1"
set ::result_string {The string is <Foobar!>
Foobar!XYZZY
-XYZZYFoobar!XYZZYFoobar!
-}
+XYZZYFoobar!XYZZYFoobar!}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.server/hello.stp b/testsuite/systemtap.server/hello.stp
new file mode 100755
index 00000000..a1c4aacb
--- /dev/null
+++ b/testsuite/systemtap.server/hello.stp
@@ -0,0 +1,8 @@
+#! stap
+
+probe begin
+{
+ printf("Hello ");
+ printf("From Server\n");
+ exit()
+}
diff --git a/testsuite/systemtap.server/server.exp b/testsuite/systemtap.server/server.exp
new file mode 100644
index 00000000..c2c60b97
--- /dev/null
+++ b/testsuite/systemtap.server/server.exp
@@ -0,0 +1,39 @@
+# Don't attempt these tests if the client/server are not available
+# Start a systemtap server, if one is not already started.
+if {! [use_server_p]} then {
+ if {! [setup_server]} then {
+ untested "Server Tests"
+ return
+ }
+}
+
+# Run the buildok tests using the server
+set self buildok
+foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] {
+ set test "$self/[file tail $file] with server"
+ verbose -log "Running $file"
+ set rc [stap_run_batch $file]
+ # some tests are known to fail.
+ switch $test {
+ "buildok/perfmon01.stp with server" {setup_kfail 909 *-*-*}
+ "buildok/twentysix.stp with server" {setup_kfail 4105 *-*-*}
+ "buildok/twentyseven.stp with server" {setup_kfail 4166 *-*-*}
+ "buildok/sched_test.stp with server" {setup_kfail 1155 *-*-*}
+ "buildok/process_test.stp with server" {setup_kfail 1155 *-*-*}
+ "buildok/rpc-all-probes.stp with server" {setup_kfail 4413 *-*-*}
+ "buildok/nfs-all-probes.stp with server" {setup_kfail 4413 *-*-*}
+ }
+ if {$rc == 0} { pass $test } else { fail $test }
+}
+
+# If this is an installcheck, then run a basic execution test.
+if {[installtest_p]} then {
+ set test "Hello from server"
+ set rc [stap_run_batch $srcdir/systemtap.server/hello.stp]
+ if {$rc == 0} { pass $test } else { fail $test }
+}
+
+# Shudown the server, if we started it.
+if {! [use_server_p]} then {
+ shutdown_server
+}
diff --git a/testsuite/systemtap.string/dot.exp b/testsuite/systemtap.string/dot.exp
index b1d38172..14f329db 100644
--- a/testsuite/systemtap.string/dot.exp
+++ b/testsuite/systemtap.string/dot.exp
@@ -5,6 +5,5 @@ helloworld
0
100
-42
-66
-}
+66}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.string/isinstr.exp b/testsuite/systemtap.string/isinstr.exp
index 986043e8..ed0474de 100644
--- a/testsuite/systemtap.string/isinstr.exp
+++ b/testsuite/systemtap.string/isinstr.exp
@@ -1,6 +1,5 @@
set test "isinstr"
set ::result_string {"foo" is in "abcfoobad"
"foo" is NOT in "abcdefg"
-"" is in ""
-}
+"" is in ""}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.string/sprint.exp b/testsuite/systemtap.string/sprint.exp
index c8f9826a..b4f0b453 100644
--- a/testsuite/systemtap.string/sprint.exp
+++ b/testsuite/systemtap.string/sprint.exp
@@ -3,6 +3,5 @@ set ::result_string {helloworld
helloworld
EQUAL
EQUAL
-hello-world helloworld FOO helloworld
-}
+hello-world helloworld FOO helloworld}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.string/strlen.exp b/testsuite/systemtap.string/strlen.exp
index 40c790fe..b93564ef 100644
--- a/testsuite/systemtap.string/strlen.exp
+++ b/testsuite/systemtap.string/strlen.exp
@@ -2,6 +2,5 @@ set test "strlen"
set ::result_string {strlen("") = 0
strlen("1") = 1
strlen("0123456789") = 10
-strlen("012345678901234567890123456789012345678901234567890123456789012") = 63
-}
+strlen("012345678901234567890123456789012345678901234567890123456789012") = 63}
stap_run2 $srcdir/$subdir/$test.stp -DMAXSTRINGLEN=64
diff --git a/testsuite/systemtap.string/strtol.exp b/testsuite/systemtap.string/strtol.exp
index 12d63f0d..25cc21a0 100644
--- a/testsuite/systemtap.string/strtol.exp
+++ b/testsuite/systemtap.string/strtol.exp
@@ -10,6 +10,5 @@ set ::result_string {1
1000
4096
512
-8
-0}
+8}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.string/substr.exp b/testsuite/systemtap.string/substr.exp
index c9884935..5f1b662b 100644
--- a/testsuite/systemtap.string/substr.exp
+++ b/testsuite/systemtap.string/substr.exp
@@ -13,6 +13,5 @@ set ::result_string {Hello World!
12,1:
0,10: Hello Worl
0,100: Hello World!
-0,100000: Hello World!
-}
+0,100000: Hello World!}
stap_run2 $srcdir/$subdir/$test.stp