From 8c94efa76616a6460d793c8de43d6a491a93fa16 Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 26 Sep 2012 14:31:31 -0500 Subject: [PATCH] (PR14574 partial fix) Make the systemtap.pass1-4/*.exp tests use dyninst also. * testsuite/lib/systemtap.exp (print_systemtap_version): New function. (get_runtime_list): Ditto. (setup_systemtap_environment): Remember whether we've got dyninst support. (stap_run_batch): Allow passing args and the filename. * testsuite/systemtap.pass1-4/buildok-dyninst.exp: New test. * testsuite/systemtap.pass1-4/buildko.exp: Add dyninst support. * testsuite/systemtap.pass1-4/parseko.exp: Ditto. * testsuite/systemtap.pass1-4/parseok.exp: Ditto. * testsuite/systemtap.pass1-4/semko.exp: Ditto. * testsuite/systemtap.pass1-4/semok.exp: Ditto. * testsuite/systemtap.pass1-4/transko.exp: Ditto. * testsuite/systemtap.pass1-4/transok.exp: Ditto. * testsuite/buildok/cmdline01.stp: Allow extra args to be passed in. * testsuite/buildok/fortytwo.stp: Ditto. * testsuite/buildok/oldlocals01.stp: Ditto. * testsuite/buildok/scsi-detailed.stp: Ditto. * testsuite/buildok/thirtythree.stp: Ditto. * testsuite/buildok/thirtytwo.stp: Ditto. * testsuite/parseko/bad_tapset.stp: Ditto. * testsuite/parseko/cmdline02.stp: Ditto. * testsuite/parseko/cmdline03.stp: Ditto. * testsuite/parseko/cmdline04.stp: Ditto. * testsuite/parseko/cmdline06.stp: Ditto. * testsuite/parseko/cmdline07.stp: Ditto. * testsuite/parseko/cmdline08.stp: Ditto. * testsuite/parseko/cmdline15.stp: Ditto. * testsuite/parseko/cmdline22.stp: Ditto. * testsuite/parseko/deprecated01.stp: Ditto. * testsuite/parseko/preprocess13.stp: Ditto. * testsuite/parseko/preprocess16.stp: Ditto. * testsuite/parseko/preprocess17.stp: Ditto. * testsuite/parseko/twentyseven.stp: Ditto. * testsuite/parseko/twentythree.stp: Ditto. * testsuite/parseok/all_tapsets.stp: Ditto. * testsuite/parseok/bad_tapset.stp: Ditto. * testsuite/parseok/cmdline01.stp: Ditto. * testsuite/parseok/cmdline02.stp: Ditto. * testsuite/parseok/deprecated01.stp: Ditto. * testsuite/parseok/fourteen.stp: Ditto. * testsuite/parseok/macros05.stp: Ditto. * testsuite/parseok/macros08.stp: Ditto. * testsuite/parseok/nineteen.stp: Ditto. * testsuite/parseok/semko.stp: Ditto. * testsuite/parseok/unparser.stp: Ditto. * testsuite/semko/fifty.stp: Ditto. * testsuite/semko/nodwf01.stp: Ditto. * testsuite/semko/nodwf02.stp: Ditto. * testsuite/semko/nodwf03.stp: Ditto. * testsuite/semko/nodwf04.stp: Ditto. * testsuite/semko/nodwf05.stp: Ditto. * testsuite/semko/nodwf06.stp: Ditto. * testsuite/semko/nodwf07.stp: Ditto. * testsuite/semko/nodwf08.stp: Ditto. * testsuite/semko/nodwf09.stp: Ditto. * testsuite/semko/plt2.stp: Ditto. * testsuite/semko/target_lvalue.stp: Ditto. * testsuite/semok/args.stp: Ditto. * testsuite/semok/badvar.stp: Ditto. * testsuite/semok/badvar_undefined.stp: Ditto. * testsuite/semok/bz11911.stp: Ditto. * testsuite/semok/defined_list_vars.stp: Ditto. * testsuite/semok/eight.stp: Ditto. * testsuite/semok/nine.stp: Ditto. * testsuite/semok/nodwf01.stp: Ditto. * testsuite/semok/nodwf02.stp: Ditto. * testsuite/semok/nodwf03.stp: Ditto. * testsuite/semok/nodwf04.stp: Ditto. * testsuite/semok/nodwf05.stp: Ditto. * testsuite/semok/nodwf06.stp: Ditto. * testsuite/semok/nodwf07.stp: Ditto. * testsuite/semok/plt2.stp: Ditto. * testsuite/semok/pr11808.stp: Ditto. * testsuite/semok/pr11809.stp: Ditto. * testsuite/semok/syscall_return.stp: Ditto. * testsuite/semok/transko.stp: Ditto. * testsuite/semok/twenty.stp: Ditto. * testsuite/semok/twentyfive.stp: Ditto. * testsuite/transok/buildko.stp: Ditto. * testsuite/transok/eleven.stp: Ditto. --- testsuite/buildok/cmdline01.stp | 2 +- testsuite/buildok/fortytwo.stp | 4 +- testsuite/buildok/oldlocals01.stp | 4 +- testsuite/buildok/scsi-detailed.stp | 2 +- testsuite/buildok/thirtythree.stp | 2 +- testsuite/buildok/thirtytwo.stp | 2 +- testsuite/lib/systemtap.exp | 41 +++- testsuite/parseko/bad_tapset.stp | 2 +- testsuite/parseko/cmdline02.stp | 2 +- testsuite/parseko/cmdline03.stp | 2 +- testsuite/parseko/cmdline04.stp | 2 +- testsuite/parseko/cmdline06.stp | 2 +- testsuite/parseko/cmdline07.stp | 2 +- testsuite/parseko/cmdline08.stp | 2 +- testsuite/parseko/cmdline15.stp | 2 +- testsuite/parseko/cmdline22.stp | 2 +- testsuite/parseko/deprecated01.stp | 2 +- testsuite/parseko/preprocess13.stp | 2 +- testsuite/parseko/preprocess16.stp | 2 +- testsuite/parseko/preprocess17.stp | 2 +- testsuite/parseko/twentyseven.stp | 2 +- testsuite/parseko/twentythree.stp | 2 +- testsuite/parseok/all_tapsets.stp | 2 +- testsuite/parseok/bad_tapset.stp | 2 +- testsuite/parseok/cmdline01.stp | 4 +- testsuite/parseok/cmdline02.stp | 2 +- testsuite/parseok/deprecated01.stp | 2 +- testsuite/parseok/fourteen.stp | 2 +- testsuite/parseok/macros05.stp | 2 +- testsuite/parseok/macros08.stp | 2 +- testsuite/parseok/nineteen.stp | 2 +- testsuite/parseok/semko.stp | 2 +- testsuite/parseok/unparser.stp | 2 +- testsuite/semko/fifty.stp | 2 +- testsuite/semko/nodwf01.stp | 2 +- testsuite/semko/nodwf02.stp | 2 +- testsuite/semko/nodwf03.stp | 2 +- testsuite/semko/nodwf04.stp | 2 +- testsuite/semko/nodwf05.stp | 2 +- testsuite/semko/nodwf06.stp | 2 +- testsuite/semko/nodwf07.stp | 2 +- testsuite/semko/nodwf08.stp | 2 +- testsuite/semko/nodwf09.stp | 2 +- testsuite/semko/plt2.stp | 2 +- testsuite/semko/target_lvalue.stp | 8 +- testsuite/semok/args.stp | 2 +- testsuite/semok/badvar.stp | 2 +- testsuite/semok/badvar_undefined.stp | 2 +- testsuite/semok/bz11911.stp | 2 +- testsuite/semok/defined_list_vars.stp | 2 +- testsuite/semok/eight.stp | 2 +- testsuite/semok/nine.stp | 2 +- testsuite/semok/nodwf01.stp | 2 +- testsuite/semok/nodwf02.stp | 2 +- testsuite/semok/nodwf03.stp | 2 +- testsuite/semok/nodwf04.stp | 2 +- testsuite/semok/nodwf05.stp | 2 +- testsuite/semok/nodwf06.stp | 2 +- testsuite/semok/nodwf07.stp | 2 +- testsuite/semok/plt2.stp | 2 +- testsuite/semok/pr11808.stp | 2 +- testsuite/semok/pr11809.stp | 2 +- testsuite/semok/syscall_return.stp | 2 +- testsuite/semok/transko.stp | 2 +- testsuite/semok/twenty.stp | 2 +- testsuite/semok/twentyfive.stp | 8 +- testsuite/systemtap.pass1-4/buildko.exp | 28 ++- .../systemtap.pass1-4/buildok-dyninst.exp | 186 ++++++++++++++++++ testsuite/systemtap.pass1-4/parseko.exp | 28 ++- testsuite/systemtap.pass1-4/parseok.exp | 36 +++- testsuite/systemtap.pass1-4/semko.exp | 40 ++-- testsuite/systemtap.pass1-4/semok.exp | 94 ++++++--- testsuite/systemtap.pass1-4/transko.exp | 28 ++- testsuite/systemtap.pass1-4/transok.exp | 18 +- testsuite/transok/buildko.stp | 4 +- testsuite/transok/eleven.stp | 2 +- 76 files changed, 489 insertions(+), 164 deletions(-) create mode 100644 testsuite/systemtap.pass1-4/buildok-dyninst.exp diff --git a/testsuite/buildok/cmdline01.stp b/testsuite/buildok/cmdline01.stp index 67372defd..14e2afd1f 100755 --- a/testsuite/buildok/cmdline01.stp +++ b/testsuite/buildok/cmdline01.stp @@ -9,7 +9,7 @@ # Test '-g' and '-D'. The code below will give an error at # compilation stage unless 'FOO' is defined. -stap -g -p4 -DFOO=1 - <&1 >/dev/null ||true ` + errors=`stap $@ -u -p4 -e 'probe kernel.statement("'$fn':'$ilineno'") {$'$var'}' 2>&1 >/dev/null ||true ` if echo "$errors" | grep -q unable.to.find.local then echo "Unexpected error $errors"; exit 1 diff --git a/testsuite/buildok/oldlocals01.stp b/testsuite/buildok/oldlocals01.stp index 2b0fee17c..76ea99438 100755 --- a/testsuite/buildok/oldlocals01.stp +++ b/testsuite/buildok/oldlocals01.stp @@ -1,10 +1,10 @@ #! /bin/sh -stap -g -p4 --compatible=1.7.9 -e ' +stap $@ -g -p4 --compatible=1.7.9 -e ' # test accessing locals using THIS->foo in legacy mode function baz:long(foo:long, bar:string) %{ - printk("%s\n", THIS->bar); + _stp_printf("%s\n", THIS->bar); THIS->__retvalue = 600 + THIS->foo; %} diff --git a/testsuite/buildok/scsi-detailed.stp b/testsuite/buildok/scsi-detailed.stp index 9c53c1728..64530e62a 100755 --- a/testsuite/buildok/scsi-detailed.stp +++ b/testsuite/buildok/scsi-detailed.stp @@ -12,7 +12,7 @@ if ! grep scsi_dispatch_cmd /proc/kallsyms >/dev/null 2>&1 ; then fi -stap -p4 - << EOF +stap $@ -p4 - << EOF probe scsi.ioentry { printf("%20s, disk_major=%d, disk_minor=%d, device_state=%s, req_addr=%p\n", diff --git a/testsuite/buildok/thirtythree.stp b/testsuite/buildok/thirtythree.stp index cd704bdf6..5cbb41504 100755 --- a/testsuite/buildok/thirtythree.stp +++ b/testsuite/buildok/thirtythree.stp @@ -1,5 +1,5 @@ #! /bin/sh -stap --ldd -vvv -p4 -e 'probe begin {}' -t -d /bin/ls +stap $@ --ldd -vvv -p4 -e 'probe begin {}' -t -d /bin/ls diff --git a/testsuite/buildok/thirtytwo.stp b/testsuite/buildok/thirtytwo.stp index d97aa50bc..aaaa45db2 100755 --- a/testsuite/buildok/thirtytwo.stp +++ b/testsuite/buildok/thirtytwo.stp @@ -1,6 +1,6 @@ #! /bin/sh -stap -t -p4 -DKRETACTIVE=8888 -e ' +stap $@ -t -p4 -DKRETACTIVE=8888 -e ' probe kprobe.function("sys_open").return {} probe kprobe.function("sys_open").return.maxactive(100) {} probe kernel.function("sys_open").return {} diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index 15c9c6c7f..7d5060afe 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -61,6 +61,29 @@ proc uprobes_p {} { } +proc dyninst_p {} { + global env + + # Was this version of systemtap compiled with dyninst support? + # (Use the cached value from setup_systemtap_environment().) + if {[info exists env(SYSTEMTAP_DYNINST)] && $env(SYSTEMTAP_DYNINST) == 1} { + return 1 + } + return 0 +} + + +proc get_runtime_list {} { + # Always return the default runtime. + set runtime_list [list ""] + + if {[dyninst_p]} { + lappend runtime_list "dyninst" + } + return $runtime_list +} + + proc print_systemtap_version {} { set version [exec /bin/uname -r] set location "/boot/vmlinux-$version" @@ -132,6 +155,10 @@ proc setup_systemtap_environment {} { } } + # Remember if this version of systemtap compiled with dyninst support + if {! [catch {exec sh -c "stap -V 2>&1 | grep -q DYNINST"} dummy]} { + set env(SYSTEMTAP_DYNINST) 1 + } return 1 } @@ -371,8 +398,8 @@ proc cleanup {} { } -proc stap_run_batch {args} { - verbose -log "starting $args" +proc stap_run_batch {filename args} { + verbose -log "starting $filename $args" # Many of our test cases use "#! stap ...". Since these lack # /full/paths, they are not really executable. (We can't have @@ -383,15 +410,15 @@ proc stap_run_batch {args} { # stap manually here (relying on $PATH). Otherwise, we presume # the file properly executable. - set file [open [lindex $args 0] r] + set file [open $filename r] set firstbits [gets $file] close $file if [regexp -line {\#! stap (.*)} $firstbits -> stap_args] { - verbose -log "spawn1 stap $stap_args [lindex $args 0]" - spawn stap $stap_args [lindex $args 0] + verbose -log "spawn1 stap $stap_args $filename $args" + spawn stap $stap_args $filename $args } else { - verbose -log "spawn2 $args" - spawn $args + verbose -log "spawn2 $filename $args" + spawn $filename $args } expect { diff --git a/testsuite/parseko/bad_tapset.stp b/testsuite/parseko/bad_tapset.stp index bd15577f0..6e1bc0653 100755 --- a/testsuite/parseko/bad_tapset.stp +++ b/testsuite/parseko/bad_tapset.stp @@ -3,4 +3,4 @@ # PR11405: with -W, bad tapsets should still be an error TAPSET=`dirname $0`/bad_tapset/ -stap -p1 -e 'probe begin {}' -I $TAPSET -W +stap $@ -p1 -e 'probe begin {}' -I $TAPSET -W diff --git a/testsuite/parseko/cmdline02.stp b/testsuite/parseko/cmdline02.stp index feca762bd..36a51a929 100755 --- a/testsuite/parseko/cmdline02.stp +++ b/testsuite/parseko/cmdline02.stp @@ -5,4 +5,4 @@ # # NUM must be between 1 and 64 -stap -p1 -s 0 -e 'probe begin { exit() }' +stap $@ -p1 -s 0 -e 'probe begin { exit() }' diff --git a/testsuite/parseko/cmdline03.stp b/testsuite/parseko/cmdline03.stp index 9b4b2553d..c42fc519d 100755 --- a/testsuite/parseko/cmdline03.stp +++ b/testsuite/parseko/cmdline03.stp @@ -5,4 +5,4 @@ # # NUM must be between 1 and 5 -stap -p0 -e 'probe begin { exit() }' +stap $@ -p0 -e 'probe begin { exit() }' diff --git a/testsuite/parseko/cmdline04.stp b/testsuite/parseko/cmdline04.stp index d58cd70df..e2b590a24 100755 --- a/testsuite/parseko/cmdline04.stp +++ b/testsuite/parseko/cmdline04.stp @@ -2,4 +2,4 @@ # multiple '-e' (script) options cannot be specified -stap -p1 -e 'probe begin { exit() }' -e 'probe end { exit() }' +stap $@ -p1 -e 'probe begin { exit() }' -e 'probe end { exit() }' diff --git a/testsuite/parseko/cmdline06.stp b/testsuite/parseko/cmdline06.stp index 6bb310f8b..0b47c7adf 100755 --- a/testsuite/parseko/cmdline06.stp +++ b/testsuite/parseko/cmdline06.stp @@ -2,4 +2,4 @@ # Bad TMPDIR environment variable should cause exit -TMPDIR=/dev/null/BADTMPDIR stap -p1 -e 'probe begin { exit() }' +TMPDIR=/dev/null/BADTMPDIR stap $@ -p1 -e 'probe begin { exit() }' diff --git a/testsuite/parseko/cmdline07.stp b/testsuite/parseko/cmdline07.stp index aee03a914..f359e20a5 100755 --- a/testsuite/parseko/cmdline07.stp +++ b/testsuite/parseko/cmdline07.stp @@ -3,4 +3,4 @@ # A module name must be specified when using '-m' - the module name # can't be empty -stap -p1 -m "" -e 'probe begin { exit() }' +stap $@ -p1 -m "" -e 'probe begin { exit() }' diff --git a/testsuite/parseko/cmdline08.stp b/testsuite/parseko/cmdline08.stp index 19730b808..fa7a97727 100755 --- a/testsuite/parseko/cmdline08.stp +++ b/testsuite/parseko/cmdline08.stp @@ -1,4 +1,4 @@ #!/bin/sh # A module name can only be composed of chars [_a-zA-Z0-9] -stap -p1 -m x^y -e 'probe begin { exit() }' +stap $@ -p1 -m x^y -e 'probe begin { exit() }' diff --git a/testsuite/parseko/cmdline15.stp b/testsuite/parseko/cmdline15.stp index c02f97ae9..f17cdfaaa 100755 --- a/testsuite/parseko/cmdline15.stp +++ b/testsuite/parseko/cmdline15.stp @@ -4,4 +4,4 @@ # # -c CMD start the probes, run CMD, and exit when it finishes # -x PID sets target() to PID -stap -p1 -c /bin/ls -x 100 -e 'probe begin { exit() }' +stap $@ -p1 -c /bin/ls -x 100 -e 'probe begin { exit() }' diff --git a/testsuite/parseko/cmdline22.stp b/testsuite/parseko/cmdline22.stp index d71ebebed..bc742b61b 100755 --- a/testsuite/parseko/cmdline22.stp +++ b/testsuite/parseko/cmdline22.stp @@ -8,7 +8,7 @@ export TMPDIR mkdir "$TMPDIR" || exit 0 # "success" signals a problem for parseko -stap -p1 -e 'probe begin { exit() }' +stap $@ -p1 -e 'probe begin { exit() }' RC=$? rmdir "$TMPDIR" || exit 0 diff --git a/testsuite/parseko/deprecated01.stp b/testsuite/parseko/deprecated01.stp index 197492e87..da79c61cf 100755 --- a/testsuite/parseko/deprecated01.stp +++ b/testsuite/parseko/deprecated01.stp @@ -2,4 +2,4 @@ # We shouldn't be able to parse a deprecated function -stap --check-version --compatible=1.4 -W -p2 -e 'probe nd_syscall.accept { println(flag_str++) }' +stap $@ --check-version --compatible=1.4 -W -p2 -e 'probe nd_syscall.accept { println(flag_str++) }' diff --git a/testsuite/parseko/preprocess13.stp b/testsuite/parseko/preprocess13.stp index 9ef34f59c..9879fad24 100755 --- a/testsuite/parseko/preprocess13.stp +++ b/testsuite/parseko/preprocess13.stp @@ -1,4 +1,4 @@ #! /bin/sh # recursive -stap -p1 -e '$1' '$1' +stap $@ -p1 -e '$1' '$1' diff --git a/testsuite/parseko/preprocess16.stp b/testsuite/parseko/preprocess16.stp index 364bad6fa..c92f70d3c 100755 --- a/testsuite/parseko/preprocess16.stp +++ b/testsuite/parseko/preprocess16.stp @@ -1,4 +1,4 @@ #! /bin/sh # recursive after the first token (PR11195) -stap -p1 -e 'probe begin {$1}' 'x $1' +stap $@ -p1 -e 'probe begin {$1}' 'x $1' diff --git a/testsuite/parseko/preprocess17.stp b/testsuite/parseko/preprocess17.stp index b447776d9..62034483f 100755 --- a/testsuite/parseko/preprocess17.stp +++ b/testsuite/parseko/preprocess17.stp @@ -1,3 +1,3 @@ #! /bin/sh -stap --compatible=1.0 -p1 -e 'global %( systemtap_v >= "1.2" %? PASS %: "FAIL" %)' +stap $@ --compatible=1.0 -p1 -e 'global %( systemtap_v >= "1.2" %? PASS %: "FAIL" %)' diff --git a/testsuite/parseko/twentyseven.stp b/testsuite/parseko/twentyseven.stp index 631879b50..8b9adf321 100755 --- a/testsuite/parseko/twentyseven.stp +++ b/testsuite/parseko/twentyseven.stp @@ -1,4 +1,4 @@ #! /bin/sh # PR 14360 supersedes PR 11208, except with --compatible < 2.0 -stap -p2 --compatible=1.8 -e 'probe kernel.function ("sys_" /* this comment no longer prevents string gluing */ "open") {}' +stap $@ -p2 --compatible=1.8 -e 'probe kernel.function ("sys_" /* this comment no longer prevents string gluing */ "open") {}' diff --git a/testsuite/parseko/twentythree.stp b/testsuite/parseko/twentythree.stp index 3390a6073..a6e7e4db0 100755 --- a/testsuite/parseko/twentythree.stp +++ b/testsuite/parseko/twentythree.stp @@ -1,3 +1,3 @@ #! /bin/sh -stap -p1 $SYSTEMTAP_TAPSET/indent.stp +stap $@ -p1 $SYSTEMTAP_TAPSET/indent.stp diff --git a/testsuite/parseok/all_tapsets.stp b/testsuite/parseok/all_tapsets.stp index 1777cc109..990ae8e3a 100755 --- a/testsuite/parseok/all_tapsets.stp +++ b/testsuite/parseok/all_tapsets.stp @@ -2,4 +2,4 @@ # PR11405: all the default tapsets should succeed even with -W -stap -p1 -e 'probe begin {}' -W +stap $@ -p1 -e 'probe begin {}' -W diff --git a/testsuite/parseok/bad_tapset.stp b/testsuite/parseok/bad_tapset.stp index a97c037f3..98b25e04f 100755 --- a/testsuite/parseok/bad_tapset.stp +++ b/testsuite/parseok/bad_tapset.stp @@ -3,4 +3,4 @@ # PR11405: without -W, bad tapsets will be warned but shouldn't be an error TAPSET=`dirname $0`/../parseko/bad_tapset/ -stap -p1 -e 'probe begin {}' -I $TAPSET +stap $@ -p1 -e 'probe begin {}' -I $TAPSET diff --git a/testsuite/parseok/cmdline01.stp b/testsuite/parseok/cmdline01.stp index 4bb1d6ea8..d3468ccfc 100755 --- a/testsuite/parseok/cmdline01.stp +++ b/testsuite/parseok/cmdline01.stp @@ -1,10 +1,10 @@ #! /bin/sh echo "output version" -stap -V +stap $@ -V if [ $? != 0 ]; then exit $? fi echo "output version and help" -stap -h +stap $@ -h diff --git a/testsuite/parseok/cmdline02.stp b/testsuite/parseok/cmdline02.stp index 37b733037..33bcbd6e1 100755 --- a/testsuite/parseok/cmdline02.stp +++ b/testsuite/parseok/cmdline02.stp @@ -2,4 +2,4 @@ # Make sure verbose ('-v') option is accepted. -stap -v -p1 -e 'probe begin { exit() }' +stap $@ -v -p1 -e 'probe begin { exit() }' diff --git a/testsuite/parseok/deprecated01.stp b/testsuite/parseok/deprecated01.stp index caa0089e2..223555b8e 100755 --- a/testsuite/parseok/deprecated01.stp +++ b/testsuite/parseok/deprecated01.stp @@ -2,4 +2,4 @@ # We should be able to parse this function -stap --check-version --compatible=1.5 -p2 -e 'probe nd_syscall.accept { println(flag_str++) }' +stap $@ --check-version --compatible=1.5 -p2 -e 'probe nd_syscall.accept { println(flag_str++) }' diff --git a/testsuite/parseok/fourteen.stp b/testsuite/parseok/fourteen.stp index bdd314690..c9e49db2d 100755 --- a/testsuite/parseok/fourteen.stp +++ b/testsuite/parseok/fourteen.stp @@ -5,7 +5,7 @@ global %( kernel_vr != "2.9.77-2873NOTHING" %? /* and */ %( kernel_v <= "3.5" %? /* and */ %( kernel_vr == "2.3.5-2.43.54.2" %? "FAIL1" %: PASS %) - %: "FAIL2" %) + %: %( kernel_vr == "3.6-1NOTHING" %? "FAIL2" %: PASS %) %) %: "FAIL3" %) %: "FAIL4" %) diff --git a/testsuite/parseok/macros05.stp b/testsuite/parseok/macros05.stp index 625aa85ec..294a3b99e 100755 --- a/testsuite/parseok/macros05.stp +++ b/testsuite/parseok/macros05.stp @@ -2,7 +2,7 @@ # test interaction between conditionals and macro expansion -stap -p2 - 1 2 3 4 5 <<'END' +stap $@ -p2 - 1 2 3 4 5 <<'END' @define foo %( %( $# >= 5 %? @5 %: "" %) %) diff --git a/testsuite/parseok/macros08.stp b/testsuite/parseok/macros08.stp index e97cf4bfa..7239a012b 100755 --- a/testsuite/parseok/macros08.stp +++ b/testsuite/parseok/macros08.stp @@ -2,7 +2,7 @@ # test interaction between conditionals and macro expansion -stap -p2 - 1 2 3 4 <<'END' +stap $@ -p2 - 1 2 3 4 <<'END' @define foo %( %( $# >= 5 %? @5 %: "" %) %) diff --git a/testsuite/parseok/nineteen.stp b/testsuite/parseok/nineteen.stp index 1d36b5904..47904d08c 100755 --- a/testsuite/parseok/nineteen.stp +++ b/testsuite/parseok/nineteen.stp @@ -1,3 +1,3 @@ #! /bin/sh -stap -p1 -e '$1 {log (@1.@2)}' 'probe foo' ' ' # <- control codes +stap $@ -p1 -e '$1 {log (@1.@2)}' 'probe foo' ' ' # <- control codes diff --git a/testsuite/parseok/semko.stp b/testsuite/parseok/semko.stp index d1df34e56..a269294c5 100755 --- a/testsuite/parseok/semko.stp +++ b/testsuite/parseok/semko.stp @@ -10,6 +10,6 @@ do if grep -q /bin/sh $file; then true # can't override stap options else - stap -p1 $file + stap $@ -p1 $file fi done diff --git a/testsuite/parseok/unparser.stp b/testsuite/parseok/unparser.stp index 41dac9a00..31a5d0f14 100755 --- a/testsuite/parseok/unparser.stp +++ b/testsuite/parseok/unparser.stp @@ -19,7 +19,7 @@ do else guru= fi echo $file $guru - stap $guru -p1 $file | stap $guru -p1 - > /dev/null + stap $guru -p1 $file | stap $@ $guru -p1 - > /dev/null fi done done diff --git a/testsuite/semko/fifty.stp b/testsuite/semko/fifty.stp index c876aff2b..5283e47aa 100755 --- a/testsuite/semko/fifty.stp +++ b/testsuite/semko/fifty.stp @@ -1,6 +1,6 @@ #! /bin/sh -stap -g -p2 -e ' +stap $@ -g -p2 -e ' # PR 13876 diff --git a/testsuite/semko/nodwf01.stp b/testsuite/semko/nodwf01.stp index 25217bac7..8a5c37ea1 100755 --- a/testsuite/semko/nodwf01.stp +++ b/testsuite/semko/nodwf01.stp @@ -2,7 +2,7 @@ # # Verify that --ignore-vmlinux "hides" vmlinux. -stap -p2 --ignore-vmlinux -e ' +stap $@ -p2 --ignore-vmlinux -e ' probe kernel.function("printk") { printf("%s called\n", probefunc()) exit() diff --git a/testsuite/semko/nodwf02.stp b/testsuite/semko/nodwf02.stp index 8f82d54b4..16e4e437c 100755 --- a/testsuite/semko/nodwf02.stp +++ b/testsuite/semko/nodwf02.stp @@ -2,7 +2,7 @@ # # Verify that --ignore-dwarf "hides" dwarf info. -stap -p2 --ignore-dwarf -e ' +stap $@ -p2 --ignore-dwarf -e ' probe kernel.function("printk") { printf("%s called\n", probefunc()) exit() diff --git a/testsuite/semko/nodwf03.stp b/testsuite/semko/nodwf03.stp index 6b66f2e99..4e4eb528f 100755 --- a/testsuite/semko/nodwf03.stp +++ b/testsuite/semko/nodwf03.stp @@ -2,7 +2,7 @@ # # --kelf doesn't work if vmlinux can't be found. -stap -p2 --ignore-vmlinux --kelf -e ' +stap $@ -p2 --ignore-vmlinux --kelf -e ' probe kernel.function("printk") { printf("%s called\n", probefunc()) exit() diff --git a/testsuite/semko/nodwf04.stp b/testsuite/semko/nodwf04.stp index c20dec4f4..8d491b18a 100755 --- a/testsuite/semko/nodwf04.stp +++ b/testsuite/semko/nodwf04.stp @@ -2,7 +2,7 @@ # # The symbol table doesn't give us enough info to probe inline functions. -stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' +stap $@ -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' probe kernel.function("list_empty").inline { printf("%s called\n", probefunc()) exit() diff --git a/testsuite/semko/nodwf05.stp b/testsuite/semko/nodwf05.stp index 83fcfa3d1..d3bd3df6d 100755 --- a/testsuite/semko/nodwf05.stp +++ b/testsuite/semko/nodwf05.stp @@ -2,7 +2,7 @@ # # The symbol table doesn't give us enough info to map source files to functions. -stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' +stap $@ -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' probe kernel.function("*@kernel/printk.c") { printf("%s called\n", probefunc()) exit() diff --git a/testsuite/semko/nodwf06.stp b/testsuite/semko/nodwf06.stp index 7318cbec8..0de31c131 100755 --- a/testsuite/semko/nodwf06.stp +++ b/testsuite/semko/nodwf06.stp @@ -2,7 +2,7 @@ # # The symbol table doesn't give us enough info to probe statements. -stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' +stap $@ -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' probe kernel.statement("*@kernel/printk.c:639") { printf("probe hit: %s\n", pp()) exit() diff --git a/testsuite/semko/nodwf07.stp b/testsuite/semko/nodwf07.stp index b48562f94..cd056fe0e 100755 --- a/testsuite/semko/nodwf07.stp +++ b/testsuite/semko/nodwf07.stp @@ -3,7 +3,7 @@ # This should fail until/unless we expand our blacklist to cover symbols # in the symbol table that don't show up in dwarf. -stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' +stap $@ -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' probe kernel.function("*") { printf("%s called\n", probefunc()) exit() diff --git a/testsuite/semko/nodwf08.stp b/testsuite/semko/nodwf08.stp index 4b6d9da59..2c10b2adb 100755 --- a/testsuite/semko/nodwf08.stp +++ b/testsuite/semko/nodwf08.stp @@ -2,7 +2,7 @@ # # The regular blacklist should thwart this. -stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' +stap $@ -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' probe kernel.function("register_kprobe") { printf("%s called\n", probefunc()) exit() diff --git a/testsuite/semko/nodwf09.stp b/testsuite/semko/nodwf09.stp index e103833f1..aa07c5400 100755 --- a/testsuite/semko/nodwf09.stp +++ b/testsuite/semko/nodwf09.stp @@ -2,7 +2,7 @@ # # The symbol table doesn't give us enough info to evaluate target variables. -stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' +stap $@ -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' probe kernel.function("printk") { printf("%s called; fmt = \"%s\"\n", probefunc(), kernel_string($fmt)) exit() diff --git a/testsuite/semko/plt2.stp b/testsuite/semko/plt2.stp index d366e710e..512f1ce81 100755 --- a/testsuite/semko/plt2.stp +++ b/testsuite/semko/plt2.stp @@ -1,4 +1,4 @@ #! /bin/sh # this is an error without a -c cmd -stap -p2 -e 'probe process.plt { exit() }' +stap $@ -p2 -e 'probe process.plt { exit() }' diff --git a/testsuite/semko/target_lvalue.stp b/testsuite/semko/target_lvalue.stp index 6b90486ad..45830b561 100755 --- a/testsuite/semko/target_lvalue.stp +++ b/testsuite/semko/target_lvalue.stp @@ -7,16 +7,16 @@ # Since this is a semko, we exit 1 if they all fail correctly, # else we exit 0 for success or crash. -stap -e 'probe syscall.read { ++$fd }' -p2 -g +stap $@ -e 'probe syscall.read { ++$fd }' -p2 -g [ $? -eq 1 ] || exit 0 -stap -e 'probe syscall.read { $fd++ }' -p2 -g +stap $@ -e 'probe syscall.read { $fd++ }' -p2 -g [ $? -eq 1 ] || exit 0 -stap -e 'probe syscall.read { delete $fd }' -p2 -g +stap $@ -e 'probe syscall.read { delete $fd }' -p2 -g [ $? -eq 1 ] || exit 0 -stap -e 'probe syscall.read { ++$fd = 42 }' -p2 -g +stap $@ -e 'probe syscall.read { ++$fd = 42 }' -p2 -g [ $? -eq 1 ] || exit 0 exit 1 diff --git a/testsuite/semok/args.stp b/testsuite/semok/args.stp index bc1931693..25a2c210b 100755 --- a/testsuite/semok/args.stp +++ b/testsuite/semok/args.stp @@ -1,3 +1,3 @@ #! /bin/sh -stap -p2 -e 'probe begin { log (@1 . sprint($2)) }' hello 0xdeadbeef +stap $@ -p2 -e 'probe begin { log (@1 . sprint($2)) }' hello 0xdeadbeef diff --git a/testsuite/semok/badvar.stp b/testsuite/semok/badvar.stp index 677187a38..b6f870733 100755 --- a/testsuite/semok/badvar.stp +++ b/testsuite/semok/badvar.stp @@ -1,6 +1,6 @@ #! /bin/sh -stap -p2 --skip-badvars -e ' +stap $@ -p2 --skip-badvars -e ' probe syscall.read { if ($foo == 0) printf ("Voila! It works..\n") diff --git a/testsuite/semok/badvar_undefined.stp b/testsuite/semok/badvar_undefined.stp index 05023ef04..ede9e5f74 100755 --- a/testsuite/semok/badvar_undefined.stp +++ b/testsuite/semok/badvar_undefined.stp @@ -3,5 +3,5 @@ # PR11346: We shouldn't even see a warning when a would-be skip-badvars # replacement is masked by a @defined condition. -stap -W -p2 --skip-badvars -e 'probe kernel.function("sys_getxattr") +stap $@ -W -p2 --skip-badvars -e 'probe kernel.function("sys_getxattr") { printf("%s\n", user_string(@defined($pathname) ? $pathname : $path)) }' diff --git a/testsuite/semok/bz11911.stp b/testsuite/semok/bz11911.stp index e5161206d..4e211bb70 100755 --- a/testsuite/semok/bz11911.stp +++ b/testsuite/semok/bz11911.stp @@ -20,5 +20,5 @@ main (void) } ' | gcc -g -o $TESTBIN -xc - || clean_exit $? -stap -L 'process("'$TESTBIN'").function("foo")' | grep '\$p:struct point' +stap $@ -L 'process("'$TESTBIN'").function("foo")' | grep '\$p:struct point' clean_exit $? diff --git a/testsuite/semok/defined_list_vars.stp b/testsuite/semok/defined_list_vars.stp index a44ee2c04..3caad3dde 100755 --- a/testsuite/semok/defined_list_vars.stp +++ b/testsuite/semok/defined_list_vars.stp @@ -8,7 +8,7 @@ # NB: This is abusing the fact that -l/-L work by wrapping the input string # with "probe " and "{}" -stap -L ' +stap $@ -L ' my_syscall.poll = kernel.function("sys_poll").call { timeout = (@defined($timeout_msecs) ? $timeout_msecs : $timeout) diff --git a/testsuite/semok/eight.stp b/testsuite/semok/eight.stp index dd7f71edb..fca5e0d56 100755 --- a/testsuite/semok/eight.stp +++ b/testsuite/semok/eight.stp @@ -1,3 +1,3 @@ #! /bin/sh -stap -p2 -I${SRCDIR}/testsuite/semlib -e 'probe begin { a = f1 (); }' +stap $@ -p2 -I${SRCDIR}/testsuite/semlib -e 'probe begin { a = f1 (); }' diff --git a/testsuite/semok/nine.stp b/testsuite/semok/nine.stp index b95eefcf6..c3833291e 100755 --- a/testsuite/semok/nine.stp +++ b/testsuite/semok/nine.stp @@ -1,3 +1,3 @@ #! /bin/sh -stap -p2 -I${SRCDIR}/testsuite/semlib -e 'probe begin { g2[1] = 0 }' +stap $@ -p2 -I${SRCDIR}/testsuite/semlib -e 'probe begin { g2[1] = 0 }' diff --git a/testsuite/semok/nodwf01.stp b/testsuite/semok/nodwf01.stp index c7a08f2a6..3e08e5b36 100755 --- a/testsuite/semok/nodwf01.stp +++ b/testsuite/semok/nodwf01.stp @@ -1,6 +1,6 @@ #!/bin/sh -stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' +stap $@ -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' global nret probe syscall.*.return { diff --git a/testsuite/semok/nodwf02.stp b/testsuite/semok/nodwf02.stp index b6df44e5a..003d28e1b 100755 --- a/testsuite/semok/nodwf02.stp +++ b/testsuite/semok/nodwf02.stp @@ -1,6 +1,6 @@ #!/bin/sh -stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' +stap $@ -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' global ncall /* diff --git a/testsuite/semok/nodwf03.stp b/testsuite/semok/nodwf03.stp index 6f8b36294..3f0fc1d8b 100755 --- a/testsuite/semok/nodwf03.stp +++ b/testsuite/semok/nodwf03.stp @@ -2,7 +2,7 @@ # # Test function-name wildcard. -stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' +stap $@ -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' global ncall probe kernel.function("sys_*") { diff --git a/testsuite/semok/nodwf04.stp b/testsuite/semok/nodwf04.stp index 84438fdae..2f5991193 100755 --- a/testsuite/semok/nodwf04.stp +++ b/testsuite/semok/nodwf04.stp @@ -2,7 +2,7 @@ # # Like nodwf01.stp, but extract the symbol table from vmlinux. -stap -p2 --ignore-dwarf --kelf -e ' +stap $@ -p2 --ignore-dwarf --kelf -e ' global nret probe syscall.*.return { diff --git a/testsuite/semok/nodwf05.stp b/testsuite/semok/nodwf05.stp index 8c9dda2ce..f5514f074 100755 --- a/testsuite/semok/nodwf05.stp +++ b/testsuite/semok/nodwf05.stp @@ -2,7 +2,7 @@ # # Like nodwf02.stp, but extract the symbol table from vmlinux. -stap -p2 --ignore-dwarf --kelf -e ' +stap $@ -p2 --ignore-dwarf --kelf -e ' global ncall /* diff --git a/testsuite/semok/nodwf06.stp b/testsuite/semok/nodwf06.stp index d27e3f843..3e2af6205 100755 --- a/testsuite/semok/nodwf06.stp +++ b/testsuite/semok/nodwf06.stp @@ -3,7 +3,7 @@ # Test function-name wildcard. # Like nodwf03.stp, but extract the symbol table from vmlinux. -stap -p2 --ignore-dwarf --kelf -e ' +stap $@ -p2 --ignore-dwarf --kelf -e ' global ncall probe kernel.function("sys_*") { diff --git a/testsuite/semok/nodwf07.stp b/testsuite/semok/nodwf07.stp index d886ac792..5a150f080 100755 --- a/testsuite/semok/nodwf07.stp +++ b/testsuite/semok/nodwf07.stp @@ -2,7 +2,7 @@ # # Test module-name and function-name wildcards. -stap -p2 --ignore-dwarf --kelf -e ' +stap $@ -p2 --ignore-dwarf --kelf -e ' global ncall probe module("*").function("*_probe") { diff --git a/testsuite/semok/plt2.stp b/testsuite/semok/plt2.stp index 22253d33f..a6b05510f 100755 --- a/testsuite/semok/plt2.stp +++ b/testsuite/semok/plt2.stp @@ -1,4 +1,4 @@ #! /bin/sh # this should read the plt from -c stap -stap -p2 -e 'probe process.plt { exit() }' -c stap +stap $@ -p2 -e 'probe process.plt { exit() }' -c stap diff --git a/testsuite/semok/pr11808.stp b/testsuite/semok/pr11808.stp index a55a3d0dc..29c69a1a7 100755 --- a/testsuite/semok/pr11808.stp +++ b/testsuite/semok/pr11808.stp @@ -3,5 +3,5 @@ # PR11808 # This stap command may or may not fail, depending on function/var # availability. It should not abort() though. -stap -e 'probe kernel.function("next_tgid").return { println($return->tgid) }' -p2 +stap $@ -e 'probe kernel.function("next_tgid").return { println($return->tgid) }' -p2 [ "$?" -le 1 ] diff --git a/testsuite/semok/pr11809.stp b/testsuite/semok/pr11809.stp index f1eb47728..e4249d9bf 100755 --- a/testsuite/semok/pr11809.stp +++ b/testsuite/semok/pr11809.stp @@ -3,6 +3,6 @@ # PR11809 # This stap command may or may not fail, depending on function/var # availability. When it does fail, it should not be with "stack underflow". -stap -e 'probe kernel.function("next_tgid") { println($iter->tgid) }' -p2 2>&1 | +stap $@ -e 'probe kernel.function("next_tgid") { println($iter->tgid) }' -p2 2>&1 | grep "stack underflow" [ "$?" -eq 1 ] diff --git a/testsuite/semok/syscall_return.stp b/testsuite/semok/syscall_return.stp index 9a0ca7c48..49297c6cc 100755 --- a/testsuite/semok/syscall_return.stp +++ b/testsuite/semok/syscall_return.stp @@ -1,4 +1,4 @@ #!/bin/sh # Per bz6588, this should get through the semantic pass without warnings. -stap -p2 -e 'probe syscall.*.return { printf("%s returns %s\n", name, retstr) }' 2>&1 | grep -q WARNING && exit 1 +stap $@ -p2 -e 'probe syscall.*.return { printf("%s returns %s\n", name, retstr) }' 2>&1 | grep -q WARNING && exit 1 exit 0 diff --git a/testsuite/semok/transko.stp b/testsuite/semok/transko.stp index 0ea2fe749..d68184ffe 100755 --- a/testsuite/semok/transko.stp +++ b/testsuite/semok/transko.stp @@ -9,6 +9,6 @@ do if grep -q /bin/sh $file; then true # can't override stap options else - stap -p2 $file + stap $@ -p2 $file fi done diff --git a/testsuite/semok/twenty.stp b/testsuite/semok/twenty.stp index 73dbb3bfa..958be6166 100755 --- a/testsuite/semok/twenty.stp +++ b/testsuite/semok/twenty.stp @@ -1,7 +1,7 @@ #! /bin/sh set -e -stap -wp2 -e ' +stap $@ -wp2 -e ' probe kernel.function("*") {} probe module("*").function("*") {} probe kernel.function("*").call {} diff --git a/testsuite/semok/twentyfive.stp b/testsuite/semok/twentyfive.stp index fadca484f..0ee980be7 100755 --- a/testsuite/semok/twentyfive.stp +++ b/testsuite/semok/twentyfive.stp @@ -1,8 +1,8 @@ #! /bin/sh set -e -stap -p2 -e 'probe begin {foo$1$2$3}' # $-expansion only at token head -stap -p2 -e 'probe $1 $2' 'syscall.open,begin' '{log ("hello\n")}' -stap -p2 -e 'probe begin {@1 @2}' 'syscall.open,begin' '{log ("hello\n")}' -stap -p2 -e 'probe begin {log (@1.@2)}' 'syscall.open,begin' '{log ("hello\n")}' +stap $@ -p2 -e 'probe begin {foo$1$2$3}' # $-expansion only at token head +stap $@ -p2 -e 'probe $1 $2' 'syscall.open,begin' '{log ("hello\n")}' +stap $@ -p2 -e 'probe begin {@1 @2}' 'syscall.open,begin' '{log ("hello\n")}' +stap $@ -p2 -e 'probe begin {log (@1.@2)}' 'syscall.open,begin' '{log ("hello\n")}' diff --git a/testsuite/systemtap.pass1-4/buildko.exp b/testsuite/systemtap.pass1-4/buildko.exp index a5560511d..98acd5f37 100644 --- a/testsuite/systemtap.pass1-4/buildko.exp +++ b/testsuite/systemtap.pass1-4/buildko.exp @@ -1,13 +1,21 @@ set self buildko -foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { - set test $self/[file tail $file] - verbose -log "Running $file" - set rc [stap_run_batch $file] - if {$rc < 0} { - # crashed - fail $test - } else { - setup_xfail *-*-* - if {$rc == 0} { pass $test } else { fail $test } +foreach runtime [get_runtime_list] { + foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { + set test $self/[file tail $file] + if {$runtime != ""} { + verbose -log "Running $file ($runtime)" + set rc [stap_run_batch $file --runtime=$runtime] + lappend test "($runtime)" + } else { + verbose -log "Running $file" + set rc [stap_run_batch $file] + } + if {$rc < 0} { + # crashed + fail $test + } else { + setup_xfail *-*-* + if {$rc == 0} { pass $test } else { fail $test } + } } } diff --git a/testsuite/systemtap.pass1-4/buildok-dyninst.exp b/testsuite/systemtap.pass1-4/buildok-dyninst.exp new file mode 100644 index 000000000..c3f4ad9da --- /dev/null +++ b/testsuite/systemtap.pass1-4/buildok-dyninst.exp @@ -0,0 +1,186 @@ +set self buildok +set runtime dyninst + +if {![dyninst_p]} { + untested "$self ($runtime) : no $runtime support found" + return +} + +foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { + set test $self/[file tail $file] + verbose -log "Running $file ($runtime)" + set rc [stap_run_batch $file --runtime=$runtime] + + # Use setup_kfail for known bugs. + # + # (Note that tcl doesn't like comments directly inside the switch + # statement, but comments can go in sub-blocks.) + switch $test { + buildok/alias_suffixes02.stp - + buildok/alias_suffixes03.stp - + buildok/alias_suffixes04.stp - + buildok/alias_suffixes05.stp - + buildok/alias_suffixes06.stp - + buildok/atomic.stp - + buildok/aux_syscalls-embedded.stp - + buildok/conversions-embedded.stp - + buildok/conversions-guru-embedded.stp - + buildok/conversions.stp - + buildok/dentry-embedded.stp - + buildok/dev-embedded.stp - + buildok/eighteen.stp - + buildok/fifteen.stp - + buildok/five.stp - + buildok/fortyfive.stp - + buildok/fortysix.stp - + buildok/fortytwo.stp - + buildok/guru.stp - + buildok/hwbkpt.stp - + buildok/inet_sock-embedded.stp - + buildok/ioblock-all-probes.stp - + buildok/ioblock-detailed.stp - + buildok/ioblock-embedded.stp - + buildok/ioscheduler-all-probes.stp - + buildok/ioscheduler-detailed.stp - + buildok/ioscheduler-embedded.stp - + buildok/ip-embedded.stp - + buildok/ipmib-all-probes.stp - + buildok/ipmib-detailed.stp - + buildok/ipmib-embedded.stp - + buildok/kprocess-all-probes.stp - + buildok/kprocess-detailed.stp - + buildok/kprocess-embedded.stp - + buildok/linuxmib-all-probes.stp - + buildok/linuxmib-detailed.stp - + buildok/logging-embedded.stp - + buildok/maxactive01.stp - + buildok/memory-all-probes.stp - + buildok/memory-detailed.stp - + buildok/memory-embedded.stp - + buildok/memory-mmap.stp - + buildok/memory.stp - + buildok/nd_syscalls-all-probes.stp - + buildok/nd_syscalls-arch-detailed.stp - + buildok/nd_syscalls-detailed.stp - + buildok/nd_syscalls2-detailed.stp - + buildok/netfilter01.stp - + buildok/netfilter02.stp - + buildok/netfilter03.stp - + buildok/netfilter04.stp - + buildok/networking-all-probes.stp - + buildok/networking-detailed.stp - + buildok/networking-embedded.stp - + buildok/newlocals01.stp - + buildok/nfs-all-probes.stp - + buildok/nfs-detailed.stp - + buildok/nfs-embedded.stp - + buildok/nfs-fop.check_flags.stp - + buildok/nfs_proc-detailed.stp - + buildok/nfs_proc-embedded.stp - + buildok/nfsd-all-probes.stp - + buildok/nfsd-detailed.stp - + buildok/nfsd-embedded.stp - + buildok/nfsderrno-embedded.stp - + buildok/oldlocals02.stp - + buildok/pr10678.stp - + buildok/pr13284.stp - + buildok/pretty.stp - + buildok/proc_mem-embedded.stp - + buildok/process_test.stp - + buildok/procfs01.stp - + buildok/queue_stats-embedded.stp - + buildok/rpc-all-probes.stp - + buildok/rpc-detailed.stp - + buildok/rpc-embedded.stp - + buildok/scheduler-all-probes.stp - + buildok/scheduler-cpu_off.stp - + buildok/scheduler-ctxswitch.stp - + buildok/scheduler-detailed.stp - + buildok/scheduler-embedded.stp - + buildok/scsi-all-probes.stp - + buildok/scsi-embedded.stp - + buildok/seven.stp - + buildok/seventeen.stp - + buildok/signal-all-probes.stp - + buildok/signal-check_ignored.stp - + buildok/signal-detailed.stp - + buildok/signal-embedded.stp - + buildok/signal-handle.stp - + buildok/six.stp - + buildok/socket-all-probes.stp - + buildok/socket-detailed.stp - + buildok/socket-embedded.stp - + buildok/stopwatches.stp - + buildok/syscall.stp - + buildok/syscalls-arch-detailed.stp - + buildok/syscalls-detailed.stp - + buildok/syscalls2-detailed.stp - + buildok/tcp-all-probes.stp - + buildok/tcp-detailed.stp - + buildok/tcp-embedded.stp - + buildok/tcp_test.stp - + buildok/tcpmib-all-probes.stp - + buildok/tcpmib-detailed.stp - + buildok/tcpmib-embedded.stp - + buildok/thirteen.stp - + buildok/thirtyone.stp - + buildok/thirtytwo.stp - + buildok/three.stp - + buildok/tty-detailed.stp - + buildok/tty-resize.stp - + buildok/twenty.stp - + buildok/twentyeight.stp - + buildok/twentyfive.stp - + buildok/twentynine.stp - + buildok/twentyseven.stp - + buildok/twentythree.stp - + buildok/twentytwo.stp - + buildok/two.stp - + buildok/udp-all-probes.stp - + buildok/udp-detailed.stp - + buildok/udp_test.stp - + buildok/vfs-all-probes.stp - + buildok/vfs-detailed.stp - + buildok/vfs-embedded.stp - + buildok/xtime.stp { + # Use setup_kfail DYNINST for known + # failures when running with the dyninst runtime (scripts + # that use kernel features or kernel-only tapset + # functions). + if {$rc != 0} { setup_kfail DYNINST *-*-* } } + } + + # tests that need more investigation/work: + # - buildok/context-embedded.stp + # - buildok/context-symbols-embedded.stp + # - buildok/context-unwind-embedded.stp + # - buildok/fourteen-plus.stp - no timer probes + # - buildok/fourteen.stp - no timer probes + # - buildok/gtod_init.stp - no gettimeofday + # - buildok/gtod_noinit.stp - ditto + # - buildok/histogram_operator_in.stp - no timer probes + # - buildok/indent.stp - missing 'execname' + # - buildok/iterate_histogram_buckets.stp - no timer probes + # - buildok/per-process-syscall.stp - process.syscall + # probes implementable? + # - buildok/pretty-uprobes.stp - needs _stp_strncpy_from_user + # - buildok/print_histogram_entry.stp - no timer probes + # - buildok/print_histograms.stp - no timer probes + # - buildok/printf.stp + # - buildok/stat_extract.stp - missing timer probes + # - buildok/string-embedded.stp + # - buildok/system-embedded.stp + # - buildok/task-embedded.stp - should these functions + # work? task_current, etc. + # - buildok/task_test.stp + # - buildok/task_time-embedded.stp + # - buildok/timestamp-embedded.stp + # - buildok/timestamp_monotonic-embedded.stp + # - buildok/twentyeightprime.stp - could + # process.statement.absolute probes work? + # - buildok/ucontext-embedded.stp + # - buildok/ucontext-symbols-embedded.stp + # - buildok/ucontext-unwind-embedded.stp + # - buildok/utrace.stp + if {$rc == 0} { pass "$test ($runtime)" } else { fail "$test ($runtime)" } +} diff --git a/testsuite/systemtap.pass1-4/parseko.exp b/testsuite/systemtap.pass1-4/parseko.exp index 658a29577..7455b8e32 100644 --- a/testsuite/systemtap.pass1-4/parseko.exp +++ b/testsuite/systemtap.pass1-4/parseko.exp @@ -1,13 +1,21 @@ set self parseko -foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { - set test $self/[file tail $file] - verbose -log "Running $file" - set rc [stap_run_batch $file] - if {$rc < 0} { - # crashed - fail $test - } else { - setup_xfail *-*-* - if {$rc == 0} { pass $test } else { fail $test } +foreach runtime [get_runtime_list] { + foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { + set test $self/[file tail $file] + if {$runtime != ""} { + verbose -log "Running $file ($runtime)" + set rc [stap_run_batch $file --runtime=$runtime] + lappend test "($runtime)" + } else { + verbose -log "Running $file" + set rc [stap_run_batch $file] + } + if {$rc < 0} { + # crashed + fail $test + } else { + setup_xfail *-*-* + if {$rc == 0} { pass $test } else { fail $test } + } } } diff --git a/testsuite/systemtap.pass1-4/parseok.exp b/testsuite/systemtap.pass1-4/parseok.exp index e96e74f2f..1fab31f8c 100644 --- a/testsuite/systemtap.pass1-4/parseok.exp +++ b/testsuite/systemtap.pass1-4/parseok.exp @@ -1,7 +1,33 @@ set self parseok -foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { - set test $self/[file tail $file] - verbose -log "Running $file" - set rc [stap_run_batch $file] - if {$rc == 0} { pass $test } else { fail $test } + +proc dyninst_kfails {test} { + # Use setup_kfail for known bugs. + # + # (Note that tcl doesn't like comments directly inside the switch + # statement, but comments can go in sub-blocks.) + switch $test { + parseok/deprecated01.stp { + # Use setup_kfail DYNINST for known + # failures when running with the dyninst runtime (scripts + # that use kernel features or kernel-only tapset + # functions). + setup_kfail DYNINST *-*-* + } + } +} + +foreach runtime [get_runtime_list] { + foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { + set test $self/[file tail $file] + if {$runtime != ""} { + verbose -log "Running $file ($runtime)" + set rc [stap_run_batch $file --runtime=$runtime] + if {$rc != 0} { ${runtime}_kfails $test } + lappend test "($runtime)" + } else { + verbose -log "Running $file" + set rc [stap_run_batch $file] + } + if {$rc == 0} { pass $test } else { fail $test } + } } diff --git a/testsuite/systemtap.pass1-4/semko.exp b/testsuite/systemtap.pass1-4/semko.exp index 5cf21f429..ca1c0c8dc 100644 --- a/testsuite/systemtap.pass1-4/semko.exp +++ b/testsuite/systemtap.pass1-4/semko.exp @@ -1,19 +1,27 @@ set self semko -foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { - set test $self/[file tail $file] - switch $test { - semko/utrace.stp { - # These tests require a system without utrace. - if {[utrace_p]} { untested $test; continue } } - } - - verbose -log "Running $file" - set rc [stap_run_batch $file] - if {$rc < 0} { - # crashed - fail $test - } else { - setup_xfail *-*-* - if {$rc == 0} { pass $test } else { fail $test } +foreach runtime [get_runtime_list] { + foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { + set test $self/[file tail $file] + if {$runtime != ""} { + verbose -log "Running $file ($runtime)" + set rc [stap_run_batch $file --runtime=$runtime] + lappend test "($runtime)" + } else { + switch $test { + semko/utrace.stp { + # These tests require a system without utrace. + if {[utrace_p]} { untested $test; continue } } + } + + verbose -log "Running $file" + set rc [stap_run_batch $file] + } + if {$rc < 0} { + # crashed + fail $test + } else { + setup_xfail *-*-* + if {$rc == 0} { pass $test } else { fail $test } + } } } diff --git a/testsuite/systemtap.pass1-4/semok.exp b/testsuite/systemtap.pass1-4/semok.exp index 700eb9251..70e56b2d8 100644 --- a/testsuite/systemtap.pass1-4/semok.exp +++ b/testsuite/systemtap.pass1-4/semok.exp @@ -1,29 +1,75 @@ set self semok -set uprobes_p [uprobes_p] -set utrace_p [utrace_p] -foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { - set test $self/[file tail $file] - switch $test { - semok/thirtysix-utrace.stp - - semok/utrace01.stp { - # These tests need utrace - if {!$utrace_p} { untested $test; continue } } - semok/bz11911.stp - - semok/mangled.stp - - semok/pretty-uprobes.stp { - # These tests need uprobes - if {!$uprobes_p} { untested $test; continue } } - - semok/plt1.stp - - semok/plt2.stp { - # The .plt tests need uprobes and x86 - if {![regexp "^(x86_64|i.86)$" $::tcl_platform(machine)]} { - untested $test; continue } - if {!$uprobes_p} { untested $test; continue } } +proc dyninst_kfails {test} { + # Use setup_kfail for known bugs. + # + # (Note that tcl doesn't like comments directly inside the switch + # statement, but comments can go in sub-blocks.) + switch $test { + semok/badvar.stp - + semok/doubleglob.stp - + semok/entry01.stp - + semok/entry02.stp - + semok/entry03.stp - + semok/entry04.stp - + semok/gurufunc.stp - + semok/kretprobe-data.stp - + semok/nodwf01.stp - + semok/nodwf02.stp - + semok/nodwf03.stp - + semok/nodwf04.stp - + semok/nodwf05.stp - + semok/nodwf06.stp - + semok/nodwf07.stp - + semok/pretty.stp - + semok/pretty2.stp - + semok/thirtysix.stp - + semok/thirtytwo.stp - + semok/twentyfive.stp - + semok/twentyfour.stp { + # Use setup_kfail DYNINST for known + # failures when running with the dyninst runtime (scripts + # that use kernel features or kernel-only tapset + # functions). + setup_kfail DYNINST *-*-* + } } + # semok/thirtysix-utrace.stp - could it be made to work +} - verbose -log "Running $file" - set rc [stap_run_batch $file] - if {$rc == 0} { pass $test } else { fail $test } +set uprobes_p [uprobes_p] +set utrace_p [utrace_p] +foreach runtime [get_runtime_list] { + foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { + set test $self/[file tail $file] + if {$runtime != ""} { + verbose -log "Running $file ($runtime)" + set rc [stap_run_batch $file --runtime=$runtime] + if {$rc != 0} { ${runtime}_kfails $test } + lappend test "($runtime)" + } else { + switch $test { + semok/thirtysix-utrace.stp - + semok/utrace01.stp { + # These tests need utrace + if {!$utrace_p} { untested $test; continue } } + + semok/bz11911.stp - + semok/mangled.stp - + semok/pretty-uprobes.stp { + # These tests need uprobes + if {!$uprobes_p} { untested $test; continue } } + + semok/plt1.stp - + semok/plt2.stp { + # The .plt tests need uprobes and x86 + if {![regexp "^(x86_64|i.86)$" $::tcl_platform(machine)]} { + untested $test; continue } + if {!$uprobes_p} { untested $test; continue } } + } + verbose -log "Running $file" + set rc [stap_run_batch $file] + } + if {$rc == 0} { pass $test } else { fail $test } + } } diff --git a/testsuite/systemtap.pass1-4/transko.exp b/testsuite/systemtap.pass1-4/transko.exp index abda0286f..75b9c1557 100644 --- a/testsuite/systemtap.pass1-4/transko.exp +++ b/testsuite/systemtap.pass1-4/transko.exp @@ -1,13 +1,21 @@ set self transko -foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { - set test $self/[file tail $file] - verbose -log "Running $file" - set rc [stap_run_batch $file] - if {$rc < 0} { - # crashed - fail $test - } else { - setup_xfail *-*-* - if {$rc == 0} { pass $test } else { fail $test } +foreach runtime [get_runtime_list] { + foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { + set test $self/[file tail $file] + if {$runtime != ""} { + verbose -log "Running $file ($runtime)" + set rc [stap_run_batch $file --runtime=$runtime] + lappend test "($runtime)" + } else { + verbose -log "Running $file" + set rc [stap_run_batch $file] + } + if {$rc < 0} { + # crashed + fail $test + } else { + setup_xfail *-*-* + if {$rc == 0} { pass $test } else { fail $test } + } } } diff --git a/testsuite/systemtap.pass1-4/transok.exp b/testsuite/systemtap.pass1-4/transok.exp index 0b94ee9c0..c05d58846 100644 --- a/testsuite/systemtap.pass1-4/transok.exp +++ b/testsuite/systemtap.pass1-4/transok.exp @@ -1,7 +1,15 @@ set self transok -foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { - set test $self/[file tail $file] - verbose -log "Running $file" - set rc [stap_run_batch $file] - if {$rc == 0} { pass $test } else { fail $test } +foreach runtime [get_runtime_list] { + foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { + set test $self/[file tail $file] + if {$runtime != ""} { + verbose -log "Running $file ($runtime)" + set rc [stap_run_batch $file --runtime=$runtime] + lappend test "($runtime)" + } else { + verbose -log "Running $file" + set rc [stap_run_batch $file] + } + if {$rc == 0} { pass $test } else { fail $test } + } } diff --git a/testsuite/transok/buildko.stp b/testsuite/transok/buildko.stp index 7917a1e5f..19c8c0de1 100755 --- a/testsuite/transok/buildko.stp +++ b/testsuite/transok/buildko.stp @@ -9,8 +9,8 @@ do if grep -q /bin/sh $file; then true # can't override stap options elif head -n 1 $file | grep -q g ; then - stap -gp3 $file + stap $@ -gp3 $file else - stap -p3 $file + stap $@ -p3 $file fi done diff --git a/testsuite/transok/eleven.stp b/testsuite/transok/eleven.stp index 7fb8e9869..ce95386a4 100755 --- a/testsuite/transok/eleven.stp +++ b/testsuite/transok/eleven.stp @@ -1,3 +1,3 @@ #! /bin/sh -stap -p3 -d /zoo/poo/in/the/loo --ldd -e 'probe begin {exit()}' >/dev/null +stap $@ -p3 -d /zoo/poo/in/the/loo --ldd -e 'probe begin {exit()}' >/dev/null -- 2.43.5