From 5ddc5963ce06ecea574e90ca503a3ee598522d8f Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Fri, 4 Dec 2009 13:08:01 +0100 Subject: support multiline data output from scripts run under the grapher This is accompanied by support for multiline output in hover text. * grapher/StapParser.cxx (ioCallback): Read data 'til the end of line character, not just '\n'. Be careful to use I/O functions that don't treat '\n' specially. * grapher/StapParser.hxx: ditto * grapher/CairoWidget.cxx (CairoTextBox::draw): Perform line breaks for hover text. * testsuite/systemtap.examples/general/grapher.stp: Do multiline output of keyboard events. Also, fix longstanding breaking in the pty probe. --- testsuite/systemtap.examples/general/grapher.stp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'testsuite') diff --git a/testsuite/systemtap.examples/general/grapher.stp b/testsuite/systemtap.examples/general/grapher.stp index e8655b37..c1c60437 100755 --- a/testsuite/systemtap.examples/general/grapher.stp +++ b/testsuite/systemtap.examples/general/grapher.stp @@ -8,7 +8,7 @@ printf ("%%DataSet:pty 50 0000ff discreet\n"); printf ("cpu %%Title:CPU utilization\n"); printf ("cpu %%XAxisTitle:Time\n"); printf ("cpu %%YAxisTitle:Percent\n"); - +printf ("%%LineEnd:0\n"); } # CPU utilization @@ -26,17 +26,25 @@ function qsq_util_reset(q) { probe timer.ms(100) { # collect utilization percentages frequently foreach (q in qnames) - printf("cpu %d %d\n", gettimeofday_ms(), qsq_util_reset(q)) + printf("cpu %d %d%c", gettimeofday_ms(), qsq_util_reset(q), 0) } probe kernel.function("kbd_event") { if ($event_type == 1 && $value) - printf("kbd %d %d\n", gettimeofday_ms(), $event_code) + printf("kbd %d %d\n0x%x%c", gettimeofday_ms(), $event_code, $event_code, 0) } probe kernel.function("pty_write") { - if (count > 0) - printf("pty %d %.5s\n", gettimeofday_ms(), buf) + if ($count > 0) { + printf("pty %d ", gettimeofday_ms()) + str = kernel_string($buf) + for (i = 0; i < $count; ++i) { + # yes it's gross + c = substr(str, i, 1) + printf("%s\n", text_str(c)) + } + printf("%c", 0) + } } -- cgit From 52cf0905d93c33f7d6f768478572ea08df4c8af0 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Fri, 4 Dec 2009 14:11:25 +0100 Subject: tweak multiline hover text to have proper interline spacing * grapher/CairoWidget.cxx (CairoTextBox::draw): Use font information to caculate legible spacing. Also change the font to something more readable. * testsuite/systemtap.examples/general/grapher.stp: Put carriage returns in the right spots. --- testsuite/systemtap.examples/general/grapher.stp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'testsuite') diff --git a/testsuite/systemtap.examples/general/grapher.stp b/testsuite/systemtap.examples/general/grapher.stp index c1c60437..baeeff5c 100755 --- a/testsuite/systemtap.examples/general/grapher.stp +++ b/testsuite/systemtap.examples/general/grapher.stp @@ -39,9 +39,11 @@ probe kernel.function("pty_write") { printf("pty %d ", gettimeofday_ms()) str = kernel_string($buf) for (i = 0; i < $count; ++i) { + if (i > 1) + printf("\n") # yes it's gross c = substr(str, i, 1) - printf("%s\n", text_str(c)) + printf("%s", text_str(c)) } printf("%c", 0) } -- cgit From 6da1ad4654842c7a2489e18b9acc94f2f68a6b24 Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Mon, 7 Dec 2009 16:47:32 +0800 Subject: Fix regression introduced by commit 379c585 --- testsuite/buildok/tcpmib-all-probes.stp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'testsuite') diff --git a/testsuite/buildok/tcpmib-all-probes.stp b/testsuite/buildok/tcpmib-all-probes.stp index 8d1105e1..5b44a99a 100755 --- a/testsuite/buildok/tcpmib-all-probes.stp +++ b/testsuite/buildok/tcpmib-all-probes.stp @@ -4,6 +4,13 @@ probe tcpmib.* {} +// This function is just for test, the real one is +// in tcpipstat.stp +function tcpmib_filter_key:long (sk:long, op:long) { + if (!sk) return 0 + return op +} + probe begin{ print(tcpmib_get_state(0) + tcpmib_local_addr(0) + -- cgit From 9983df163a0b1743de5777f940b9d6a827142476 Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 7 Dec 2009 15:12:46 -0600 Subject: Small compile server shutdown fix. * testsuite/lib/systemtap.exp (shutdown_server): Only remove the temporary stap script if it exists. --- testsuite/lib/systemtap.exp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'testsuite') diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index f16facc2..13e6d1a2 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -175,7 +175,9 @@ proc shutdown_server {} { } # Remove the temporary stap script - exec /bin/rm -fr $net_path + if [file exists $net_path] { + exec /bin/rm -fr $net_path + } } proc get_system_info {} { -- cgit From b2ea60606801aa9bf243f22318ac4bd8a25094fe Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 7 Dec 2009 15:17:58 -0600 Subject: PR 10641 fixed by checking module name in unprivileged mode. * main.cxx (checkOptions): If in unprivileged mode, make sure module name starts with 'stap_'. * testsuite/parseko/cmdline05.stp: New testcase. * testsuite/parseok/cmdline03.stp: New testcase. --- testsuite/parseko/cmdline05.stp | 6 ++++++ testsuite/parseok/cmdline03.stp | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100755 testsuite/parseko/cmdline05.stp create mode 100755 testsuite/parseok/cmdline03.stp (limited to 'testsuite') diff --git a/testsuite/parseko/cmdline05.stp b/testsuite/parseko/cmdline05.stp new file mode 100755 index 00000000..f8c437ea --- /dev/null +++ b/testsuite/parseko/cmdline05.stp @@ -0,0 +1,6 @@ +#! /bin/sh + +# Make sure unprivileged ('--unprivileged') option isn't accepted when +# a module name not starting with 'stap_' is used. + +stap --unprivileged -m 'nfs' -p1 -e 'probe begin { exit() }' diff --git a/testsuite/parseok/cmdline03.stp b/testsuite/parseok/cmdline03.stp new file mode 100755 index 00000000..d0ba5bbf --- /dev/null +++ b/testsuite/parseok/cmdline03.stp @@ -0,0 +1,6 @@ +#! /bin/sh + +# Make sure unprivileged ('--unprivileged') option is accepted when a +# module name starting with 'stap_' is used. + +stap --unprivileged -m 'stap_foo' -p1 -e 'probe begin { exit() }' -- cgit From 2d971c6b8835c7e38ce78dd554827f5f96bc7c04 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 8 Dec 2009 03:23:20 +0100 Subject: Add dtrace -I support. dtrace -I is used to pass through include paths to cpp when run. Thanks to David Malcolm for python coding and testing. * dtrace.in: Add -I support. * testsuite/systemtap.base/dtrace.exp: Add testcases for -C -I and -G -I. --- testsuite/systemtap.base/dtrace.exp | 72 ++++++++++++++++++++++++++++++------- 1 file changed, 59 insertions(+), 13 deletions(-) (limited to 'testsuite') diff --git a/testsuite/systemtap.base/dtrace.exp b/testsuite/systemtap.base/dtrace.exp index f4cac5aa..f68af4f5 100644 --- a/testsuite/systemtap.base/dtrace.exp +++ b/testsuite/systemtap.base/dtrace.exp @@ -8,7 +8,7 @@ if {[installtest_p]} { set dtrace ../dtrace } -exec mkdir /tmp/dtrace +exec mkdir -p /tmp/dtrace set dpath "/tmp/dtrace/test.d" set fp [open $dpath "w"] @@ -23,11 +23,34 @@ provider tstsyscall " close $fp +exec mkdir -p /tmp/dtrace_inc +set ipath "/tmp/dtrace_inc/dtest.h" +set $fp [open $ipath "w"] +puts $fp " +#define INT16 short +#define INT32 int +" +close $fp + +set idpath "/tmp/dtrace/itest.d" +set $fp [open $idpath "w"] +puts $fp " +#include + +provider tstsyscall +{ + probe test(INT16 arg1, INT32 arg2, INT32 arg3, INT32 arg4, struct astruct arg5) +} +" +close $fp + +set incpath "/tmp/dtrace_inc" + # ----------------------------------------------------------------- # test command line option and file handling verbose -log "$dtrace -G -s $dpath -o XXX.o" -exec $dtrace -G -s $dpath -o XXX.o +catch {exec $dtrace -G -s $dpath -o XXX.o} if {[file exists XXX.o]} then { pass "dtrace -G -o XXX.o" } else { @@ -36,7 +59,7 @@ if {[file exists XXX.o]} then { exec rm -f XXX.o verbose -log "$dtrace -G -s $dpath -o XXX" -exec $dtrace -G -s $dpath -o XXX +catch {exec $dtrace -G -s $dpath -o XXX} if {[file exists XXX.o]} then { pass "dtrace -G -o XXX" } else { @@ -45,7 +68,7 @@ if {[file exists XXX.o]} then { exec rm -f XXX.o verbose -log "$dtrace -h -s $dpath -o XXX.h" -exec $dtrace -h -s $dpath -o XXX.h +catch {exec $dtrace -h -s $dpath -o XXX.h} if {[file exists XXX.h]} then { pass "dtrace -h -o XXX.h" } else { @@ -54,7 +77,7 @@ if {[file exists XXX.h]} then { exec rm -f XXX.h verbose -log "$dtrace -h -s $dpath -o XXX" -exec $dtrace -h -s $dpath -o XXX +catch {exec $dtrace -h -s $dpath -o XXX} if {[file exists XXX]} then { pass "dtrace -h -o XXX" } else { @@ -63,7 +86,7 @@ if {[file exists XXX]} then { exec rm -f XXX verbose -log "$dtrace -G -s $dpath -o /tmp/XXX.o" -exec $dtrace -G -s $dpath -o /tmp/XXX.o +catch {exec $dtrace -G -s $dpath -o /tmp/XXX.o} if {[file exists /tmp/XXX.o]} then { pass "dtrace -G -o /tmp/XXX.o" } else { @@ -72,7 +95,7 @@ if {[file exists /tmp/XXX.o]} then { exec rm -f /tmp/XXX.o verbose -log "$dtrace -G -s $dpath -o /tmp/XXX" -exec $dtrace -G -s $dpath -o /tmp/XXX +catch {exec $dtrace -G -s $dpath -o /tmp/XXX} if {[file exists /tmp/XXX.o]} then { pass "dtrace -G -o /tmp/XXX.o" } else { @@ -81,7 +104,7 @@ if {[file exists /tmp/XXX.o]} then { exec rm -f /tmp/XXX.o verbose -log "$dtrace -h -s $dpath -o /tmp/XXX.h" -exec $dtrace -h -s $dpath -o /tmp/XXX.h +catch {exec $dtrace -h -s $dpath -o /tmp/XXX.h} if {[file exists /tmp/XXX.h]} then { pass "dtrace -h -o /tmp/XXX.h" } else { @@ -90,7 +113,7 @@ if {[file exists /tmp/XXX.h]} then { exec rm -f /tmp/XXX.h verbose -log "$dtrace -h -s $dpath -o /tmp/XXX" -exec $dtrace -h -s $dpath -o /tmp/XXX +catch {exec $dtrace -h -s $dpath -o /tmp/XXX} if {[file exists /tmp/XXX]} then { pass "dtrace -h -o /tmp/XXX" } else { @@ -99,7 +122,7 @@ if {[file exists /tmp/XXX]} then { exec rm -f /tmp/XXX verbose -log "$dtrace -G -s $dpath" -exec $dtrace -G -s $dpath +catch {exec $dtrace -G -s $dpath} if {[file exists test.o]} then { pass "dtrace -G" } else { @@ -108,7 +131,7 @@ if {[file exists test.o]} then { exec rm -f test.o verbose -log "$dtrace -h -s $dpath" -exec $dtrace -h -s $dpath +catch {exec $dtrace -h -s $dpath} if {[file exists test.h]} then { pass "dtrace -h" } else { @@ -118,7 +141,7 @@ exec rm -f test.o set ok 0 verbose -log "$dtrace -C -h -s $dpath -o XXX.h" -exec $dtrace -C -h -s $dpath -o XXX.h +catch {exec $dtrace -C -h -s $dpath -o XXX.h} spawn cat XXX.h expect { "short arg1, int arg2, int arg3, int arg4" {incr ok} @@ -130,5 +153,28 @@ if { $ok != 0} { } exec rm -f XXX.h -exec /bin/rm -r /tmp/dtrace +set ok 0 +verbose -log "$dtrace -C -I$incpath -h -s $idpath -o XXX.h" +catch {exec $dtrace -C -I$incpath -h -s $idpath -o XXX.h} +spawn cat XXX.h +expect { + "short arg1, int arg2, int arg3, int arg4" {incr ok} +} +if { $ok != 0} { + pass "dtrace -C -Iincpath -h -o XXX.h" +} else { + fail "dtrace -C -Iincpath -h -o XXX.h" +} +exec rm -f XXX.h + +verbose -log "$dtrace -I$incpath -G -s $idpath" +catch {exec $dtrace -G -s $dpath} +if {[file exists test.o]} then { + pass "dtrace -Iincpath -G" +} else { + fail "dtrace -Iincpath -G" +} +exec rm -f test.o + +exec /bin/rm -r /tmp/dtrace /tmp/dtrace_inc # ----------------------------------------------------------------- -- cgit From 851418deb65964ef73f55e2aab0f3733c0e0e2e8 Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 8 Dec 2009 10:40:27 -0600 Subject: Revert "PR 10641 fixed by checking module name in unprivileged mode." This reverts commit b2ea60606801aa9bf243f22318ac4bd8a25094fe. * main.cxx (checkOptions): Remove unprivileged mode module name check. * testsuite/parseko/cmdline05.stp: Delete unneeded testcase. * testsuite/parseok/cmdline03.stp: Ditto. --- testsuite/parseko/cmdline05.stp | 6 ------ testsuite/parseok/cmdline03.stp | 6 ------ 2 files changed, 12 deletions(-) delete mode 100755 testsuite/parseko/cmdline05.stp delete mode 100755 testsuite/parseok/cmdline03.stp (limited to 'testsuite') diff --git a/testsuite/parseko/cmdline05.stp b/testsuite/parseko/cmdline05.stp deleted file mode 100755 index f8c437ea..00000000 --- a/testsuite/parseko/cmdline05.stp +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/sh - -# Make sure unprivileged ('--unprivileged') option isn't accepted when -# a module name not starting with 'stap_' is used. - -stap --unprivileged -m 'nfs' -p1 -e 'probe begin { exit() }' diff --git a/testsuite/parseok/cmdline03.stp b/testsuite/parseok/cmdline03.stp deleted file mode 100755 index d0ba5bbf..00000000 --- a/testsuite/parseok/cmdline03.stp +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/sh - -# Make sure unprivileged ('--unprivileged') option is accepted when a -# module name starting with 'stap_' is used. - -stap --unprivileged -m 'stap_foo' -p1 -e 'probe begin { exit() }' -- cgit From 63b4fd1474ec5859fac4c9b710c8f466bcd3b0f7 Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Tue, 8 Dec 2009 11:57:00 -0500 Subject: Add .library("lib").mark("mark") and use it for .mark semaphores. tapset-utrace.cxx (TOK_LIBRARY): New. (utrace_derived_probe::utrace_derived_probe): Add library and has_library. (utrace_builder::build): Handle library. (utrace_derived_probe_group::emit_probe_decl): Add sdt_sem_offset to emitted stap_utrace_probes. Add stap_task_finder_target mmap_callback for handling shared library. Handle sdt_sem_offset in emitted_stp_utrace_probe_cb. Add stap_utrace_mmap_found. (register_tapset_utrace): Handle .library tapset-utrace.cxx (TOK_LIBRARY): New. (base_query::base_query): Add path and has_library. (dwarf_derived_probe::dwarf_derived_probe) Likewise. (dwarf_derived_probe::register_patterns): Handle .library (sdt_query::convert_location): Likewise. (dwarf_builder::build): Likewise. (uprobe_derived_probe_group::emit_module_decls): Emit sdt_sem_address. Add sdt_sem_offset to emitted stap_uprobe_spec. Add offset and vm_flags to signature of stap_uprobe_change_plus, and handle sdt_sem_offset. Allow writeable segments in emitted stap_uprobe_mmap_found. sdt_misc.exp: Test .library util.cxx (find_executable): Add env_path to sig and use it in getenv. util.h (find_executable): Likewise. Make "PATH" the default. dtrace.in (provider): Turn on semaphores. sdt.h: Likewise. --- testsuite/systemtap.base/sdt_misc.exp | 101 +++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 38 deletions(-) (limited to 'testsuite') diff --git a/testsuite/systemtap.base/sdt_misc.exp b/testsuite/systemtap.base/sdt_misc.exp index 4e6f953f..062181a5 100644 --- a/testsuite/systemtap.base/sdt_misc.exp +++ b/testsuite/systemtap.base/sdt_misc.exp @@ -3,20 +3,17 @@ set test "sdt_misc" # Test miscellaneous features of .mark probes # Compile a C program to use as the user-space probing target -set sup_srcpath "[pwd]/static_user_markers.c" -set sup_exepath "[pwd]/static_user_markers.x" -set sup_sopath "[pwd]/libsdt.so" -set supcplus_exepath "[pwd]/static_user_markers_cplus.x" +set sup_srcpath "[pwd]/sdt_misc.c" +set supcplus_exepath "[pwd]/sdt_misc_cplus.x" set fp [open $sup_srcpath "w"] puts $fp " #include -#define USE_STAP_PROBE 1 -#include \"static_user_markers_.h\" +#include \"sdt_misc_.h\" void bar (int i) { - STATIC_USER_MARKERS_TEST_PROBE_2(i); + SDT_MISC_TEST_PROBE_2(i); if (i == 0) i = 1000; STAP_PROBE1(static_uprobes,test_probe_2,i); @@ -28,7 +25,7 @@ baz (int i, char* s) STAP_PROBE1(static_uprobes,test_probe_0,i); if (i == 0) i = 1000; - STATIC_USER_MARKERS_TEST_PROBE_3(i,s); + SDT_MISC_TEST_PROBE_3(i,s); } void @@ -42,7 +39,7 @@ buz (int parm) struct astruct bstruct = {parm, parm + 1}; if (parm == 0) parm = 1000; - DTRACE_PROBE1(static_user_markers,test_probe_4,&bstruct); + DTRACE_PROBE1(sdt_misc,test_probe_4,&bstruct); } #ifndef NO_MAIN @@ -57,34 +54,50 @@ main () " close $fp -set sup_stppath "[pwd]/static_user_markers.stp" +set sup_stppath "[pwd]/sdt_misc.stp" set fp [open $sup_stppath "w"] puts $fp " -probe process(\"static_user_markers.x\").mark(\"test_probe_0\") +%( \$# > 1 %? +probe process(@1).library(@2).mark(\"test_probe_0\") +%: +probe process(@1).mark(\"test_probe_0\") +%) { printf(\"In %s probe %#x\\n\", \$\$name, \$arg1) } -probe process(\"static_user_markers.x\").mark(\"test_probe_2\") +%( \$# > 1 %? +probe process(@1).library(@2).mark(\"test_probe_2\") +%: +probe process(@1).mark(\"test_probe_2\") +%) { printf(\"In %s probe %#x\\n\", \$\$name, \$arg1) } -probe process(\"static_user_markers.x\").mark(\"test_probe_3\") +%( \$# > 1 %? +probe process(@1).library(@2).mark(\"test_probe_3\") +%: +probe process(@1).mark(\"test_probe_3\") +%) { printf(\"In %s probe %#x %#x\\n\", \$\$name, \$arg1, \$arg2) } -probe process(\"static_user_markers.x\").mark(\"test_probe_4\") +%( \$# > 1 %? +probe process(@1).library(@2).mark(\"test_probe_4\") +%: +probe process(@1).mark(\"test_probe_4\") +%) { printf(\"In %s dtrace probe %#x %#x\\n\", \$\$name, \$arg1->a, \$arg1->b) } " close $fp -set sup_dpath "[pwd]/static_user_markers_.d" -set sup_hpath "[pwd]/static_user_markers_.h" -set sup_opath "[pwd]/static_user_markers_.o" +set sup_dpath "[pwd]/sdt_misc_.d" +set sup_hpath "[pwd]/sdt_misc_.h" +set sup_opath "[pwd]/sdt_misc_.o" set fp [open $sup_dpath "w"] puts $fp " -provider static_user_markers { +provider sdt_misc { probe test_probe_0 (); probe test_probe_2 (int i); probe test_probe_3 (int i, char* x); @@ -130,7 +143,7 @@ set pbtype_mssgs {{uprobe} {utrace} {kprobe}} for {set i 0} {$i < [llength $pbtype_flags]} {incr i} { set pbtype_flag [lindex $pbtype_flags $i] set pbtype_mssg [lindex $pbtype_mssgs $i] -set testprog "sdt.c.exe.$i" +set sup_exepath "[pwd]/sdt_misc-$pbtype_mssg.x" set sup_flags "additional_flags=-I$srcdir/../includes/sys" set sup_flags "$sup_flags additional_flags=-I$sdtdir" @@ -163,7 +176,7 @@ if {![utrace_p]} { set ok 0 verbose -log "spawn stap -c $sup_exepath $sup_stppath" -spawn stap -c $sup_exepath $sup_stppath +spawn stap -c $sup_exepath $sup_stppath $sup_exepath expect { -timeout 180 -re {In test_probe_2 probe 0x2} { incr ok; exp_continue } @@ -198,17 +211,17 @@ set ok 0 set fail "types" verbose -log "spawn stap -c ./sdt_types.x $srcdir/$subdir/sdt_types.stp ./sdt_types.x" spawn stap -c ./sdt_types.x $srcdir/$subdir/sdt_types.stp ./sdt_types.x + expect { -timeout 180 -re {FAIL: [a-z_]+var} { regexp " .*$" $expect_out(0,string) s; incr ok; set fail "$fail $s"; exp_continue } - timeout { fail "$test (timeout) } + timeout { fail "$test (timeout)" } eof { } } wait -set pbtype_mssgs {{uprobe} {utrace} {kprobe}} if { $ok != 0} { if { $pbtype_mssg == "uprobe" } { fail "$test $fail $pbtype_mssg" @@ -222,7 +235,7 @@ if { $ok != 0} { # Test probe in shared object -set sup_srcmainpath "[pwd]/static_user_markers_.c" +set sup_srcmainpath "[pwd]/sdt_misc_.c" set fp [open $sup_srcmainpath "w"] puts $fp " int @@ -238,9 +251,11 @@ close $fp set sup_flags "$sup_flags additional_flags=-shared" set sup_flags "$sup_flags additional_flags=-fPIC" set sup_flags "$sup_flags additional_flags=-DNO_MAIN" +set sup_sopath "[pwd]/libsdt-$pbtype_mssg.so" +set sup_exepath "[pwd]/sdt_misc-$pbtype_mssg-shared.x" set res0 [target_compile $sup_srcpath $sup_sopath executable $sup_flags ] set sup0_flags "additional_flags=-g additional_flags=-Wl,-rpath,[pwd]" -set sup0_flags "$sup0_flags additional_flags=-L[pwd] additional_flags=-lsdt" +set sup0_flags "$sup0_flags additional_flags=-L[pwd] additional_flags=-lsdt-$pbtype_mssg" set res [target_compile $sup_srcmainpath $sup_exepath executable $sup0_flags ] if { $res0 != "" || $res != "" } { verbose "target_compile failed: $res0 $res" 2 @@ -254,21 +269,28 @@ if { $res0 != "" || $res != "" } { } set ok 0 -# verbose -log "stap -c $sup_exepath -e probe process(\"$sup_sopath\").mark(\"test_probe_2\") {printf(\"In %s probe %#x\\n\", \$\$name, \$arg1)}" -# spawn stap -c $sup_exepath -e "probe process(\"$sup_sopath\").mark(\"test_probe_2\") {printf(\"In %s probe %#x\\n\", \$\$name, \$arg1)}" -# expect { -# -timeout 180 -# -re {In test_probe_2 probe 0x2} { incr ok; exp_continue } -# timeout { fail "$test (timeout)" } -# eof { } -# } -# wait - -if {$ok == 2} { +verbose -log "spawn stap -c $sup_exepath $sup_stppath $sup_exepath $sup_sopath" +if { $pbtype_mssg != "kprobe" } { + spawn stap -c $sup_exepath $sup_stppath $sup_exepath $sup_sopath +} else { + spawn stap -c $sup_exepath $sup_stppath $sup_sopath +} +expect { + -timeout 180 + -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 } + -re {In test_probe_4 dtrace probe 0x4 0x5} { incr ok; exp_continue } + timeout { fail "$test (timeout)" } + eof { } +} + +wait + +if {$ok == 5} { pass "$test shared $pbtype_mssg" } else { -# fail "$test shared ($ok) $pbtype_mssg" - xfail "$test shared ($ok) $pbtype_mssg" + fail "$test ($ok) shared $pbtype_mssg" } # Test .mark probe wildcard matching @@ -288,9 +310,12 @@ if { $ok == 45 } { fail "$test wildcard ($ok) $pbtype_mssg" } +if { $verbose == 0 } { + catch {exec rm -f libsdt-$pbtype_mssg.so sdt_misc-$pbtype_mssg.x sdt_misc-$pbtype_mssg-shared.x } +} # for {set i 0} } if { $verbose == 0 } { -catch {exec rm -f $sup_srcpath $sup_exepath $sup_sopath $supcplus_exepath $sup_dpath $sup_hpath $sup_opath $sup_stppath $sdt_types.x $sup_srcmainpath} + catch {exec rm -f sdt_misc_.c sdt_misc.c sdt_misc_.d sdt_misc_.h sdt_misc_.o sdt_misc.stp sdt_types.x} } -- cgit From 81bcf6d6dd9ce44667951bf6212b6b3c8febaf31 Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Fri, 11 Dec 2009 16:59:55 -0500 Subject: Use env(SYSTEMTAP_TESTAPPS) for all systemtap.apps mysql.exp: Use env(SYSTEMTAP_TESTAPPS). (mysqlrelease): Update and check for download failure. postgres.exp: Use env(SYSTEMTAP_TESTAPPS). stap-tcl.stp: Use .library("library").mark("mark"). tcl.exp: Likewise. --- testsuite/systemtap.apps/mysql.exp | 13 ++++++++++--- testsuite/systemtap.apps/postgres.exp | 6 ++++-- testsuite/systemtap.apps/stap-tcl.stp | 2 +- testsuite/systemtap.apps/tcl.exp | 6 ++++-- 4 files changed, 19 insertions(+), 8 deletions(-) (limited to 'testsuite') diff --git a/testsuite/systemtap.apps/mysql.exp b/testsuite/systemtap.apps/mysql.exp index efeffbae..497949c0 100644 --- a/testsuite/systemtap.apps/mysql.exp +++ b/testsuite/systemtap.apps/mysql.exp @@ -4,14 +4,16 @@ set test "mysql" global env -if {! [info exists env(SYSTEMTAP_TEST_SDT)]} { - unsupported "mysql (\"SYSTEMTAP_TEST_SDT\" not in env)" +if {! [info exists env(SYSTEMTAP_TESTAPPS)] || ( + ! [string match "tcl" $env(SYSTEMTAP_TESTAPPS)] && + ! [string match "all" $env(SYSTEMTAP_TESTAPPS)])} { + untested "$test sdt app" return } ########## Create /tmp/stap-mysql.stp ########## set msdata "[pwd]/stap-mysql" -set mysqlrelease "mysql-5.4.1-beta" +set mysqlrelease "mysql-5.4.3-beta" set mysqldir "[pwd]/mysql/install/" set testsuite "[pwd]" @@ -291,6 +293,11 @@ kill \$STAPPID if \[ ! -r $mysqlrelease.tar.gz \] ; then wget http://dev.mysql.com/get/Downloads/MySQL-5.4/$mysqlrelease.tar.gz/from/ftp://mirror.services.wisc.edu/mirrors/mysql/ fi +if \[ ! -r $mysqlrelease.tar.gz \] ; then + echo FAIL: wget $mysqlrelease.tar.gz + exit +fi + if \[ ! -d mysql/src \] ; then tar -x -z -f $mysqlrelease.tar.gz diff --git a/testsuite/systemtap.apps/postgres.exp b/testsuite/systemtap.apps/postgres.exp index 2d58a54f..b7f522a1 100644 --- a/testsuite/systemtap.apps/postgres.exp +++ b/testsuite/systemtap.apps/postgres.exp @@ -4,8 +4,10 @@ set test "postgres" global env -if {! [info exists env(SYSTEMTAP_TEST_SDT)]} { - unsupported "postgres (\"SYSTEMTAP_TEST_SDT\" not in env)" +if {! [info exists env(SYSTEMTAP_TESTAPPS)] || ( + ! [string match "tcl" $env(SYSTEMTAP_TESTAPPS)] && + ! [string match "all" $env(SYSTEMTAP_TESTAPPS)])} { + untested "$test sdt app" return } diff --git a/testsuite/systemtap.apps/stap-tcl.stp b/testsuite/systemtap.apps/stap-tcl.stp index d3293b09..db3e3690 100644 --- a/testsuite/systemtap.apps/stap-tcl.stp +++ b/testsuite/systemtap.apps/stap-tcl.stp @@ -1,6 +1,6 @@ global counts -probe process(@1).mark("*") { +probe process(@1).library(@2).mark("*") { counts[$$name]<<<1 # PR10878; check also $$parms length } diff --git a/testsuite/systemtap.apps/tcl.exp b/testsuite/systemtap.apps/tcl.exp index bfcf2239..c95fa5e0 100644 --- a/testsuite/systemtap.apps/tcl.exp +++ b/testsuite/systemtap.apps/tcl.exp @@ -29,7 +29,8 @@ if {$rc != 0} { } set test "stap-tcl.stp compilation" -set rc [catch {exec stap -DMAXSKIPPED=8024 -t -p4 $srcdir/$subdir/stap-tcl.stp tcl/install/lib/libtcl${tclreleasemajor}.so} out] +verbose -log "spawn stap -DMAXSKIPPED=8024 -t -p4 $srcdir/$subdir/stap-tcl.stp tcl/install/bin/tclsh${tclreleasemajor} tcl/install/lib/libtcl${tclreleasemajor}.so" +set rc [catch {exec stap -DMAXSKIPPED=8024 -t -p4 $srcdir/$subdir/stap-tcl.stp tcl/install/bin/tclsh${tclreleasemajor} tcl/install/lib/libtcl${tclreleasemajor}.so} out] clone_output $out if {$rc != 0} { fail $test @@ -47,7 +48,8 @@ if {![installtest_p]} { set ok 0 set ko 0 set lines 0 -spawn stap -DMAXSKIPPED=8024 -t -c "tcl/install/bin/tclsh${tclreleasemajor} tcl/src/tests/all.tcl > tcl-test.out" $srcdir/$subdir/stap-tcl.stp tcl/install/lib/libtcl${tclreleasemajor}.so +verbose -log "spawn stap -DMAXSKIPPED=8024 -t -c \"tcl/install/bin/tclsh${tclreleasemajor} tcl/src/tests/all.tcl > tcl-test.out\" $srcdir/$subdir/stap-tcl.stp tcl/install/bin/tclsh${tclreleasemajor} tcl/install/lib/libtcl${tclreleasemajor}.so" +spawn stap -DMAXSKIPPED=8024 -t -c "tcl/install/bin/tclsh${tclreleasemajor} tcl/src/tests/all.tcl > tcl-test.out" $srcdir/$subdir/stap-tcl.stp tcl/install/bin/tclsh${tclreleasemajor} tcl/install/lib/libtcl${tclreleasemajor}.so expect { -timeout 1000 -re {^OK [^\r\n]*[\r\n]} { incr ok; exp_continue } -- cgit