summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorfche <fche>2007-03-30 19:17:02 +0000
committerfche <fche>2007-03-30 19:17:02 +0000
commitb8da0ad19d9dfcf88c4cd6dcf7b8aa73fc5016d7 (patch)
tree82225c0ef08f075dc0a5e9a8d59ed3d37a072b1c /testsuite
parent3be43eac84e5819b72dd311c3283ef2ea5bb1d83 (diff)
downloadsystemtap-steved-b8da0ad19d9dfcf88c4cd6dcf7b8aa73fc5016d7.tar.gz
systemtap-steved-b8da0ad19d9dfcf88c4cd6dcf7b8aa73fc5016d7.tar.xz
systemtap-steved-b8da0ad19d9dfcf88c4cd6dcf7b8aa73fc5016d7.zip
2007-03-30 Frank Ch. Eigler <fche@redhat.com>
PR 1570 * NEWS: Document probe handler language change re. inline functions. * stapprobes.5.in: Likewise. * tapsets.cxx: Many changes to simplify caches and implement new handling of inline functions, removed of stubs for future probes. * elaborate.cxx (derived_probe printsig_nested): New function. * elaborate.h: Declare it. * main.cxx (usage): Clarify "-r" meaning. (main): Tweak related "-p 4" message. 2007-03-30 Frank Ch. Eigler <fche@elastic.org> PR 1570. * memory.stp, scheduler.stp, signal.stp, LKET/signal.stp: Adapt to .inline -> .function change. 2007-03-30 Frank Ch. Eigler <fche@elastic.org> PR 1570 * */*.stp: Adapt to .inline -> .function change. * lib/stap_run.exp, stap_run2.exp, stap_run_binary.exp: Shorten pass/fail dejagnu log lines. * systemtap.syscall/sys.stp, test.tcl: Make slightly more compatible and failure more verbose.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/ChangeLog9
-rwxr-xr-xtestsuite/buildok/six.stp2
-rw-r--r--testsuite/lib/stap_run.exp14
-rw-r--r--testsuite/lib/stap_run2.exp10
-rw-r--r--testsuite/lib/stap_run_binary.exp10
-rwxr-xr-xtestsuite/semko/twentytwo.stp2
-rwxr-xr-xtestsuite/semok/twenty.stp6
-rw-r--r--testsuite/systemtap.base/probefunc.exp4
-rw-r--r--testsuite/systemtap.stress/all_kernel_functions.exp10
-rw-r--r--testsuite/systemtap.stress/whitelist.exp1
-rwxr-xr-xtestsuite/systemtap.syscall/sys.stp4
-rwxr-xr-xtestsuite/systemtap.syscall/test.tcl5
12 files changed, 47 insertions, 30 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index 50829210..00c99ec5 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2007-03-30 Frank Ch. Eigler <fche@elastic.org>
+
+ PR 1570
+ * */*.stp: Adapt to .inline -> .function change.
+ * lib/stap_run.exp, stap_run2.exp, stap_run_binary.exp: Shorten
+ pass/fail dejagnu log lines.
+ * systemtap.syscall/sys.stp, test.tcl: Make slightly more
+ compatible and failure more verbose.
+
2007-03-29 Frank Ch. Eigler <fche@elastic.org>
* systemtap.maps/ix_*.exp: Add catch around close.
diff --git a/testsuite/buildok/six.stp b/testsuite/buildok/six.stp
index 2d9a40aa..a4a893da 100755
--- a/testsuite/buildok/six.stp
+++ b/testsuite/buildok/six.stp
@@ -4,7 +4,7 @@
# listed in PR 1155 we cannot resolve the parameters of the inline
# at the moment.
-probe kernel.inline("context_switch")? {
+probe kernel.function("context_switch").inline ? {
log ("found an inline function")
}
diff --git a/testsuite/lib/stap_run.exp b/testsuite/lib/stap_run.exp
index 68fceb32..baf41d9b 100644
--- a/testsuite/lib/stap_run.exp
+++ b/testsuite/lib/stap_run.exp
@@ -1,9 +1,3 @@
-# stap_run.exp
-#
-# Will Cohen
-# 8/12/2005
-
-
# stap_run TEST_NAME LOAD_GEN_FUNCTION OUTPUT_CHECK_STRING
# TEST_NAME is path to the current test
# LOAD_GEN_FUNCTION (optional) to produce something to measure
@@ -21,6 +15,10 @@ proc stap_run { TEST_NAME {LOAD_GEN_FUNCTION ""} {OUTPUT_CHECK_STRING ""} args }
global probe_errors
global skipped_probes
+ # zap the srcdir prefix
+ set test_file_name $TEST_NAME
+ set TEST_NAME [regsub {.*/testsuite/} $TEST_NAME ""]
+
# initialize probe_errors and skipped_probes to 0
set probe_errors 0
set skipped_probes 0
@@ -28,8 +26,8 @@ proc stap_run { TEST_NAME {LOAD_GEN_FUNCTION ""} {OUTPUT_CHECK_STRING ""} args }
if {[info procs installtest_p] != "" && ![installtest_p]} { untested $TEST_NAME; return }
set cmd [concat {stap -v} $args]
- if [file readable $TEST_NAME] {
- lappend cmd $TEST_NAME
+ if [file readable $test_file_name] {
+ lappend cmd $test_file_name
}
eval spawn $cmd
expect {
diff --git a/testsuite/lib/stap_run2.exp b/testsuite/lib/stap_run2.exp
index d65e3874..290f0d84 100644
--- a/testsuite/lib/stap_run2.exp
+++ b/testsuite/lib/stap_run2.exp
@@ -11,6 +11,10 @@
set timeout 20
proc stap_run2 { TEST_NAME args } {
+ # zap the srcdir prefix
+ set test_file_name $TEST_NAME
+ set TEST_NAME [regsub {.*/testsuite/} $TEST_NAME ""]
+
if {[info procs installtest_p] != "" && ![installtest_p]} { untested $TEST_NAME; return }
# fix up expected string
@@ -18,8 +22,8 @@ proc stap_run2 { TEST_NAME args } {
# spawn test
set cmd [concat {stap -v} $args]
- if [file readable $TEST_NAME] {
- lappend cmd $TEST_NAME
+ if [file readable $test_file_name] {
+ lappend cmd $test_file_name
}
eval spawn $cmd
@@ -30,7 +34,7 @@ proc stap_run2 { TEST_NAME args } {
{set pass$expect_out(1,string) "\t0\t0\t0"; exp_continue}
-re {^Pass 5: starting run.\r\n} {exp_continue}
-ex $output {
- pass "$TEST_NAME passed"
+ pass "$TEST_NAME"
expect {
-re {^Pass\ ([5]):[^\r]*\ in\ ([0-9]+)usr/([0-9]+)sys/([0-9]+)real\ ms.\r\n}
{set pass$expect_out(1,string) "\t$expect_out(2,string)\t$expect_out(3,string)\t$expect_out(4,string)"
diff --git a/testsuite/lib/stap_run_binary.exp b/testsuite/lib/stap_run_binary.exp
index f29e8f35..1d31d817 100644
--- a/testsuite/lib/stap_run_binary.exp
+++ b/testsuite/lib/stap_run_binary.exp
@@ -6,15 +6,19 @@
# global result_string must be set to the expected output
proc stap_run_binary { TEST_NAME} {
+ # zap the srcdir prefix
+ set test_file_name $TEST_NAME
+ set TEST_NAME [regsub {.*/testsuite/} $TEST_NAME ""]
+
if {[info procs installtest_p] != "" && ![installtest_p]} {untested $TEST_NAME; return}
set hex_args {-ve 8/1 "%02x " "\n"}
- set res [exec stap $TEST_NAME | hexdump $hex_args]
+ set res [exec stap $test_file_name | hexdump $hex_args]
if {[string compare $res $::result_string] == 0} {
- pass "$TEST_NAME passed"
+ pass "$TEST_NAME"
} else {
- fail "$TEST_NAME failed"
+ fail "$TEST_NAME"
puts "EXPECTED:\n-----------------------\n<$::result_string>"
puts "-----------------------\n"
puts "GOT:\n-----------------------\n<$res>"
diff --git a/testsuite/semko/twentytwo.stp b/testsuite/semko/twentytwo.stp
index 3d2f6429..9321d5f6 100755
--- a/testsuite/semko/twentytwo.stp
+++ b/testsuite/semko/twentytwo.stp
@@ -3,6 +3,6 @@
# tests that a non-inline function is *not* matched using
# the inline() pattern
-probe kernel.inline("sys_recv") {
+probe kernel.function("sys_recv").inline {
log ("found a non-inline via inline()")
}
diff --git a/testsuite/semok/twenty.stp b/testsuite/semok/twenty.stp
index 6d7f5183..2e85c5e6 100755
--- a/testsuite/semok/twenty.stp
+++ b/testsuite/semok/twenty.stp
@@ -2,7 +2,9 @@
probe kernel.function("*") {}
probe module("*").function("*") {}
+probe kernel.function("*").call {}
+probe module("*").function("*").call {}
probe kernel.function("*").return {}
probe module("*").function("*").return {}
-probe kernel.inline("*") {}
-probe module("*").inline("*") {}
+probe kernel.function("*").inline {}
+probe module("*").function("*").inline {}
diff --git a/testsuite/systemtap.base/probefunc.exp b/testsuite/systemtap.base/probefunc.exp
index e131fafb..fbb45534 100644
--- a/testsuite/systemtap.base/probefunc.exp
+++ b/testsuite/systemtap.base/probefunc.exp
@@ -49,8 +49,8 @@ set probepoint "kernel.function(\"scheduler_tick\")"
set script [format $systemtap_script $probepoint]
stap_run $prefix$probepoint sleep_one_sec $output_string -e $script
-# test probefunc() with kernel.inline()
+# test probefunc() with kernel.function().inline
set output_string "\\mcontext_switch\\M\r\n"
-set probepoint "kernel.inline(\"context_switch\")"
+set probepoint "kernel.function(\"context_switch\").inline"
set script [format $systemtap_script $probepoint]
stap_run $prefix$probepoint sleep_one_sec $output_string -e $script
diff --git a/testsuite/systemtap.stress/all_kernel_functions.exp b/testsuite/systemtap.stress/all_kernel_functions.exp
index f54f53e1..6dded726 100644
--- a/testsuite/systemtap.stress/all_kernel_functions.exp
+++ b/testsuite/systemtap.stress/all_kernel_functions.exp
@@ -17,7 +17,7 @@ proc genload {} {
proc probe_ok {probepoint} {
set cmd {exec stap -p2 -e}
lappend cmd "probe $probepoint {}"
- return ![catch $cmd]
+ return [expr ![catch $cmd]]
}
set systemtap_script {
@@ -25,12 +25,10 @@ set systemtap_script {
probe %s {
stat[probefunc()] <<< 1
}
- probe begin {
- log("systemtap starting probe")
- }
+ probe begin { log ("systemtap starting probe") }
probe end {
- log("systemtap ending probe")
- foreach (func in stat)
+ log ("systemtap ending probe")
+ foreach (func in stat limit 5) # don't overflow expect buffer
printf("%%d %%s\n", @count(stat[func]), func)
}
}
diff --git a/testsuite/systemtap.stress/whitelist.exp b/testsuite/systemtap.stress/whitelist.exp
index 75f0df8a..fda33a7c 100644
--- a/testsuite/systemtap.stress/whitelist.exp
+++ b/testsuite/systemtap.stress/whitelist.exp
@@ -223,7 +223,6 @@ proc init_probes_all {} {
global init_probes_all_script
catch {exec stap -p2 -e $init_probes_all_script > /tmp/whitelist_tmpfile}
catch {exec grep "^kernel.function" /tmp/whitelist_tmpfile > $PROBES_ALL }
- catch {exec grep "^kernel.inline" /tmp/whitelist_tmpfile >> $PROBES_ALL }
catch {exec rm -f /tmp/whitelist_tmpfile}
if {[get_linesize $PROBES_ALL] == 0} {
return 1
diff --git a/testsuite/systemtap.syscall/sys.stp b/testsuite/systemtap.syscall/sys.stp
index ab822ebb..e3564a15 100755
--- a/testsuite/systemtap.syscall/sys.stp
+++ b/testsuite/systemtap.syscall/sys.stp
@@ -11,7 +11,7 @@ probe begin {
}
-probe syscall.* {
+probe syscall.* ? {
if (pid() == target()) {
if (entry) printf("\n")
printf("%s%s: %s (%s) = ", indent_str[indent], execname(), name, argstr)
@@ -21,7 +21,7 @@ probe syscall.* {
}
}
-probe syscall.*.return {
+probe syscall.*.return ? {
if (pid() == target()) {
if (indent) indent--
if (entry)
diff --git a/testsuite/systemtap.syscall/test.tcl b/testsuite/systemtap.syscall/test.tcl
index 082eaabe..8c228cba 100755
--- a/testsuite/systemtap.syscall/test.tcl
+++ b/testsuite/systemtap.syscall/test.tcl
@@ -86,7 +86,10 @@ foreach line [split $output "\n"] {
if {$i >= $ind} {
puts "PASS"
} else {
- puts "$testname FAILED"
+ puts "$testname FAILED. output of \"$cmd\" was:"
+ puts "------------------------------------------"
+ puts $output
+ puts "------------------------------------------"
puts "RESULTS: (\'*\' = MATCHED EXPECTED)"
set i 0
foreach line [split $output "\n"] {