* 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.
# Test '-g' and '-D'. The code below will give an error at
# compilation stage unless 'FOO' is defined.
-stap -g -p4 -DFOO=1 - <<EOF
+stap $@ -g -p4 -DFOO=1 - <<EOF
function footest:string()
%{
fn="do_readv_writev@fs/read_write.c"
var="file"
-fullfn=`stap -wp2 -e 'probe kernel.statement("'$fn'") {}' | grep kernel | cut -f2 -d'"'`
+fullfn=`stap $@ -wp2 -e 'probe kernel.statement("'$fn'") {}' | grep kernel | cut -f2 -d'"'`
lineno=`echo $fullfn | cut -f2 -d:`
echo "$0: $fn found, starting line $lineno"
for i in 0 1 2 4 6 10 15 20 25 # some random numbers, not larger than the number of lines in fn
do
ilineno=`expr $lineno + $i`
- errors=`stap -u -p4 -e 'probe kernel.statement("'$fn':'$ilineno'") {$'$var'}' 2>&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
#! /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;
%}
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",
#! /bin/sh
-stap --ldd -vvv -p4 -e 'probe begin {}' -t -d /bin/ls
+stap $@ --ldd -vvv -p4 -e 'probe begin {}' -t -d /bin/ls
#! /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 {}
}
+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"
}
}
+ # 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
}
}
-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
# 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 {
# 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
#
# NUM must be between 1 and 64
-stap -p1 -s 0 -e 'probe begin { exit() }'
+stap $@ -p1 -s 0 -e 'probe begin { exit() }'
#
# NUM must be between 1 and 5
-stap -p0 -e 'probe begin { exit() }'
+stap $@ -p0 -e 'probe begin { exit() }'
# 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() }'
# 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() }'
# 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() }'
#!/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() }'
#
# -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() }'
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
# 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++) }'
#! /bin/sh
# recursive
-stap -p1 -e '$1' '$1'
+stap $@ -p1 -e '$1' '$1'
#! /bin/sh
# recursive after the first token (PR11195)
-stap -p1 -e 'probe begin {$1}' 'x $1'
+stap $@ -p1 -e 'probe begin {$1}' 'x $1'
#! /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" %)'
#! /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") {}'
#! /bin/sh
-stap -p1 $SYSTEMTAP_TAPSET/indent.stp
+stap $@ -p1 $SYSTEMTAP_TAPSET/indent.stp
# PR11405: all the default tapsets should succeed even with -W
-stap -p1 -e 'probe begin {}' -W
+stap $@ -p1 -e 'probe begin {}' -W
# 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
#! /bin/sh
echo "output version"
-stap -V
+stap $@ -V
if [ $? != 0 ]; then
exit $?
fi
echo "output version and help"
-stap -h
+stap $@ -h
# Make sure verbose ('-v') option is accepted.
-stap -v -p1 -e 'probe begin { exit() }'
+stap $@ -v -p1 -e 'probe begin { exit() }'
# 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++) }'
%( 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" %)
# 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 %: "" %) %)
# 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 %: "" %) %)
#! /bin/sh
-stap -p1 -e '$1 {log (@1.@2)}' 'probe foo' '\v\f' # <- control codes
+stap $@ -p1 -e '$1 {log (@1.@2)}' 'probe foo' '\v\f' # <- control codes
if grep -q /bin/sh $file; then
true # can't override stap options
else
- stap -p1 $file
+ stap $@ -p1 $file
fi
done
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
#! /bin/sh
-stap -g -p2 -e '
+stap $@ -g -p2 -e '
# PR 13876
#
# 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()
#
# 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()
#
# --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()
#
# 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()
#
# 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()
#
# 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()
# 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()
#
# 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()
#
# 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()
#! /bin/sh
# this is an error without a -c cmd
-stap -p2 -e 'probe process.plt { exit() }'
+stap $@ -p2 -e 'probe process.plt { exit() }'
# 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
#! /bin/sh
-stap -p2 -e 'probe begin { log (@1 . sprint($2)) }' hello 0xdeadbeef
+stap $@ -p2 -e 'probe begin { log (@1 . sprint($2)) }' hello 0xdeadbeef
#! /bin/sh
-stap -p2 --skip-badvars -e '
+stap $@ -p2 --skip-badvars -e '
probe syscall.read {
if ($foo == 0)
printf ("Voila! It works..\n")
# 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)) }'
}
' | 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 $?
# 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)
#! /bin/sh
-stap -p2 -I${SRCDIR}/testsuite/semlib -e 'probe begin { a = f1 (); }'
+stap $@ -p2 -I${SRCDIR}/testsuite/semlib -e 'probe begin { a = f1 (); }'
#! /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 }'
#!/bin/sh
-stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e '
+stap $@ -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e '
global nret
probe syscall.*.return {
#!/bin/sh
-stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e '
+stap $@ -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e '
global ncall
/*
#
# 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_*") {
#
# 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 {
#
# Like nodwf02.stp, but extract the symbol table from vmlinux.
-stap -p2 --ignore-dwarf --kelf -e '
+stap $@ -p2 --ignore-dwarf --kelf -e '
global ncall
/*
# 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_*") {
#
# 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") {
#! /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
# 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 ]
# 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 ]
#!/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
if grep -q /bin/sh $file; then
true # can't override stap options
else
- stap -p2 $file
+ stap $@ -p2 $file
fi
done
#! /bin/sh
set -e
-stap -wp2 -e '
+stap $@ -wp2 -e '
probe kernel.function("*") {}
probe module("*").function("*") {}
probe kernel.function("*").call {}
#! /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")}'
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 }
+ }
}
}
--- /dev/null
+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 <pr number> <target triplet> 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 <target triplet> 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)" }
+}
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 }
+ }
}
}
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 <pr number> <target triplet> 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 <target triplet> 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 }
+ }
}
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 }
+ }
}
}
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 <pr number> <target triplet> 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 <target triplet> 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 }
+ }
}
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 }
+ }
}
}
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 }
+ }
}
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
#! /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