From a96d1db083ba958e4da2a212dd044c52d001511a Mon Sep 17 00:00:00 2001 From: dcn Date: Tue, 29 Jul 2008 06:32:54 -0500 Subject: session.h (struct systemtap_session): Added itrace_derived_probe group. elaborate.cxx (systemtap_session::systemtap_session): Added initialization of itrace_derived_probes. tapsets.cxx (struct itrace_derived_probe): Add derived_probe struct for holding info needed by itrace probes. (struct itrace_derived_probe_group): New derived_probe_group to handle itrace probes. (itrace_derived_probe::itrace_derived_probe): Needed for use with task_finder. (itrace_derived_probe_group::join_group): Ditto. (itrace_derived_probe_group::enroll): Ditto. (itrace_derived_probe_group::emit_probe_decl): Ditto. (itrace_derived_probe_group::emit_module_decls): Ditto. (itrace_derived_probe_group::emit_module_init): Ditto. (itrace_derived_probe_group::emit_module_exit): Ditto. stapprobes.5.in : Added documentation of itrace probe. --- testsuite/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 14243b80..b69a8dfa 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-07-24 Dave Nomura + + * systemtap.base/itrace.stp: Added simple tests of itrace probe. + 2008-07-14 Dave Brolley * Makefile.am (TOOL_OPTS): New variable. -- cgit From 0e47827d5f461ceb0e67540adba7bc2fe3a360da Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Tue, 29 Jul 2008 13:40:08 -0400 Subject: Ensure that a systemtap server is available if 'server' is specified in EXTRA_TOOL_OPTS for 'make check' and 'make installcheck' --- testsuite/ChangeLog | 11 +++++++++++ testsuite/Makefile.am | 2 +- testsuite/Makefile.in | 2 +- testsuite/lib/stap_compile.exp | 2 +- testsuite/lib/stap_run.exp | 2 +- testsuite/lib/stap_run2.exp | 2 +- testsuite/lib/stap_run_binary.exp | 2 +- testsuite/lib/stap_run_exact.exp | 2 +- testsuite/lib/systemtap.exp | 9 --------- 9 files changed, 18 insertions(+), 16 deletions(-) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 14243b80..4d3cab7c 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2008-07-29 Dave Brolley + + * Makefile.am (SYSTEMTAP_PATH): Add $(EXTRA_SYSTEMTAP_PATH). + * lib/stap_compile.exp: Revert previous change. + * lib/stap_run.exp: Likewise. + * lib/stap_run2.exp: Likewise. + * lib/stap_run_binary.exp: Likewise. + * lib/stap_run_exact.exp: Likewise. + * lib/systemtap.exp (stap_exec): Removed. + * Makefile.in: Regenerated. + 2008-07-14 Dave Brolley * Makefile.am (TOOL_OPTS): New variable. diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 5f3044cd..03c70cb6 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -40,7 +40,7 @@ SYSTEMTAP_RUNTIME=$(DESTDIR)$(pkgdatadir)/runtime SYSTEMTAP_TAPSET=$(DESTDIR)$(pkgdatadir)/tapset LD_LIBRARY_PATH=$(DESTDIR)$(libdir)/systemtap CRASH_LIBDIR=$(DESTDIR)$(libdir)/systemtap -SYSTEMTAP_PATH=$(DESTDIR)$(bindir) +SYSTEMTAP_PATH=$(EXTRA_SYSTEMTAP_PATH):$(DESTDIR)$(bindir) RUNTESTDEFAULTFLAGS = --tool $$tool --tool_opts \'$(TOOL_OPTS)\' --srcdir $$srcdir EXPECT = expect diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in index 8fe7a21f..cc23aed4 100644 --- a/testsuite/Makefile.in +++ b/testsuite/Makefile.in @@ -149,7 +149,7 @@ SYSTEMTAP_RUNTIME = $(DESTDIR)$(pkgdatadir)/runtime SYSTEMTAP_TAPSET = $(DESTDIR)$(pkgdatadir)/tapset LD_LIBRARY_PATH = $(DESTDIR)$(libdir)/systemtap CRASH_LIBDIR = $(DESTDIR)$(libdir)/systemtap -SYSTEMTAP_PATH = $(DESTDIR)$(bindir) +SYSTEMTAP_PATH = $(EXTRA_SYSTEMTAP_PATH):$(DESTDIR)$(bindir) RUNTESTDEFAULTFLAGS = --tool $$tool --tool_opts \'$(TOOL_OPTS)\' --srcdir $$srcdir EXPECT = expect RUNTEST = "env SYSTEMTAP_RUNTIME=$(SYSTEMTAP_RUNTIME) SYSTEMTAP_TAPSET=$(SYSTEMTAP_TAPSET) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) CRASH_LIBDIR=$(CRASH_LIBDIR) PATH=$(SYSTEMTAP_PATH):$$PATH $(srcdir)/execrc runtest" diff --git a/testsuite/lib/stap_compile.exp b/testsuite/lib/stap_compile.exp index 8f82018f..35124a44 100644 --- a/testsuite/lib/stap_compile.exp +++ b/testsuite/lib/stap_compile.exp @@ -4,7 +4,7 @@ # - script is the script to compile # Additional arguments are passed to stap as-is. proc stap_compile { TEST_NAME compile script args } { - set cmd [concat [stap_exec] {-v -p4 -e} $script $args] + set cmd [concat stap {-v -p4 -e} $script $args] verbose -log "running $cmd" eval spawn $cmd diff --git a/testsuite/lib/stap_run.exp b/testsuite/lib/stap_run.exp index 5f67d773..c0027e95 100644 --- a/testsuite/lib/stap_run.exp +++ b/testsuite/lib/stap_run.exp @@ -26,7 +26,7 @@ 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_exec] -v $args] + set cmd [concat stap -v $args] if [file readable $test_file_name] { lappend cmd $test_file_name } diff --git a/testsuite/lib/stap_run2.exp b/testsuite/lib/stap_run2.exp index 1d9dc0b3..9849aefb 100644 --- a/testsuite/lib/stap_run2.exp +++ b/testsuite/lib/stap_run2.exp @@ -15,7 +15,7 @@ proc stap_run2 { TEST_NAME args } { if {[info procs installtest_p] != "" && ![installtest_p]} { untested $TEST_NAME; return } - set cmd [concat [stap_exec] $args $test_file_name] + set cmd [concat stap $args $test_file_name] catch {eval exec $cmd} res set n 0 diff --git a/testsuite/lib/stap_run_binary.exp b/testsuite/lib/stap_run_binary.exp index a5e1195a..1d31d817 100644 --- a/testsuite/lib/stap_run_binary.exp +++ b/testsuite/lib/stap_run_binary.exp @@ -13,7 +13,7 @@ proc stap_run_binary { 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_exec] $test_file_name | hexdump $hex_args] + set res [exec stap $test_file_name | hexdump $hex_args] if {[string compare $res $::result_string] == 0} { pass "$TEST_NAME" diff --git a/testsuite/lib/stap_run_exact.exp b/testsuite/lib/stap_run_exact.exp index 23c22ec0..6a473798 100644 --- a/testsuite/lib/stap_run_exact.exp +++ b/testsuite/lib/stap_run_exact.exp @@ -12,7 +12,7 @@ proc stap_run_exact { TEST_NAME test_file_name args } { if {[info procs installtest_p] != "" && ![installtest_p]} { untested $TEST_NAME; return } - set cmd [concat [stap_exec] $args $test_file_name] + set cmd [concat stap $args $test_file_name] catch {eval exec $cmd} res set n 0 diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index e74bd13c..db5c1587 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -16,15 +16,6 @@ proc use_server_p {} { } -proc stap_exec {} { - if {[info procs use_server_p] != "" && [use_server_p]} then { - return "stap-client" - } else { - return "stap" - } -} - - proc print_systemtap_version {} { set version [exec /bin/uname -r] set location "/boot/vmlinux-$version" -- cgit From b4b53623632241970e1f3553e09332cdc5c754a0 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 1 Aug 2008 15:52:44 -0400 Subject: Run both tests for installcheck tests. --- testsuite/systemtap.examples/ChangeLog | 4 ++++ testsuite/systemtap.examples/check.exp | 44 ++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 21 deletions(-) (limited to 'testsuite') diff --git a/testsuite/systemtap.examples/ChangeLog b/testsuite/systemtap.examples/ChangeLog index d75ad014..5d123cb7 100644 --- a/testsuite/systemtap.examples/ChangeLog +++ b/testsuite/systemtap.examples/ChangeLog @@ -1,3 +1,7 @@ +2008-08-01 William Cohen + + * check.exp: Run both tests for installcheck tests. + 2008-07-11 Mark Wielaard * traceio.meta: s/decending/descending/ in description. diff --git a/testsuite/systemtap.examples/check.exp b/testsuite/systemtap.examples/check.exp index 2ac43050..14d9a57e 100644 --- a/testsuite/systemtap.examples/check.exp +++ b/testsuite/systemtap.examples/check.exp @@ -32,6 +32,23 @@ proc extract_tag { META_DATA TAG } { return $value } +proc run_command { test command } { + #FIXME tcl says that single quotes not dealt with + if { $command != "" } then { + verbose -log "attempting command $command" + set res [catch {eval exec $command} value] + verbose -log "OUT $value" + verbose -log "RC $res" + if {$res != 0 } { + fail $test + } else { + pass $test + } + } else { + untested $test + } +} + set curdir [pwd] set src_examples $srcdir/systemtap.examples @@ -39,36 +56,21 @@ set meta_files [lsort [exec find $src_examples -path "*.meta"]] foreach file $meta_files { set dir [file dirname $file] set test [regsub {.*/testsuite/} $file ""] + set test [regsub {.meta} $test ""] cd $dir set meta_data [get_meta_data $file] set test_check [extract_tag "$meta_data" "test_check"] + set command $test_check + run_command "$test build" $command set test_installcheck [extract_tag "$meta_data" "test_installcheck"] - # Would like to run the tests (-p5), but pass fail logic too - # simple and fails for many examples - # FIXME following line prevents installcheck with "--tools_opts install" - set test_installcheck "" + # The pass/fail logic too simple and fails for some examples + # FIXME would like to be able to run more complicated test code if {[info procs installtest_p] != "" && [installtest_p] && $test_installcheck != "" } then { set command $test_installcheck - } else { - set command $test_check - } - - #FIXME tcl says that single quotes not dealt with - if { $command != "" } then { - verbose -log "attempting command $command" - set res [catch {eval exec $command} value] - verbose -log "OUT $value" - verbose -log "RC $res" - if {$res != 0 } { - fail $test - } else { - pass $test - } - } else { - untested $test + run_command "$test run" $command } } -- cgit From f118f0abe96f2668b1969f4691dfaed36e2a8917 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 1 Aug 2008 15:58:09 -0400 Subject: Tweak test_installcheck for helloworld.meta and traceio2.meta. --- testsuite/systemtap.examples/ChangeLog | 4 ++++ testsuite/systemtap.examples/helloworld.meta | 2 +- testsuite/systemtap.examples/traceio2.meta | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'testsuite') diff --git a/testsuite/systemtap.examples/ChangeLog b/testsuite/systemtap.examples/ChangeLog index 5d123cb7..7cb39fb9 100644 --- a/testsuite/systemtap.examples/ChangeLog +++ b/testsuite/systemtap.examples/ChangeLog @@ -1,3 +1,7 @@ +2008-08-01 William Cohen + + * helloworld.meta, traceio2.meta: Tweak test_installcheck. + 2008-08-01 William Cohen * check.exp: Run both tests for installcheck tests. diff --git a/testsuite/systemtap.examples/helloworld.meta b/testsuite/systemtap.examples/helloworld.meta index f56b7ca3..60bc53f2 100644 --- a/testsuite/systemtap.examples/helloworld.meta +++ b/testsuite/systemtap.examples/helloworld.meta @@ -10,4 +10,4 @@ output: text scope: system-wide description: A basic "Hello World" program implemented in SystemTap script. It prints out "hello world" message and then immediately exits. test_check: stap -p4 helloworld.stp -test_installcheck: stap helloworld.stp -c "sleep 1" +test_installcheck: stap helloworld.stp diff --git a/testsuite/systemtap.examples/traceio2.meta b/testsuite/systemtap.examples/traceio2.meta index e6bca1a9..4b63108c 100644 --- a/testsuite/systemtap.examples/traceio2.meta +++ b/testsuite/systemtap.examples/traceio2.meta @@ -10,4 +10,4 @@ output: trace scope: system-wide description: Print out the executable name and process number as reads and writes to the specified device occur. test_check: stap -p4 traceio2.stp 0x0801 -test_installcheck: /bin/sh eval stap traceio2.stp 0x0801 -c "sleep 1" +test_installcheck: stap traceio2.stp 0x0801 -c "sleep 1" -- cgit From 3611665d5350e471975c16b756ba5d414a661392 Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Sun, 3 Aug 2008 21:07:10 -0400 Subject: Correct several tests for 2.6.27 --- testsuite/ChangeLog | 6 ++++++ testsuite/buildok/seven.stp | 2 ++ testsuite/buildok/seventeen.stp | 4 ++++ 3 files changed, 12 insertions(+) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index af44d6c8..67d741e5 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,9 @@ + +2008-08-03 Wenji Huang + + * buildok/seven.stp: Correct for 2.6.27. + * buildok/seventeen.stp: Ditto. + 2008-07-29 Dave Brolley * Makefile.am (SYSTEMTAP_PATH): Add $(EXTRA_SYSTEMTAP_PATH). diff --git a/testsuite/buildok/seven.stp b/testsuite/buildok/seven.stp index d6f6e5a9..dc3bc786 100755 --- a/testsuite/buildok/seven.stp +++ b/testsuite/buildok/seven.stp @@ -6,6 +6,7 @@ # first: enums and ints +%( kernel_v <= "2.6.26" %? probe kernel.function("find_pid") { %( kernel_v >= "2.6.17" %? @@ -15,6 +16,7 @@ probe kernel.function("find_pid") . sprint($nr) . ")") %) } +%) # second: opaque pointers and enums diff --git a/testsuite/buildok/seventeen.stp b/testsuite/buildok/seventeen.stp index 9adffa48..e4a7a8e8 100755 --- a/testsuite/buildok/seventeen.stp +++ b/testsuite/buildok/seventeen.stp @@ -5,5 +5,9 @@ probe kernel.function("pipe_write") { +%( kernel_v > "2.6.26" %? + printf("0x%x\n", $write_pipefifo_fops->llseek) +%: printf("0x%x\n", $write_fifo_fops->llseek) +%) } -- cgit From a93f0b31fe6c8961aef9da22ce2cf41d8fd52240 Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Tue, 5 Aug 2008 12:31:21 -0400 Subject: Add test for $$vars, $$params, $$locals. --- testsuite/ChangeLog | 3 +++ testsuite/systemtap.base/vars.exp | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 testsuite/systemtap.base/vars.exp (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 67d741e5..fcbd7254 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,6 @@ +2008-08-05 Stan Cox + + * systemtap.base/vars.exp: New test. 2008-08-03 Wenji Huang diff --git a/testsuite/systemtap.base/vars.exp b/testsuite/systemtap.base/vars.exp new file mode 100644 index 00000000..7541c01b --- /dev/null +++ b/testsuite/systemtap.base/vars.exp @@ -0,0 +1,32 @@ +# Script for testing $$vars, $$parms, $$locals + +set test "vars" + +# grab C statement that $$vars yields +set cmd [concat stap -p3 -e {"probe kernel.statement(\"bio_copy_user@fs/bio.c+1\") \{print (\$\$vars)\}"} 2>&1 | grep {"printf.*="} | sed -e {"s/^.*MAXSTRINGLEN, \"//"} -e {s/..\".*$//}] +catch {eval exec $cmd} vars + +# grab C statement that $$parms yields +set cmd [regsub "vars" $cmd "parms"] +catch {eval exec $cmd} parms + +# grab C statement that $$locals yields +set cmd [regsub "parms" $cmd "locals"] +catch {eval exec $cmd} locals + +# syntax check of $$vars C statement +set vars_ok [regexp "(\[a-z_\]+=%#llx *)+" $vars] +if {!$vars_ok} { + fail "$test" +} else { + pass "$test" +} + +# $$vars should be equivalent to $$parms + $$locals +if {![string equal [string trim $vars] \ + [string trim [concat $parms " " $locals]]]} { + fail "$test parms/locals" +} else { + pass "$test parms/locals" +} + -- cgit From 0317fad416059781b7a152296c1d8b5a012bf925 Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Tue, 5 Aug 2008 14:37:03 -0400 Subject: Use relative instead of absolute line. (bug 6611) --- testsuite/ChangeLog | 1 + testsuite/systemtap.base/warnings.stp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index fcbd7254..9dd388ad 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,5 +1,6 @@ 2008-08-05 Stan Cox + * systemtap.base/warnings.stp: Use relative instead of absolute line. * systemtap.base/vars.exp: New test. 2008-08-03 Wenji Huang diff --git a/testsuite/systemtap.base/warnings.stp b/testsuite/systemtap.base/warnings.stp index 94ed57b3..d71b3034 100644 --- a/testsuite/systemtap.base/warnings.stp +++ b/testsuite/systemtap.base/warnings.stp @@ -9,7 +9,7 @@ probe never { print(elide+me1) bar () } # PR 6611 -probe probea = kernel.statement("bio_init@fs/bio.c:135") +probe probea = kernel.statement("bio_init@fs/bio.c+3") { printf("%d", funca(2)); elide_me6="foo" } probe probea { printf("%d", funcb(2,3)); printf("%s",var) } -- cgit