From 04844b33aa61f84c90b14be204f3a3d70a914e0c Mon Sep 17 00:00:00 2001 From: William Cohen Date: Wed, 10 Dec 2008 15:05:00 -0500 Subject: Format tweaks. --- testsuite/systemtap.examples/ChangeLog | 5 +++++ testsuite/systemtap.examples/process/futexes.stp | 2 +- testsuite/systemtap.examples/profiling/thread-times.stp | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'testsuite') diff --git a/testsuite/systemtap.examples/ChangeLog b/testsuite/systemtap.examples/ChangeLog index 810df78c..5b5aced3 100644 --- a/testsuite/systemtap.examples/ChangeLog +++ b/testsuite/systemtap.examples/ChangeLog @@ -1,3 +1,8 @@ +2008-12-10 William Cohen + + * process/futexes.stp: + * profiling/thread-times.stp: Tweak formatting. + 2008-12-10 Tim Moore * profiling/latencytap.stp: Probe scheduler to identify processes diff --git a/testsuite/systemtap.examples/process/futexes.stp b/testsuite/systemtap.examples/process/futexes.stp index 0bd63262..d10a6a0b 100755 --- a/testsuite/systemtap.examples/process/futexes.stp +++ b/testsuite/systemtap.examples/process/futexes.stp @@ -11,7 +11,7 @@ global lock_waits # long-lived stats on (tid,lock) blockage elapsed time global process_names # long-lived pid-to-execname mapping probe syscall.futex { - if (op != FUTEX_WAIT) next # we don't care about originators of WAKE events + if (op != FUTEX_WAIT) next # don't care about WAKE event originator t = tid () process_names[pid()] = execname() thread_thislock[t] = $uaddr diff --git a/testsuite/systemtap.examples/profiling/thread-times.stp b/testsuite/systemtap.examples/profiling/thread-times.stp index 007e23ed..cbe4118e 100755 --- a/testsuite/systemtap.examples/profiling/thread-times.stp +++ b/testsuite/systemtap.examples/profiling/thread-times.stp @@ -16,7 +16,8 @@ global tids probe timer.s(5), end { allticks = @count(ticks) - printf ("%5s %7s %7s (of %d ticks)\n", "tid", "%user", "%kernel", allticks) + printf ("%5s %7s %7s (of %d ticks)\n", + "tid", "%user", "%kernel", allticks) foreach (tid in tids- limit 20) { uscaled = @count(uticks[tid])*10000/allticks kscaled = @count(kticks[tid])*10000/allticks -- cgit From 1f0cfd980bc0a5e3e360f4ee46808b239bca6b55 Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Tue, 16 Dec 2008 10:34:01 -0500 Subject: Convert .mark to .statement(0x) instead of .statement(foo.c:N) --- testsuite/ChangeLog | 4 ++ testsuite/systemtap.base/static_uprobes.exp | 74 +++++++++++++++++++++++++---- testsuite/systemtap.base/static_uprobes.stp | 14 ------ 3 files changed, 70 insertions(+), 22 deletions(-) delete mode 100644 testsuite/systemtap.base/static_uprobes.stp (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 8e174efc..dc91a215 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-12-16 Stan Cox + + * systemtap.base/static_uprobes.exp: Generate our own probes file. + 2008-12-09 Frank Ch. Eigler PR6961. diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp index 78641d3f..f3f26d8a 100644 --- a/testsuite/systemtap.base/static_uprobes.exp +++ b/testsuite/systemtap.base/static_uprobes.exp @@ -8,6 +8,7 @@ set sup_flags "additional_flags=-iquote$env(SYSTEMTAP_RUNTIME) additional_flags= set fp [open $sup_srcpath "w"] puts $fp " #include +#define USE_STAP_PROBE 1 #include \"sduprobes.h\" foo () @@ -24,12 +25,13 @@ bar (int i) baz (int i, char* s) { + STAP_PROBE1(tstlabel,label0,i); if (i == 0) i = 1000; STAP_PROBE2(tstlabel,label3,i,s); } -buz () +buz (int parm) { } @@ -39,6 +41,7 @@ main () foo(); bar(2); baz(3,\"abc\"); + buz(4); } " close $fp @@ -52,33 +55,85 @@ if { $res != "" } { pass "compiling static_uprobes.c" } +set fp [open "[pwd]/static_uprobes.stp" "w"] +puts $fp " +probe process(\"static_uprobes.x\").mark(\"label0\") +{ + printf(\"In label0 probe %#x\\n\", \$arg1) +} +probe process(\"static_uprobes.x\").mark(\"label1\") +{ + printf(\"In label1 probe\\n\") +} +probe process(\"static_uprobes.x\").mark(\"label2\") +{ + printf(\"In label2 probe %#x\\n\", \$arg1) +} +probe process(\"static_uprobes.x\").mark(\"label3\") +{ + printf(\"In label3 probe %#x %#x\\n\", \$arg1, \$arg2) +} +" +close $fp + set ok 0 -spawn stap -c $sup_exepath $srcdir/$subdir/static_uprobes.stp +verbose -log "spawn stap -c $sup_exepath [pwd]/static_uprobes.stp" +spawn stap -c $sup_exepath [pwd]/static_uprobes.stp expect { -timeout 180 -re {In label1 probe} { incr ok; exp_continue } -re {In label2 probe 0x2} { incr ok; exp_continue } + -re {In label0 probe 0x3} { incr ok; exp_continue } -re {In label3 probe 0x3 0x[0-9a-f][0-9a-f]} { incr ok; exp_continue } timeout { fail "$test (timeout)" } eof { } } +if {$ok == 4} { pass "$test" } { fail "$test ($ok)" } +set ok 0 + # Now do a debuginfo style probe of the above test set fp [open "[pwd]/static_uprobes.sh" "w"] puts $fp " ed $sup_srcpath < Date: Sun, 21 Dec 2008 22:48:38 -0500 Subject: Put a block around the probe point. --- testsuite/ChangeLog | 4 ++++ testsuite/systemtap.base/static_uprobes.exp | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index dc91a215..b18ccf61 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-12-21 Stan Cox + + * systemtap.base/static_uprobes.exp: Parms now called $argN + 2008-12-16 Stan Cox * systemtap.base/static_uprobes.exp: Generate our own probes file. diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp index f3f26d8a..354256db 100644 --- a/testsuite/systemtap.base/static_uprobes.exp +++ b/testsuite/systemtap.base/static_uprobes.exp @@ -112,7 +112,7 @@ set fp [open "[pwd]/static_uprobes.stp" "w"] puts $fp " probe process(\"static_uprobes.x\").mark(\"label0\") { - printf(\"In label0 probe %#x\\n\", \$label0_arg1) + printf(\"In label0 probe %#x\\n\", \$arg1) } probe process(\"static_uprobes.x\").mark(\"label1\") { @@ -120,15 +120,15 @@ probe process(\"static_uprobes.x\").mark(\"label1\") } probe process(\"static_uprobes.x\").mark(\"label2\") { - printf(\"In label2 probe %#x\\n\", \$label2_arg1) + printf(\"In label2 probe %#x\\n\", \$arg1) } probe process(\"static_uprobes.x\").mark(\"label3\") { - printf(\"In label3 probe %#x %#x\\n\", \$label3_arg1, \$label3_arg2) + printf(\"In label3 probe %#x %#x\\n\", \$arg1, \$arg2) } probe process(\"static_uprobes.x\").mark(\"label4\") { - printf(\"In label4 dtrace probe %#x\\n\", \$label4_arg1) + printf(\"In label4 dtrace probe %#x\\n\", \$arg1) } " close $fp -- cgit From 1cecb3c506475a0e0b0ee4180a91e1a9433d346b Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Wed, 24 Dec 2008 13:18:50 -0500 Subject: Systemtap compile server phase 2 (ssl) -- first cut. --- testsuite/ChangeLog | 6 ++++++ testsuite/lib/systemtap.exp | 33 ++++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 11 deletions(-) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index b18ccf61..7180bb56 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2008-12-24 Dave Brolley + + * lib/systemtap.exp: Rename client_path to net_path. + (setup_systemtap_environment): Set ssl_server_path and + ssl_client_path. Pass ssl_server_path to stap-find-or-start-server. + 2008-12-21 Stan Cox * systemtap.base/static_uprobes.exp: Parms now called $argN diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index 28129f0a..9219e977 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 client_path + global srcdir prefix env server_pid net_path # need an absolute SRCDIR for the top-level src/ tree # XXX: or, we could change nearby uses of ${SRCDIR}/testsuite to ${SRCDIR} @@ -55,14 +55,24 @@ proc setup_systemtap_environment {} { if {[use_server_p]} then { print "Testing using a systemtap server" - # Server management scripts are installed if this is an install test, otherwise - # in the source directory. Make sure they are on the $PATH. + # 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 are on the $PATH. set env(PATH) "$srcdir/..:$env(PATH)" + set ssl_server_path [exec pwd]/../ssl/server + set ssl_client_path [exec pwd]/../ssl/client + } else { + set ssl_server_path "" + set ssl_client_path "" } # Try to find or start the server. - set server_pid [exec stap-find-or-start-server] + set server_pid [exec stap-find-or-start-server 65000 $ssl_server_path] if { $server_pid == -1 } then { print "Cannot find or start a systemtap server" set server_pid 0 @@ -76,14 +86,15 @@ proc setup_systemtap_environment {} { # 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' - set client_path [exec pwd]/net - exec /bin/mkdir -p $client_path if {[installtest_p]} then { - exec /bin/cp -p [exec which stap-client] $client_path/stap + exec /bin/cp -p [exec which stap-client] $net_path/stap } else { - exec /bin/cp -p $srcdir/../stap-client $client_path/stap + exec /bin/cp -p $srcdir/../stap-client $net_path/stap + # Make sure the client picks up the proper certificates for + # server verification. + exec sed -i s,/etc/systemtap/ssl/client,$ssl_client_path, $net_path/stap } - set env(PATH) "$client_path:$env(PATH)" + set env(PATH) "$net_path:$env(PATH)" } # PATH, SYSTEMTAP_TAPSET, SYSTEMTAP_RUNTIME, LD_LIBRARY_PATH are already set. @@ -121,7 +132,7 @@ proc systemtap_init {args} {} proc systemtap_version {} {} proc systemtap_exit {} { - global server_pid client_path + global server_pid net_path # Stop the stap server, if we started it. if {[use_server_p]} then { @@ -131,7 +142,7 @@ proc systemtap_exit {} { } # Remove the temporary stap script - exec /bin/rm -fr $client_path + exec /bin/rm -fr $net_path } } -- cgit From 54c3cf05a6e0c377973bd75ed97bd71eb8586577 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 2 Jan 2009 10:38:49 +0100 Subject: PR9693. Add #! /usr/bin/env stap line for traceio2 and functioncallcount. --- testsuite/systemtap.examples/ChangeLog | 6 ++++++ testsuite/systemtap.examples/io/traceio2.stp | 2 ++ testsuite/systemtap.examples/profiling/functioncallcount.stp | 1 + 3 files changed, 9 insertions(+) (limited to 'testsuite') diff --git a/testsuite/systemtap.examples/ChangeLog b/testsuite/systemtap.examples/ChangeLog index 5b5aced3..253e1a76 100644 --- a/testsuite/systemtap.examples/ChangeLog +++ b/testsuite/systemtap.examples/ChangeLog @@ -1,3 +1,9 @@ +2009-01-02 Mark Wielaard + + PR9693. Reported by Eugeniy Meshcheryakov + * io/traceio2.stp: Add proper #! /usr/bin/env stap line. + * profiling/functioncallcount.stp: Likewise. + 2008-12-10 William Cohen * process/futexes.stp: diff --git a/testsuite/systemtap.examples/io/traceio2.stp b/testsuite/systemtap.examples/io/traceio2.stp index 032edcd9..1abea45d 100755 --- a/testsuite/systemtap.examples/io/traceio2.stp +++ b/testsuite/systemtap.examples/io/traceio2.stp @@ -1,3 +1,5 @@ +#! /usr/bin/env stap + global device_of_interest, dev probe begin { diff --git a/testsuite/systemtap.examples/profiling/functioncallcount.stp b/testsuite/systemtap.examples/profiling/functioncallcount.stp index e393b612..9e9ec3fd 100755 --- a/testsuite/systemtap.examples/profiling/functioncallcount.stp +++ b/testsuite/systemtap.examples/profiling/functioncallcount.stp @@ -1,3 +1,4 @@ +#! /usr/bin/env stap # The following line command will probe all the functions # in kernel's memory management code: # -- cgit From ae474ad1e1dd8cbdb7b33fe5dcf0dec47e4dbc58 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Tue, 6 Jan 2009 11:55:14 -0500 Subject: PR9699: correct tcl syntax in test case --- testsuite/ChangeLog | 5 +++++ testsuite/systemtap.context/backtrace.tcl | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 7180bb56..17990756 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-01-06 Frank Ch. Eigler + + PR 9699: + * systemtap.context/backtrace.tcl: Correct tcl syntax in fail message. + 2008-12-24 Dave Brolley * lib/systemtap.exp: Rename client_path to net_path. diff --git a/testsuite/systemtap.context/backtrace.tcl b/testsuite/systemtap.context/backtrace.tcl index aaec4cb8..ca60c369 100644 --- a/testsuite/systemtap.context/backtrace.tcl +++ b/testsuite/systemtap.context/backtrace.tcl @@ -128,7 +128,7 @@ expect { } exp_continue } - eof {fail "backtrace of yyy_func[2-4]: unexpected EOF" } + eof {fail "backtrace of yyy_func*: unexpected EOF" } } exec kill -INT -[exp_pid] if {$m1 == 3} { -- cgit From 64aa100f39dca60999028f83feb31983728ea4d4 Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Fri, 9 Jan 2009 15:11:04 -0500 Subject: New framework for creating/using certificate databases for client/server. --- testsuite/ChangeLog | 4 ++++ testsuite/lib/systemtap.exp | 10 +--------- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 7180bb56..293c007f 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2009-01-09 Dave Brolley + + * lib/systemtap.exp: Remove ssl_server_path and ssl_client_path. + 2008-12-24 Dave Brolley * lib/systemtap.exp: Rename client_path to net_path. diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index 9219e977..f399073e 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -64,15 +64,10 @@ proc setup_systemtap_environment {} { if {! [installtest_p]} then { # Make sure the server management scripts are on the $PATH. set env(PATH) "$srcdir/..:$env(PATH)" - set ssl_server_path [exec pwd]/../ssl/server - set ssl_client_path [exec pwd]/../ssl/client - } else { - set ssl_server_path "" - set ssl_client_path "" } # Try to find or start the server. - set server_pid [exec stap-find-or-start-server 65000 $ssl_server_path] + 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 @@ -90,9 +85,6 @@ proc setup_systemtap_environment {} { exec /bin/cp -p [exec which stap-client] $net_path/stap } else { exec /bin/cp -p $srcdir/../stap-client $net_path/stap - # Make sure the client picks up the proper certificates for - # server verification. - exec sed -i s,/etc/systemtap/ssl/client,$ssl_client_path, $net_path/stap } set env(PATH) "$net_path:$env(PATH)" } -- cgit From dc38c256fac058289cdebd0fde881b4faf24b9d1 Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Sun, 11 Jan 2009 18:39:55 -0500 Subject: Fix compilation warning of too large number on 32-bits machines. --- testsuite/ChangeLog | 4 ++++ testsuite/systemtap.base/badkprobe.exp | 1 + 2 files changed, 5 insertions(+) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 27cd27b5..fe40eb67 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2009-01-11 Wenji Huang + + * systemtap.base/badkprobe.exp: Add explicit timeout. + 2009-01-09 Dave Brolley * lib/systemtap.exp: Remove ssl_server_path and ssl_client_path. diff --git a/testsuite/systemtap.base/badkprobe.exp b/testsuite/systemtap.base/badkprobe.exp index 1a1dbad5..efc06695 100644 --- a/testsuite/systemtap.base/badkprobe.exp +++ b/testsuite/systemtap.base/badkprobe.exp @@ -5,6 +5,7 @@ if {! [installtest_p]} { untested $test; return } spawn stap -g -w -e "$script" expect { + -timeout 60 -re "^WARNING: probe .*registration error.*" { pass $test } eof { fail "$test (eof)" } timeout { fail "$test (timeout)" } -- cgit From a4de985a1a9d7f47858abb1e3037a90a2d50dbc4 Mon Sep 17 00:00:00 2001 From: Srikar Dronamraju Date: Tue, 13 Jan 2009 11:14:37 +0530 Subject: send/send_log needs a -- with a constant string that starts with ----- --- testsuite/systemtap.syscall/test.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testsuite') diff --git a/testsuite/systemtap.syscall/test.tcl b/testsuite/systemtap.syscall/test.tcl index 66a943d6..db0df138 100755 --- a/testsuite/systemtap.syscall/test.tcl +++ b/testsuite/systemtap.syscall/test.tcl @@ -106,7 +106,7 @@ proc run_one_test {filename flags} { } } if {$i < $ind} { - send_log "--------- EXPECTED and NOT MATCHED ----------\n" + send_log -- "--------- EXPECTED and NOT MATCHED ----------\n" } for {} {$i < $ind} {incr i} { send_log "$results($i)\n" -- cgit From b899aa795f925edb7fad318d2e90bb9c3da90b24 Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Tue, 13 Jan 2009 17:17:47 -0500 Subject: Create the rpm subpackage systemtap-sdt-devel --- testsuite/ChangeLog | 4 ++++ testsuite/systemtap.base/static_uprobes.exp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index fe40eb67..ec5dc08e 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2009-01-13 Stan Cox + + * systemtap.base/static_uprobes.exp: Use sdt.h + 2009-01-11 Wenji Huang * systemtap.base/badkprobe.exp: Add explicit timeout. diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp index 354256db..34bd33a4 100644 --- a/testsuite/systemtap.base/static_uprobes.exp +++ b/testsuite/systemtap.base/static_uprobes.exp @@ -9,7 +9,7 @@ set fp [open $sup_srcpath "w"] puts $fp " #include #define USE_STAP_PROBE 1 -#include \"sduprobes.h\" +#include \"sdt.h\" foo () { -- cgit From ac9a5a0b7a603fcae02541726416b6ccdf41efd9 Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Mon, 19 Jan 2009 23:44:54 -0500 Subject: Add checking utrace in test cases. --- testsuite/ChangeLog | 7 +++++++ testsuite/systemtap.base/bz5274.exp | 8 ++++++++ testsuite/systemtap.base/bz6850.exp | 9 +++++++++ testsuite/systemtap.base/static_uprobes.exp | 9 +++++++++ testsuite/systemtap.base/uprobes.exp | 9 +++++++++ 5 files changed, 42 insertions(+) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index ec5dc08e..915febb4 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2009-01-20 Wenji Huang + + * systemtap.base/bz5274.exp: Add checking utrace. + * systemtap.base/bz6850.exp: Ditto. + * systemtap.base/static_uprobes.exp: Ditto. + * systemtap.base/uprobes.exp: Ditto. + 2009-01-13 Stan Cox * systemtap.base/static_uprobes.exp: Use sdt.h diff --git a/testsuite/systemtap.base/bz5274.exp b/testsuite/systemtap.base/bz5274.exp index 6e95a58b..db0e0a46 100755 --- a/testsuite/systemtap.base/bz5274.exp +++ b/testsuite/systemtap.base/bz5274.exp @@ -14,6 +14,14 @@ if {$err == "" && [file exists $test]} then { pass "$test compile" if {! [installtest_p]} { untested "$test -p5"; 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 -p5"; return } if {[catch {exec stap $tpath.stp -c "$srcdir/$subdir/$test.sh"} res]} { untested "$test longjmp to a uretprobed function" diff --git a/testsuite/systemtap.base/bz6850.exp b/testsuite/systemtap.base/bz6850.exp index b06b1696..73fedc8a 100644 --- a/testsuite/systemtap.base/bz6850.exp +++ b/testsuite/systemtap.base/bz6850.exp @@ -3,6 +3,15 @@ set test bz6850 catch {exec gcc -g -o bz6850 $srcdir/$subdir/bz6850.c} err if {$err == "" && [file exists bz6850]} then { pass "$test compile" } else { fail "$test compile" } +# 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 -p4"; untested "$test -p5"; return } + set rc [stap_run_batch $srcdir/$subdir/bz6850.stp] if {$rc == 0} then { pass "$test -p4" } else { fail "$test -p4" } diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp index 34bd33a4..4af688dc 100644 --- a/testsuite/systemtap.base/static_uprobes.exp +++ b/testsuite/systemtap.base/static_uprobes.exp @@ -76,6 +76,15 @@ probe process(\"static_uprobes.x\").mark(\"label3\") " close $fp +# 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 } + set ok 0 verbose -log "spawn stap -c $sup_exepath [pwd]/static_uprobes.stp" spawn stap -c $sup_exepath [pwd]/static_uprobes.stp diff --git a/testsuite/systemtap.base/uprobes.exp b/testsuite/systemtap.base/uprobes.exp index 408ba8c4..e8318586 100644 --- a/testsuite/systemtap.base/uprobes.exp +++ b/testsuite/systemtap.base/uprobes.exp @@ -18,6 +18,15 @@ if [file exists $path] then { pass "$test prep" } else { fail "$test prep" } catch {exec gcc -g -o jennie jennie.c} err if {$err == "" && [file exists jennie]} then { pass "$test compile" } else { fail "$test compile" } +# 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 -p4"; untested "$test -p5"; return } + set rc [stap_run_batch $srcdir/$subdir/uprobes.stp] if {$rc == 0} then { pass "$test -p4" } else { fail "$test -p4" } -- cgit From 46be0ea9347282f992df1c9579921026b9d88336 Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Tue, 20 Jan 2009 11:07:08 -0500 Subject: Don't test -lsduprobe.s for now. --- testsuite/ChangeLog | 4 +++ testsuite/systemtap.base/static_uprobes.exp | 42 ++++++++++++++--------------- 2 files changed, 25 insertions(+), 21 deletions(-) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 915febb4..870148a1 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2009-01-20 Stan Cox + + * systemtap.base/static_uprobes.exp: Don't test -lsduprobes. + 2009-01-20 Wenji Huang * systemtap.base/bz5274.exp: Add checking utrace. diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp index 4af688dc..a27ba2a7 100644 --- a/testsuite/systemtap.base/static_uprobes.exp +++ b/testsuite/systemtap.base/static_uprobes.exp @@ -46,14 +46,14 @@ main () " close $fp -set res [target_compile $sup_srcpath $sup_exepath executable $sup_flags] -if { $res != "" } { - verbose "target_compile failed: $res" 2 - fail "compiling static_uprobes.c" - return -} else { - pass "compiling static_uprobes.c" -} +# set res [target_compile $sup_srcpath $sup_exepath executable $sup_flags] +# if { $res != "" } { +# verbose "target_compile failed: $res" 2 +# fail "compiling static_uprobes.c" +# return +# } else { +# pass "compiling static_uprobes.c" +# } set fp [open "[pwd]/static_uprobes.stp" "w"] puts $fp " @@ -86,19 +86,19 @@ if {! [catch {exec grep -q utrace_attach $path} dummy]} { if {$utrace_support_found == 0} { untested "$test"; return } set ok 0 -verbose -log "spawn stap -c $sup_exepath [pwd]/static_uprobes.stp" -spawn stap -c $sup_exepath [pwd]/static_uprobes.stp -expect { - -timeout 180 - -re {In label1 probe} { incr ok; exp_continue } - -re {In label2 probe 0x2} { incr ok; exp_continue } - -re {In label0 probe 0x3} { incr ok; exp_continue } - -re {In label3 probe 0x3 0x[0-9a-f][0-9a-f]} { incr ok; exp_continue } - timeout { fail "$test (timeout)" } - eof { } -} - -if {$ok == 4} { pass "$test" } { fail "$test ($ok)" } +# verbose -log "spawn stap -c $sup_exepath [pwd]/static_uprobes.stp" +# spawn stap -c $sup_exepath [pwd]/static_uprobes.stp +# expect { +# -timeout 180 +# -re {In label1 probe} { incr ok; exp_continue } +# -re {In label2 probe 0x2} { incr ok; exp_continue } +# -re {In label0 probe 0x3} { incr ok; exp_continue } +# -re {In label3 probe 0x3 0x[0-9a-f][0-9a-f]} { incr ok; exp_continue } +# timeout { fail "$test (timeout)" } +# eof { } +# } + +# if {$ok == 4} { pass "$test" } { fail "$test ($ok)" } set ok 0 # Now do a debuginfo style probe of the above test -- cgit From c1008fd01d322bb12e66cb8dc513d488082777a4 Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Thu, 22 Jan 2009 14:23:49 -0500 Subject: Add dtrace -h support --- testsuite/ChangeLog | 4 ++ testsuite/systemtap.base/static_uprobes.exp | 80 +++++++++++++++++------------ 2 files changed, 50 insertions(+), 34 deletions(-) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 870148a1..322ddfbe 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2009-01-22 Stan Cox + + * systemtap.base/static_uprobes.exp: Test dtrace. + 2009-01-20 Stan Cox * systemtap.base/static_uprobes.exp: Don't test -lsduprobes. diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp index a27ba2a7..eb0d1c6e 100644 --- a/testsuite/systemtap.base/static_uprobes.exp +++ b/testsuite/systemtap.base/static_uprobes.exp @@ -9,26 +9,26 @@ set fp [open $sup_srcpath "w"] puts $fp " #include #define USE_STAP_PROBE 1 -#include \"sdt.h\" +#include \"static_uprobes.h\" foo () { - STAP_PROBE(tstlabel,label1); + STAP_PROBE(static_uprobes,test_probe_1); } bar (int i) { if (i == 0) i = 1000; - STAP_PROBE1(tstlabel,label2,i); + STAP_PROBE1(static_uprobes,test_probe_2,i); } baz (int i, char* s) { - STAP_PROBE1(tstlabel,label0,i); + STAP_PROBE1(static_uprobes,test_probe_0,i); if (i == 0) i = 1000; - STAP_PROBE2(tstlabel,label3,i,s); + STATIC_UPROBES_TEST_PROBE_3(i,s); } buz (int parm) @@ -57,21 +57,21 @@ close $fp set fp [open "[pwd]/static_uprobes.stp" "w"] puts $fp " -probe process(\"static_uprobes.x\").mark(\"label0\") +probe process(\"static_uprobes.x\").mark(\"test_probe_0\") { - printf(\"In label0 probe %#x\\n\", \$arg1) + printf(\"In test_probe_0 probe %#x\\n\", \$arg1) } -probe process(\"static_uprobes.x\").mark(\"label1\") +probe process(\"static_uprobes.x\").mark(\"test_probe_1\") { - printf(\"In label1 probe\\n\") + printf(\"In test_probe_1 probe\\n\") } -probe process(\"static_uprobes.x\").mark(\"label2\") +probe process(\"static_uprobes.x\").mark(\"test_probe_2\") { - printf(\"In label2 probe %#x\\n\", \$arg1) + printf(\"In test_probe_2 probe %#x\\n\", \$arg1) } -probe process(\"static_uprobes.x\").mark(\"label3\") +probe process(\"static_uprobes.x\").mark(\"test_probe_3\") { - printf(\"In label3 probe %#x %#x\\n\", \$arg1, \$arg2) + printf(\"In test_probe_3 probe %#x %#x\\n\", \$arg1, \$arg2) } " close $fp @@ -90,10 +90,10 @@ set ok 0 # spawn stap -c $sup_exepath [pwd]/static_uprobes.stp # expect { # -timeout 180 -# -re {In label1 probe} { incr ok; exp_continue } -# -re {In label2 probe 0x2} { incr ok; exp_continue } -# -re {In label0 probe 0x3} { incr ok; exp_continue } -# -re {In label3 probe 0x3 0x[0-9a-f][0-9a-f]} { incr ok; exp_continue } +# -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 } # timeout { fail "$test (timeout)" } # eof { } # } @@ -109,7 +109,7 @@ ed $sup_srcpath <