summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/Makefile.am4
-rw-r--r--testsuite/Makefile.in4
-rwxr-xr-xtestsuite/buildok/tty.stp51
-rwxr-xr-xtestsuite/configure22
-rw-r--r--testsuite/configure.ac12
-rw-r--r--testsuite/systemtap.apps/mysql.exp (renamed from testsuite/systemtap.base/mysql.exp)2
-rw-r--r--testsuite/systemtap.apps/postgres.exp (renamed from testsuite/systemtap.base/postgres.exp)2
-rw-r--r--testsuite/systemtap.apps/stap-tcl.sh25
-rw-r--r--testsuite/systemtap.apps/stap-tcl.stp30
-rw-r--r--testsuite/systemtap.apps/tcl.exp67
-rw-r--r--testsuite/systemtap.apps/xulrunner.exp133
-rw-r--r--testsuite/systemtap.base/onoffprobe.exp20
-rw-r--r--testsuite/systemtap.base/pr10854.exp32
-rw-r--r--testsuite/systemtap.base/pr10854.stp20
-rw-r--r--testsuite/systemtap.context/args.tcl3
-rw-r--r--testsuite/systemtap.context/backtrace.tcl2
-rw-r--r--testsuite/systemtap.context/num_args.tcl3
-rw-r--r--testsuite/systemtap.context/pid.tcl2
-rw-r--r--testsuite/systemtap.examples/index.html3
-rw-r--r--testsuite/systemtap.examples/index.txt7
-rwxr-xr-xtestsuite/systemtap.examples/io/traceio2.stp2
-rw-r--r--testsuite/systemtap.examples/keyword-index.html3
-rw-r--r--testsuite/systemtap.examples/keyword-index.txt7
-rw-r--r--testsuite/systemtap.examples/process/plimit.meta7
-rwxr-xr-xtestsuite/systemtap.examples/process/plimit.stp78
-rw-r--r--testsuite/systemtap.syscall/README3
-rw-r--r--testsuite/systemtap.syscall/chmod.c2
-rw-r--r--testsuite/systemtap.syscall/dir.c4
-rw-r--r--testsuite/systemtap.syscall/mmap.c4
-rw-r--r--testsuite/systemtap.syscall/net1.c2
-rw-r--r--testsuite/systemtap.syscall/openclose.c18
-rw-r--r--testsuite/systemtap.syscall/readwrite.c4
-rw-r--r--testsuite/systemtap.syscall/stat.c2
-rwxr-xr-xtestsuite/systemtap.syscall/sys.stp10
-rwxr-xr-xtestsuite/systemtap.syscall/test-debug.tcl11
-rwxr-xr-xtestsuite/systemtap.syscall/test.tcl6
-rwxr-xr-xtestsuite/transko/varargs.stp10
-rwxr-xr-xtestsuite/transok/varargs.stp9
38 files changed, 591 insertions, 35 deletions
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 9607ebe3..248a0fb3 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -12,7 +12,7 @@ clean-local:
-rm -rf .systemtap* .cache_test* 2>/dev/null
DEJAZILLA=@dejazilla@
-
+TESTAPPS=@enable_testapps@
TOOL_OPTS=
# automake's dejagnu library already runs check-DEJAGNU before check-local
@@ -37,4 +37,4 @@ SYSTEMTAP_INCLUDES=$(DESTDIR)$(includedir)
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 SYSTEMTAP_PATH=$(SYSTEMTAP_PATH) SYSTEMTAP_INCLUDES=$(SYSTEMTAP_INCLUDES) $(srcdir)/execrc runtest"
+RUNTEST="env SYSTEMTAP_TESTAPPS=$(TESTAPPS) SYSTEMTAP_RUNTIME=$(SYSTEMTAP_RUNTIME) SYSTEMTAP_TAPSET=$(SYSTEMTAP_TAPSET) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) CRASH_LIBDIR=$(CRASH_LIBDIR) PATH=$(SYSTEMTAP_PATH):$$PATH SYSTEMTAP_PATH=$(SYSTEMTAP_PATH) SYSTEMTAP_INCLUDES=$(SYSTEMTAP_INCLUDES) $(srcdir)/execrc runtest"
diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in
index c0f0b19c..3068dea3 100644
--- a/testsuite/Makefile.in
+++ b/testsuite/Makefile.in
@@ -92,6 +92,7 @@ datarootdir = @datarootdir@
dejazilla = @dejazilla@
docdir = @docdir@
dvidir = @dvidir@
+enable_testapps = @enable_testapps@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
@@ -118,6 +119,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = dejagnu no-dist
DEJAZILLA = @dejazilla@
+TESTAPPS = @enable_testapps@
TOOL_OPTS =
# $(srcdir)/These values point the test suite to the install tree, and
@@ -130,7 +132,7 @@ SYSTEMTAP_PATH = $(DESTDIR)$(bindir)
SYSTEMTAP_INCLUDES = $(DESTDIR)$(includedir)
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 SYSTEMTAP_PATH=$(SYSTEMTAP_PATH) SYSTEMTAP_INCLUDES=$(SYSTEMTAP_INCLUDES) $(srcdir)/execrc runtest"
+RUNTEST = "env SYSTEMTAP_TESTAPPS=$(TESTAPPS) SYSTEMTAP_RUNTIME=$(SYSTEMTAP_RUNTIME) SYSTEMTAP_TAPSET=$(SYSTEMTAP_TAPSET) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) CRASH_LIBDIR=$(CRASH_LIBDIR) PATH=$(SYSTEMTAP_PATH):$$PATH SYSTEMTAP_PATH=$(SYSTEMTAP_PATH) SYSTEMTAP_INCLUDES=$(SYSTEMTAP_INCLUDES) $(srcdir)/execrc runtest"
all: all-am
.SUFFIXES:
diff --git a/testsuite/buildok/tty.stp b/testsuite/buildok/tty.stp
new file mode 100755
index 00000000..0b5018d9
--- /dev/null
+++ b/testsuite/buildok/tty.stp
@@ -0,0 +1,51 @@
+#! stap -wp4
+
+probe tty.poll{
+ printf("Pooling tty %s for wait queue key %d\n", file_name, wait_key);
+}
+
+probe tty.register {
+ printf("Device registered using index %d using driver %s(%s/%s)\n", index, driver_name, name, module)
+}
+
+probe tty.unregister {
+ printf("Device registered using index %d using driver %s(%s/%s)\n", index, driver_name, name, module)
+}
+
+probe tty.release {
+ printf("Closing file %s\n", file_name)
+ printf("INODE: number %d\nState: %d\nFlag: %d\n", inode_number, inode_state, inode_flags)
+ printf("File: %s (mode %x flags %x)\n", file_name, file_mode, file_flags)
+}
+
+probe tty.open {
+ printf("Opening tty file %s\n", file_name)
+ printf("INODE: number %d\nState: %d\nFlag: %d\n", inode_number, inode_state, inode_flags)
+ printf("File: %s mode %x flags %x\n", file_name, file_mode, file_flags)
+}
+
+probe tty.resize {
+ printf("Resizing %s from %dx%d (%d/%d) to %dx%d (%d/%d)\n", name, old_row, old_col, old_xpixel, old_ypixel,
+ new_row, new_col, new_xpixel, new_ypixel)
+}
+
+probe tty.ioctl {
+ printf("Ioctling file %s with %d %d\n", name, cmd, arg)
+}
+
+probe tty.init {
+ printf("new tty with name %s from driver %s and module %s\nn", driver_name, name, module)
+}
+
+probe tty.receive {
+ printf("Driver %s/%s (%d/%d) received %s (%s) with len %d\n", name, driver_name, index, id, cp, fp, count)
+}
+
+
+probe tty.write {
+ printf("Buffer %s (len %d) wrote on file %s (driver %s)\n", buffer, nr, file_name, driver_name)
+}
+
+probe tty.read {
+ printf("Reading tty file %s (driver %s) to a buffer with size %d containing %s\n", file_name, driver_name, nr, buffer)
+}
diff --git a/testsuite/configure b/testsuite/configure
index 716d8b50..8a9503cd 100755
--- a/testsuite/configure
+++ b/testsuite/configure
@@ -641,6 +641,7 @@ MAINTAINER_MODE_TRUE
MAINTAINER_MODE_FALSE
MAINT
dejazilla
+enable_testapps
LIBOBJS
LTLIBOBJS'
ac_subst_files=''
@@ -1229,6 +1230,9 @@ Optional Features:
results to a central public collection point
(default is disabled). Optional EMAIL overrides the
default email address.
+ --enable-testapps=foo bar or all
+ enable rebuilding of large external apps for testing
+ <sdt.h> markers
Report bugs to <systemtap@sources.redhat.com>.
_ACEOF
@@ -2182,6 +2186,21 @@ echo "$as_me: A \"make *check\" will email results to $dejazilla" >&6;}
fi
+apps=
+for exp in $srcdir/systemtap.apps/*.exp
+do
+ app=`basename $exp .exp`
+ apps="$app $apps"
+done
+# Check whether --enable-testapps was given.
+if test "${enable_testapps+set}" = set; then
+ enableval=$enable_testapps;
+fi
+
+{ echo "$as_me:$LINENO: Will test ${enable_testapps-no} apps from: $apps" >&5
+echo "$as_me: Will test ${enable_testapps-no} apps from: $apps" >&6;}
+
+
ac_config_files="$ac_config_files Makefile"
cat >confcache <<\_ACEOF
@@ -2884,11 +2903,12 @@ MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
MAINT!$MAINT$ac_delim
dejazilla!$dejazilla$ac_delim
+enable_testapps!$enable_testapps$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 65; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 66; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff --git a/testsuite/configure.ac b/testsuite/configure.ac
index 5166d226..33e06752 100644
--- a/testsuite/configure.ac
+++ b/testsuite/configure.ac
@@ -23,5 +23,17 @@ if test -n "$dejazilla"; then
fi
AC_SUBST(dejazilla)
+apps=
+for exp in $srcdir/systemtap.apps/*.exp
+do
+ app=`basename $exp .exp`
+ apps="$app $apps"
+done
+AC_ARG_ENABLE([testapps],
+ AC_HELP_STRING([--enable-testapps=foo bar or all],
+ [enable rebuilding of large external apps for testing <sdt.h> markers]))
+AC_MSG_NOTICE([Will test ${enable_testapps-no} apps from: $apps])
+AC_SUBST(enable_testapps)
+
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
diff --git a/testsuite/systemtap.base/mysql.exp b/testsuite/systemtap.apps/mysql.exp
index 44b30cf4..efeffbae 100644
--- a/testsuite/systemtap.base/mysql.exp
+++ b/testsuite/systemtap.apps/mysql.exp
@@ -244,7 +244,7 @@ $mysqldir/bin/mysql_install_db --basedir=$mysqldir --datadir=$msdata
(cd $mysqldir/mysql-test
# wait until mysql is running
MOD=stapsdt_\$(date +%j%k%M%N | sed 's/ //')
-/usr/local/bin/stap -m \$MOD -c \"$mysqldir/libexec/mysqld --basedir=$mysqldir --datadir=$msdata --log-error=$msdata/mysql.log --pid-file=$msdata/mysql.pid --socket=$msdata/mysql.sock\" $testsuite/stap-mysql.stp $mysqldir/libexec/mysqld >$testsuite/stap-mysql-markers.log 2>&1 &
+$env(SYSTEMTAP_PATH)/stap -m \$MOD -c \"$mysqldir/libexec/mysqld --basedir=$mysqldir --datadir=$msdata --log-error=$msdata/mysql.log --pid-file=$msdata/mysql.pid --socket=$msdata/mysql.sock\" $testsuite/stap-mysql.stp $mysqldir/libexec/mysqld >$testsuite/stap-mysql-markers.log 2>&1 &
STAPPID=\$!
for i in \$(seq 0 10) ; do
diff --git a/testsuite/systemtap.base/postgres.exp b/testsuite/systemtap.apps/postgres.exp
index ceef9437..2d58a54f 100644
--- a/testsuite/systemtap.base/postgres.exp
+++ b/testsuite/systemtap.apps/postgres.exp
@@ -69,7 +69,7 @@ function run_tests \{
$postgresdir/bin/initdb $pgdata
which stap
-stap -m \$(date +stapsdt_%j%k%M%N | sed 's/ //') -c \"$postgresdir/bin/postgres -D $pgdata\" $pgdata.stp >$pgdata-markers.log 2>&1 &
+$env(SYSTEMTAP_PATH)/stap -m \$(date +stapsdt_%j%k%M%N | sed 's/ //') -c \"$postgresdir/bin/postgres -D $pgdata\" $pgdata.stp >$pgdata-markers.log 2>&1 &
STAPPID=\$!
# wait until postgres is running
diff --git a/testsuite/systemtap.apps/stap-tcl.sh b/testsuite/systemtap.apps/stap-tcl.sh
new file mode 100644
index 00000000..919f632d
--- /dev/null
+++ b/testsuite/systemtap.apps/stap-tcl.sh
@@ -0,0 +1,25 @@
+#! /bin/sh
+
+set -e
+
+tclreleasemajor="8.6"
+tclrelease="8.6b1"
+tcldir=`pwd`/tcl/install/
+
+mkdir -p tcl
+
+if [ ! -r tcl$tclrelease-src.tar.gz ] ; then
+ wget http://sourceforge.net/projects/tcl/files/Tcl/$tclrelease/tcl$tclrelease-src.tar.gz/download
+fi
+
+if [ ! -d tcl/src ] ; then
+ tar -x -z -f tcl$tclrelease-src.tar.gz
+ mv tcl$tclrelease tcl/src
+fi
+
+cd tcl/src/unix
+env CPPFLAGS="-I$SYSTEMTAP_INCLUDES" CFLAGS="-g -O2" ./configure --prefix=$tcldir --enable-dtrace
+make -j2
+make install
+
+exit 0
diff --git a/testsuite/systemtap.apps/stap-tcl.stp b/testsuite/systemtap.apps/stap-tcl.stp
new file mode 100644
index 00000000..d3293b09
--- /dev/null
+++ b/testsuite/systemtap.apps/stap-tcl.stp
@@ -0,0 +1,30 @@
+global counts
+
+probe process(@1).mark("*") {
+ counts[$$name]<<<1 # PR10878; check also $$parms length
+}
+
+function judge(name, minvalue) {
+ value = @count(counts[name])
+ printf("%s %s %d %d\n", ((value>=minvalue)?"OK":"KO"), name, value, minvalue)
+}
+
+probe end,error {
+ /* foreach (name in counts-) {
+ printf("== %s %d\n", name, @count(counts[name]))
+ } */
+ judge("proc__entry", 9000)
+ judge("proc__return", 9000)
+ judge("proc__result", 9000)
+ judge("proc__args", 9000)
+ judge("proc__info", 9000)
+ judge("cmd__entry", 37000)
+ judge("cmd__return", 37000)
+ judge("cmd__result", 37000)
+ judge("cmd__args", 3700 /* not 37000? */)
+ judge("cmd__info", 37000)
+ judge("inst__start", 542000)
+ judge("inst__done", 542000)
+ judge("obj__create", 723000)
+ judge("obj__free", 704000)
+}
diff --git a/testsuite/systemtap.apps/tcl.exp b/testsuite/systemtap.apps/tcl.exp
new file mode 100644
index 00000000..bfcf2239
--- /dev/null
+++ b/testsuite/systemtap.apps/tcl.exp
@@ -0,0 +1,67 @@
+set test "tcl"
+
+# Test sdt support in tcl.
+
+global env
+
+if {! [info exists env(SYSTEMTAP_TESTAPPS)] || (
+ ! [string match "tcl" $env(SYSTEMTAP_TESTAPPS)] &&
+ ! [string match "all" $env(SYSTEMTAP_TESTAPPS)])} {
+ untested "$test sdt app"
+ return
+}
+
+########## Create /tmp/stap-tcl.stp ##########
+set tclreleasemajor "8.6"
+set tclrelease "8.6b1"
+set tcldir "[pwd]/tcl/install/"
+set testsuite "[pwd]"
+
+verbose -log "Building tcl"
+set test "tcl${tclreleasemajor} build"
+set rc [catch {exec sh $srcdir/$subdir/stap-tcl.sh 2>@ stdout} out]
+if {$rc != 0} {
+ clone_output $out
+ fail $test
+ return
+} else {
+ pass $test
+}
+
+set test "stap-tcl.stp compilation"
+set rc [catch {exec stap -DMAXSKIPPED=8024 -t -p4 $srcdir/$subdir/stap-tcl.stp tcl/install/lib/libtcl${tclreleasemajor}.so} out]
+clone_output $out
+if {$rc != 0} {
+ fail $test
+ return
+} else {
+ pass $test
+}
+
+set test "stap-tcl.stp execution"
+if {![installtest_p]} {
+ untested $test
+ return
+}
+
+set ok 0
+set ko 0
+set lines 0
+spawn stap -DMAXSKIPPED=8024 -t -c "tcl/install/bin/tclsh${tclreleasemajor} tcl/src/tests/all.tcl > tcl-test.out" $srcdir/$subdir/stap-tcl.stp tcl/install/lib/libtcl${tclreleasemajor}.so
+expect {
+ -timeout 1000
+ -re {^OK [^\r\n]*[\r\n]} { incr ok; exp_continue }
+ -re {^KO [^\r\n]*[\r\n]} { incr ko; exp_continue }
+ -re {^ERROR[^\r\n]*[\r\n]} { incr ko; exp_continue }
+ -re {^[^\r\n]*[\r\n]} { incr lines; exp_continue }
+ timeout { fail "$test (timeout)" }
+ eof { }
+}
+catch {close}; catch {wait}
+
+if {$ok == 14 && $ko == 0} {
+ pass "$test ($ok $ko $lines)"
+} else {
+ fail "$test ($ok $ko $lines)"
+}
+
diff --git a/testsuite/systemtap.apps/xulrunner.exp b/testsuite/systemtap.apps/xulrunner.exp
new file mode 100644
index 00000000..be2db0c7
--- /dev/null
+++ b/testsuite/systemtap.apps/xulrunner.exp
@@ -0,0 +1,133 @@
+set test "xulrunner"
+
+# Test sdt support in xulrunner.
+
+global env
+
+if {! [info exists env(SYSTEMTAP_TEST_SDT)]} {
+ unsupported "xulrunner (\"SYSTEMTAP_TEST_SDT\" not in env)"
+ return
+}
+
+########## Create /tmp/stap-xul.stp ##########
+set xulrelease "1.9.1.3"
+set xuldir "[pwd]/xul/"
+set testsuite "[pwd]"
+
+set fp [open "$testsuite/stap-xul.stp" "w"]
+puts $fp "
+global funcinfo
+global objinfo
+
+probe process(@1).mark(\"function__info\")
+{
+ file = user_string (\$arg1)
+ func = user_string (\$arg3)
+ funcinfo\[file,func\] <<< 1
+}
+
+probe process(@1).mark(\"object__create\")
+{
+ file = user_string (\$arg1)
+ class = user_string (\$arg2)
+ objinfo\[file,class\] <<< 1
+}
+
+probe end
+{
+ foreach (\[i,j\] in funcinfo+)
+ {
+ printf (\"probes: %-20s %-25s %d\\n\", substr(i,strlen(i)-20,strlen(i)), j, @count(funcinfo\[i,j\]))
+ }
+ foreach (\[i,j\] in objinfo+)
+ {
+ printf (\"probes: %-20s %-25s %d\\n\", substr(i,strlen(i)-20,strlen(i)), j, @count(funcinfo\[i,j\]))
+ }
+}
+"
+close $fp
+
+########## Begin /tmp/stap-xul.sh ##########
+set fp [open "$testsuite/stap-xul.sh" "w"]
+puts $fp "
+##### begin run_tests #####
+function run_tests \{
+cd $testsuite/xul/bld/js/src
+pwd
+for i in call trace-test math-trace-tests ; do
+$env(SYSTEMTAP_PATH)/stap -c \"./js $xuldir/src/js/src/\$i.js\" $testsuite/stap-xul.stp ./js
+done | tee $testsuite/stap-xul-markers.log
+PROBES=\$(grep 'probes: ' $testsuite/stap-xul-markers.log | wc -l)
+TESTS=\$(grep '-FAIL' $testsuite/stap-xul-markers.log)
+echo PROBES=\$PROBES TESTS=\$TESTS
+
+if \[ \$PROBES -gt 400 \] ; then
+ echo PASS: xulrunner javascript markers \$1
+else
+ echo FAIL: xulrunner javascript markers \$1
+fi
+
+if \[ -z \$TESTS \] ; then
+ echo PASS: xulrunner javascript testsuite \$1
+else
+ echo FAIL: xulrunner javascript testsuite \$1
+fi
+
+\}
+##### end run_tests #####
+
+if \[ ! -r xulrunner-$xulrelease-source.tar \] ; then
+wget ftp://ftp.mozilla.org/pub/mozilla.org/xul/releases/$xulrelease/source/xulrunner-$xulrelease-source.tar.bz2
+bunzip2 xulrunner-$xulrelease-source.tar.bz2
+fi
+
+if \[ ! -d xul/src \] ; then
+tar -x -f xulrunner-$xulrelease-source.tar
+mkdir xul
+xulrelease=$xulrelease
+mv mozilla-\${xulrelease%.\[0-9\]} xul/src
+fi
+
+if \[ ! -f xul/bld/js/src/js \] ; then
+mkdir xul/bld
+cd xul/bld
+if rpm -q java-1.6.0-openjdk ; then :
+else
+ echo FAIL: Need java-1.6.0-openjdk-devel
+ exit
+fi
+JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64 \
+CXXFLAGS='-g -I$env(SYSTEMTAP_INCLUDES)' \
+CFLAGS='-g -I$env(SYSTEMTAP_INCLUDES)' \
+PATH=$env(SYSTEMTAP_PATH)/:\$PATH \
+../src/configure --prefix=$xuldir --enable-dtrace --enable-application=xulrunner
+J=\$(getconf _NPROCESSORS_CONF)
+make -j \$J
+fi
+
+run_tests uprobe
+"
+########## End /tmp/stap-xul.sh ##########
+close $fp
+
+########## /tmp/stap-xul.sh does most of the work ##########
+verbose -log Running xul testsuite
+spawn sh stap-xul.sh 2>&1
+expect {
+ -timeout 10000
+ -re {FAIL: [a-z_ ]+} { regexp " .*$" $expect_out(0,string) s;
+ fail "$s"; exp_continue }
+ -re {PASS: [a-z_ ]+} { regexp " .*$" $expect_out(0,string) s;
+ pass "$s"; exp_continue }
+ -re {UNSUPPORTED: [a-zA-Z_/: ]+} { regexp " .*$" $expect_out(0,string) s;
+ verbose -log "$s"
+ unsupported "$s"; exp_continue }
+ timeout { fail "$test (timeout)" }
+ eof { }
+}
+
+if { $verbose == 0 } {
+catch {exec rm -rf $testsuite/stap-xul.stp xulrunner-$xulrelease-source.tar \
+ $testsuite/stap-xul-markers.log $testsuite/stap-xul.sh }
+catch {exec rm -rf xul}
+}
diff --git a/testsuite/systemtap.base/onoffprobe.exp b/testsuite/systemtap.base/onoffprobe.exp
index 1b39dab5..c6d83d5d 100644
--- a/testsuite/systemtap.base/onoffprobe.exp
+++ b/testsuite/systemtap.base/onoffprobe.exp
@@ -10,9 +10,27 @@ proc advance {} {
global expect_out
global ok
global modname
+ set procfs_file "/proc/systemtap/$modname/switch"
+
pass "$test $expect_out(1,string)"
+
+ # If this is the first time, wait until the procfs file exists
+ # (for up to 10 seconds).
+ if {$ok == 0} {
+ set i 0
+ while {![file exists $procfs_file]} {
+ sleep 1
+ incr i
+ if {$i >= 10} { break }
+ }
+ # If the procfs file still doesn't exist, fail.
+ if {![file exists $procfs_file]} {
+ fail "$test (missing procfs file)"
+ }
+ }
+
incr ok
- exec echo $ok > /proc/systemtap/$modname/switch
+ if {[file exists $procfs_file]} { exec echo $ok > $procfs_file }
exec echo dummy > /dev/null
exp_continue
}
diff --git a/testsuite/systemtap.base/pr10854.exp b/testsuite/systemtap.base/pr10854.exp
new file mode 100644
index 00000000..9173c8b4
--- /dev/null
+++ b/testsuite/systemtap.base/pr10854.exp
@@ -0,0 +1,32 @@
+# This test is to make sure that we've resolved PR10854's race between probe
+# initialization and shutdown. Here we load a module and then kill the stapio
+# process as soon as we can to try to make the init and shutdown overlap.
+
+set test "pr10854"
+
+# precompile the script module
+set compile { exec stap $srcdir/$subdir/$test.stp sys_read *@fs/*.c -p4 }
+if { [catch { set module [eval $compile] } msg ] } {
+ fail "compiling $test.stp: $msg"
+ untested "$test runloop"
+ continue
+} else {
+ pass "compiling $test.stp"
+}
+
+if {![installtest_p]} {
+ untested "$test runloop"
+ continue
+}
+
+# run & kill the module 10 times
+# (this was usually enough to trigger the fault)
+for {set i 0} {$i < 10} {incr i} {
+ spawn staprun $module -o /dev/null
+ while { [catch { exec pkill stapio -P [pid] } msg ] } { }
+ catch { close }
+ wait
+}
+
+# if we're still alive, we pass :)
+pass "$test runloop"
diff --git a/testsuite/systemtap.base/pr10854.stp b/testsuite/systemtap.base/pr10854.stp
new file mode 100644
index 00000000..55f027f2
--- /dev/null
+++ b/testsuite/systemtap.base/pr10854.stp
@@ -0,0 +1,20 @@
+function trace(entry_p) {
+ if(tid() in trace)
+ printf("%s%s%s\n",thread_indent(entry_p),
+ (entry_p>0?"->":"<-"),
+ probefunc())
+}
+
+global trace
+probe kernel.function(@1).call {
+ if (execname() == "staprun") next # skip our own helper process
+ trace[tid()] = 1
+ trace(1)
+}
+probe kernel.function(@1).return {
+ trace(-1)
+ delete trace[tid()]
+}
+
+probe kernel.function(@2).call { trace(1) }
+probe kernel.function(@2).return { trace(-1) }
diff --git a/testsuite/systemtap.context/args.tcl b/testsuite/systemtap.context/args.tcl
index fb8aecb4..c5aed203 100644
--- a/testsuite/systemtap.context/args.tcl
+++ b/testsuite/systemtap.context/args.tcl
@@ -1,6 +1,6 @@
spawn stap $srcdir/$subdir/args.stp
expect {
- -timeout 60
+ -timeout 120
"READY" {
exec echo 1 > /proc/stap_test_cmd
expect {
@@ -51,6 +51,7 @@ expect {
timeout {fail "string function arguments"}
}
}
+ timeout {fail "all args tests - timeout"}
eof {fail "function arguments: unexpected timeout"}
}
exec kill -INT -[exp_pid]
diff --git a/testsuite/systemtap.context/backtrace.tcl b/testsuite/systemtap.context/backtrace.tcl
index 5e7b1536..d436ab5c 100644
--- a/testsuite/systemtap.context/backtrace.tcl
+++ b/testsuite/systemtap.context/backtrace.tcl
@@ -9,7 +9,7 @@ set m6 0
spawn stap $srcdir/$subdir/backtrace.stp
#exp_internal 1
expect {
- -timeout 60
+ -timeout 120
"Systemtap probe: begin\r\n" {
pass "backtrace of begin probe"
exec echo 0 > /proc/stap_test_cmd
diff --git a/testsuite/systemtap.context/num_args.tcl b/testsuite/systemtap.context/num_args.tcl
index 62ac8dd3..d677f849 100644
--- a/testsuite/systemtap.context/num_args.tcl
+++ b/testsuite/systemtap.context/num_args.tcl
@@ -3,7 +3,7 @@ foreach arglist $arglists {
set tag [concat numeric $arglist]
eval spawn stap $arglist $srcdir/$subdir/num_args.stp
expect {
- -timeout 60
+ -timeout 120
"READY" {
exec echo 1 > /proc/stap_test_cmd
expect {
@@ -57,6 +57,7 @@ expect {
-re "semantic error:" {
fail "function arguments -- $tag: compilation failed"
}
+ timeout {fail "all function arguments tests - timeout"}
eof {fail "function arguments -- $tag: unexpected timeout"}
}
exec kill -INT -[exp_pid]
diff --git a/testsuite/systemtap.context/pid.tcl b/testsuite/systemtap.context/pid.tcl
index 70a87345..350a05b2 100644
--- a/testsuite/systemtap.context/pid.tcl
+++ b/testsuite/systemtap.context/pid.tcl
@@ -2,7 +2,7 @@ set tests [list execname pexecname pid ppid tid uid euid gid egid]
spawn stap $srcdir/$subdir/pid.stp
#exp_internal 1
expect {
- -timeout 60
+ -timeout 120
"READY" {
set pid [exec echo 1 > /proc/stap_test_cmd &]
set ppid {[0-9]*}
diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html
index f2b7066f..55fea0fb 100644
--- a/testsuite/systemtap.examples/index.html
+++ b/testsuite/systemtap.examples/index.html
@@ -169,6 +169,9 @@ keywords: <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <br>
<li><a href="process/pf2.stp">process/pf2.stp</a> - Profile kernel functions<br>
keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
<p>The pf2.stp script sets up time-based sampling. Every five seconds it prints out a sorted list with the top ten kernel functions with samples.</p></li>
+<li><a href="process/plimit.stp">process/plimit.stp</a> - print resource limits<br>
+keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <br>
+<p>The script prints a variety of resource limits for a given pid, like /proc/$$/limits on recent kernels.</p></li>
<li><a href="process/schedtimes.stp">process/schedtimes.stp</a> - Track Time Processes Spend in Various States using Tracepoints<br>
keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
<p>The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends running, sleeping, queued, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.</p></li>
diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt
index e880c746..16b45aac 100644
--- a/testsuite/systemtap.examples/index.txt
+++ b/testsuite/systemtap.examples/index.txt
@@ -407,6 +407,13 @@ keywords: profiling
samples.
+process/plimit.stp - print resource limits
+keywords: process
+
+ The script prints a variety of resource limits for a given pid, like
+ /proc/$$/limits on recent kernels.
+
+
process/schedtimes.stp - Track Time Processes Spend in Various States using Tracepoints
keywords: process scheduler time tracepoint
diff --git a/testsuite/systemtap.examples/io/traceio2.stp b/testsuite/systemtap.examples/io/traceio2.stp
index 1abea45d..797f3062 100755
--- a/testsuite/systemtap.examples/io/traceio2.stp
+++ b/testsuite/systemtap.examples/io/traceio2.stp
@@ -1,6 +1,6 @@
#! /usr/bin/env stap
-global device_of_interest, dev
+global device_of_interest
probe begin {
/* The following is not the most efficient way to do this.
diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html
index f09a20b3..1a2855e1 100644
--- a/testsuite/systemtap.examples/keyword-index.html
+++ b/testsuite/systemtap.examples/keyword-index.html
@@ -297,6 +297,9 @@ keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-inde
<li><a href="process/forktracker.stp">process/forktracker.stp</a> - Trace Creation of Processes<br>
keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <br>
<p>The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful for determine what process is creating a flurry of short-lived processes.</p></li>
+<li><a href="process/plimit.stp">process/plimit.stp</a> - print resource limits<br>
+keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <br>
+<p>The script prints a variety of resource limits for a given pid, like /proc/$$/limits on recent kernels.</p></li>
<li><a href="process/schedtimes.stp">process/schedtimes.stp</a> - Track Time Processes Spend in Various States using Tracepoints<br>
keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-index.html#SCHEDULER">SCHEDULER</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#TRACEPOINT">TRACEPOINT</a> <br>
<p>The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends running, sleeping, queued, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.</p></li>
diff --git a/testsuite/systemtap.examples/keyword-index.txt b/testsuite/systemtap.examples/keyword-index.txt
index 853198d3..6de9c330 100644
--- a/testsuite/systemtap.examples/keyword-index.txt
+++ b/testsuite/systemtap.examples/keyword-index.txt
@@ -605,6 +605,13 @@ keywords: process scheduler
determine what process is creating a flurry of short-lived processes.
+process/plimit.stp - print resource limits
+keywords: process
+
+ The script prints a variety of resource limits for a given pid, like
+ /proc/$$/limits on recent kernels.
+
+
process/schedtimes.stp - Track Time Processes Spend in Various States using Tracepoints
keywords: process scheduler time tracepoint
diff --git a/testsuite/systemtap.examples/process/plimit.meta b/testsuite/systemtap.examples/process/plimit.meta
new file mode 100644
index 00000000..d5cd4e8b
--- /dev/null
+++ b/testsuite/systemtap.examples/process/plimit.meta
@@ -0,0 +1,7 @@
+title: print resource limits
+name: plimit.stp
+keywords: process
+subsystem: general
+description: The script prints a variety of resource limits for a given pid, like /proc/$$/limits on recent kernels.
+test_check: stap -gp4 plimit.stp $$
+test_installcheck: stap -g plimit.stp $$
diff --git a/testsuite/systemtap.examples/process/plimit.stp b/testsuite/systemtap.examples/process/plimit.stp
new file mode 100755
index 00000000..1a389468
--- /dev/null
+++ b/testsuite/systemtap.examples/process/plimit.stp
@@ -0,0 +1,78 @@
+#!/usr/bin/env stap
+# plimit.stp
+# Copyright (C) 2006 Red Hat, Inc., Eugene Teo <eteo@redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+
+%{
+ #include <linux/sched.h>
+ #include <linux/list.h>
+%}
+
+function getrlimit:string (rlim:long, pid:long) %{ /* pure */
+ struct task_struct *p;
+ struct list_head *_p, *_n;
+ static char cur_buf[24], max_buf[24];
+ long int cur, max;
+
+ list_for_each_safe(_p, _n, &current->tasks) {
+ p = list_entry(_p, struct task_struct, tasks);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
+ cur = p->signal->rlim[THIS->rlim].rlim_cur;
+ max = p->signal->rlim[THIS->rlim].rlim_max;
+#else
+ cur = p->rlim[THIS->rlim].rlim_cur;
+ max = p->rlim[THIS->rlim].rlim_max;
+#endif
+ if (p->pid == (int)THIS->pid) {
+ if (cur == -1 && max == -1)
+ strcat(THIS->__retvalue, "unlimited unlimited");
+ else if (cur == -1)
+ snprintf(THIS->__retvalue, MAXSTRINGLEN, "%-9s %-9ld",
+ "unlimited", max);
+ else if (max == -1)
+ snprintf(THIS->__retvalue, MAXSTRINGLEN, "%-9ld %-9s",
+ cur, "unlimited");
+ else
+ snprintf(THIS->__retvalue, MAXSTRINGLEN, "%-9ld %-9ld",
+ cur, max);
+ }
+ }
+%}
+
+function task_execname_by_pid:string (pid:long) %{ /* pure */
+ struct task_struct *p;
+ struct list_head *_p, *_n;
+ list_for_each_safe(_p, _n, &current->tasks) {
+ p = list_entry(_p, struct task_struct, tasks);
+ if (p->pid == (int)THIS->pid)
+ snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", p->comm);
+ }
+%}
+
+probe begin
+{
+ printf("%d: -%s\n", $1, task_execname_by_pid($1))
+ /* include/asm-generic/resource.h */
+ printf(" resource current maximum\n")
+ printf("coredump(blocks) %s\n", getrlimit(4, $1))
+ printf("data(bytes) %s\n", getrlimit(2, $1))
+ printf("max nice %s\n", getrlimit(13, $1))
+ printf("file size(blocks) %s\n", getrlimit(1, $1))
+ printf("pending signals %s\n", getrlimit(11, $1))
+ printf("max locked memory(bytes) %s\n", getrlimit(8, $1))
+ printf("max memory size(bytes) %s\n", getrlimit(5, $1))
+ printf("open files %s\n", getrlimit(7, $1))
+ printf("POSIX message queues(bytes) %s\n", getrlimit(12, $1))
+ printf("max rt priority %s\n", getrlimit(14, $1))
+ printf("stack size(bytes) %s\n", getrlimit(3, $1))
+ printf("cpu time(seconds) %s\n", getrlimit(0, $1))
+ printf("max user processes %s\n", getrlimit(6, $1))
+ printf("virtual memory(bytes) %s\n", getrlimit(9, $1))
+ printf("file locks %s\n", getrlimit(10, $1))
+
+ exit()
+}
diff --git a/testsuite/systemtap.syscall/README b/testsuite/systemtap.syscall/README
index 480bd8cd..836ac747 100644
--- a/testsuite/systemtap.syscall/README
+++ b/testsuite/systemtap.syscall/README
@@ -18,6 +18,9 @@ is expected, put "NNNN" (for decimal) or "XXXX" (for hex). Or you can
just write regular expressions. The "NNNN" and "XXXX" are just shorthand to
aid readability and are converted to regular expressions in test.tcl.
+Normally opening and closing parentheses ('(' and ')') get quoted. If
+you want unquoted parentheses, use '[[[[' (for '(') or ']]]]' (for ')').
+
3. Somewhere is your test program puts a comment line like this:
/* COVERAGE: syscall1 syscall2 ... */
where you list the systemcalls that are tested. Then you can run
diff --git a/testsuite/systemtap.syscall/chmod.c b/testsuite/systemtap.syscall/chmod.c
index 724b86c4..ce18b3d0 100644
--- a/testsuite/systemtap.syscall/chmod.c
+++ b/testsuite/systemtap.syscall/chmod.c
@@ -11,7 +11,7 @@ int main()
int fd;
fd = open("foobar",O_WRONLY|O_CREAT, 0666);
- //staptest// open ("foobar", O_WRONLY|O_CREAT, 0666) = NNNN
+ //staptest// open ("foobar", O_WRONLY|O_CREAT[[[[.O_LARGEFILE]]]]?, 0666) = NNNN
chmod("foobar", 0644);
//staptest// chmod ("foobar", 0644)
diff --git a/testsuite/systemtap.syscall/dir.c b/testsuite/systemtap.syscall/dir.c
index 3eda8175..f5b9f320 100644
--- a/testsuite/systemtap.syscall/dir.c
+++ b/testsuite/systemtap.syscall/dir.c
@@ -20,7 +20,7 @@ int main()
//staptest// chdir ("..") = 0
fd = open("foobar", O_RDONLY);
- //staptest// open ("foobar", O_RDONLY) = NNNN
+ //staptest// open ("foobar", O_RDONLY[[[[.O_LARGEFILE]]]]?) = NNNN
fchdir(fd);
//staptest// fchdir (NNNN) = 0
@@ -35,7 +35,7 @@ int main()
//staptest// rmdir ("foobar") = 0
fd = open(".", O_RDONLY);
- //staptest// open (".", O_RDONLY) = NNNN
+ //staptest// open (".", O_RDONLY[[[[.O_LARGEFILE]]]]?) = NNNN
#ifdef SYS_mkdirat
mkdirat(fd, "xyzzy", 0765);
diff --git a/testsuite/systemtap.syscall/mmap.c b/testsuite/systemtap.syscall/mmap.c
index 13145fb2..a09888b4 100644
--- a/testsuite/systemtap.syscall/mmap.c
+++ b/testsuite/systemtap.syscall/mmap.c
@@ -13,14 +13,14 @@ int main()
/* create a file with something in it */
fd = open("foobar",O_WRONLY|O_CREAT|O_TRUNC, 0600);
- //staptest// open ("foobar", O_WRONLY|O_CREAT|O_TRUNC, 0600) = NNNN
+ //staptest// open ("foobar", O_WRONLY|O_CREAT[[[[.O_LARGEFILE]]]]?|O_TRUNC, 0600) = NNNN
lseek(fd, 1024, SEEK_SET);
write(fd, "abcdef", 6);
close(fd);
//staptest// close (NNNN) = 0
fd = open("foobar", O_RDONLY);
- //staptest// open ("foobar", O_RDONLY) = NNNN
+ //staptest// open ("foobar", O_RDONLY[[[[.O_LARGEFILE]]]]?) = NNNN
/* stat for file size */
ret = fstat(fd, &fs);
diff --git a/testsuite/systemtap.syscall/net1.c b/testsuite/systemtap.syscall/net1.c
index f8079ffd..b7f1d6cb 100644
--- a/testsuite/systemtap.syscall/net1.c
+++ b/testsuite/systemtap.syscall/net1.c
@@ -32,7 +32,7 @@ int main()
//staptest// listen (NNNN, 7) = 0
cfd = accept(listenfd, (struct sockaddr *)NULL, NULL);
- //staptest// accept (NNNN, 0x[0]+, 0x[0]+) = -NNNN (EAGAIN)
+ //staptest// accept (NNNN, 0x[0]+, 0x[0]+, 0) = -NNNN (EAGAIN)
close(cfd);
close(listenfd);
diff --git a/testsuite/systemtap.syscall/openclose.c b/testsuite/systemtap.syscall/openclose.c
index cb003a9e..aeabbe19 100644
--- a/testsuite/systemtap.syscall/openclose.c
+++ b/testsuite/systemtap.syscall/openclose.c
@@ -13,46 +13,46 @@ int main()
int fd1, fd2;
fd2 = creat("foobar1",S_IREAD|S_IWRITE);
- //staptest// open ("foobar1", O_WRONLY|O_CREAT|O_TRUNC, 0600) = NNNN
+ //staptest// open ("foobar1", O_WRONLY|O_CREAT[[[[.O_LARGEFILE]]]]?|O_TRUNC, 0600) = NNNN
fd1 = open("foobar2",O_WRONLY|O_CREAT, S_IRWXU);
- //staptest// open ("foobar2", O_WRONLY|O_CREAT, 0700) = NNNN
+ //staptest// open ("foobar2", O_WRONLY|O_CREAT[[[[.O_LARGEFILE]]]]?, 0700) = NNNN
close(fd1);
//staptest// close (NNNN) = 0
fd1 = open("foobar2",O_RDONLY);
- //staptest// open ("foobar2", O_RDONLY) = NNNN
+ //staptest// open ("foobar2", O_RDONLY[[[[.O_LARGEFILE]]]]?) = NNNN
close(fd1);
//staptest// close (NNNN) = 0
fd1 = open("foobar2",O_RDWR);
- //staptest// open ("foobar2", O_RDWR) = NNNN
+ //staptest// open ("foobar2", O_RDWR[[[[.O_LARGEFILE]]]]?) = NNNN
close(fd1);
//staptest// close (NNNN) = 0
fd1 = open("foobar2",O_APPEND|O_WRONLY);
- //staptest// open ("foobar2", O_WRONLY|O_APPEND) = NNNN
+ //staptest// open ("foobar2", O_WRONLY|O_APPEND[[[[.O_LARGEFILE]]]]?) = NNNN
close(fd1);
//staptest// close (NNNN) = 0
fd1 = open("foobar2",O_DIRECT|O_RDWR);
- //staptest// open ("foobar2", O_RDWR|O_DIRECT) = NNNN
+ //staptest// open ("foobar2", O_RDWR|O_DIRECT[[[[.O_LARGEFILE]]]]?) = NNNN
close(fd1);
//staptest// close (NNNN) = 0
fd1 = open("foobar2",O_NOATIME|O_SYNC|O_RDWR);
- //staptest// open ("foobar2", O_RDWR|O_NOATIME|O_SYNC) = NNNN
+ //staptest// open ("foobar2", O_RDWR[[[[.O_LARGEFILE]]]]?|O_NOATIME|O_SYNC) = NNNN
close(fd1);
//staptest// close (NNNN) = 0
/* Now test some bad opens */
fd1 = open("/",O_WRONLY);
- //staptest// open ("/", O_WRONLY) = -NNNN (EISDIR)
+ //staptest// open ("/", O_WRONLY[[[[.O_LARGEFILE]]]]?) = -NNNN (EISDIR)
close (fd1);
//staptest// close (NNNN) = -NNNN (EBADF)
fd1 = open("foobar2",O_WRONLY|O_CREAT|O_EXCL, S_IRWXU);
- //staptest// open ("foobar2", O_WRONLY|O_CREAT|O_EXCL, 0700) = -NNNN (EEXIST)
+ //staptest// open ("foobar2", O_WRONLY|O_CREAT|O_EXCL[[[[.O_LARGEFILE]]]]?, 0700) = -NNNN (EEXIST)
return 0;
}
diff --git a/testsuite/systemtap.syscall/readwrite.c b/testsuite/systemtap.syscall/readwrite.c
index bd0914cc..d966c0a8 100644
--- a/testsuite/systemtap.syscall/readwrite.c
+++ b/testsuite/systemtap.syscall/readwrite.c
@@ -26,7 +26,7 @@ int main()
v[2].iov_len = sizeof(STRING3);
fd = open("foobar1",O_WRONLY|O_CREAT, 0666);
- //staptest// open ("foobar1", O_WRONLY|O_CREAT, 0666) = NNNN
+ //staptest// open ("foobar1", O_WRONLY|O_CREAT[[[[.O_LARGEFILE]]]]?, 0666) = NNNN
write(fd,"Hello world", 11);
//staptest// write (NNNN, "Hello world", 11) = 11
@@ -66,7 +66,7 @@ int main()
close (fd);
fd = open("foobar1",O_RDONLY);
- //staptest// open ("foobar1", O_RDONLY) = NNNN
+ //staptest// open ("foobar1", O_RDONLY[[[[.O_LARGEFILE]]]]?) = NNNN
read(fd, buf, 11);
//staptest// read (NNNN, XXXX, 11) = 11
diff --git a/testsuite/systemtap.syscall/stat.c b/testsuite/systemtap.syscall/stat.c
index d47c1440..20a66b09 100644
--- a/testsuite/systemtap.syscall/stat.c
+++ b/testsuite/systemtap.syscall/stat.c
@@ -20,7 +20,7 @@ int main()
//staptest// getcwd (XXXX, 128) = NNNN
fd = creat("foobar",S_IREAD|S_IWRITE);
- //staptest// open ("foobar", O_WRONLY|O_CREAT|O_TRUNC, 0600) = NNNN
+ //staptest// open ("foobar", O_WRONLY|O_CREAT[[[[.O_LARGEFILE]]]]?|O_TRUNC, 0600) = NNNN
fstat(fd, &sbuf);
//staptest// fstat (NNNN, XXXX) = 0
diff --git a/testsuite/systemtap.syscall/sys.stp b/testsuite/systemtap.syscall/sys.stp
index e3564a15..79c7ff57 100755
--- a/testsuite/systemtap.syscall/sys.stp
+++ b/testsuite/systemtap.syscall/sys.stp
@@ -1,4 +1,4 @@
-global indent, indent_str, entry
+global indent, indent_str, entry_p
probe begin {
indent = 0
@@ -13,22 +13,22 @@ probe begin {
probe syscall.* ? {
if (pid() == target()) {
- if (entry) printf("\n")
+ if (entry_p) printf("\n")
printf("%s%s: %s (%s) = ", indent_str[indent], execname(), name, argstr)
# printf("%s%s: %s (%s) = ", indent_str[indent], execname(), probefunc(), argstr)
indent++
- entry = 1
+ entry_p = 1
}
}
probe syscall.*.return ? {
if (pid() == target()) {
if (indent) indent--
- if (entry)
+ if (entry_p)
printf("%s\n", retstr)
else
printf("%s%s\n", indent_str[indent],retstr)
- entry = 0
+ entry_p = 0
}
}
diff --git a/testsuite/systemtap.syscall/test-debug.tcl b/testsuite/systemtap.syscall/test-debug.tcl
index eb730459..3eb6bbf0 100755
--- a/testsuite/systemtap.syscall/test-debug.tcl
+++ b/testsuite/systemtap.syscall/test-debug.tcl
@@ -50,9 +50,20 @@ foreach line [split $output "\n"] {
if {[regsub {//} $line {} line]} {
set line "$testname: [string trimleft $line]"
+ # We need to quote all these metacharacters
regsub -all {\(} $line {\\(} line
regsub -all {\)} $line {\\)} line
regsub -all {\|} $line {\|} line
+ # + and * are metacharacters, but should always be used
+ # as metacharacters in the expressions, don't escape them.
+ #regsub -all {\+} $line {\\+} line
+ #regsub -all {\*} $line {\\*} line
+
+ # Turn '[[[[' and ']]]]' into '(' and ')' respectively.
+ # Because normally parens get quoted, this allows us to
+ # have non-quoted parens.
+ regsub -all {\[\[\[\[} $line {(} line
+ regsub -all {\]\]\]\]} $line {)} line
regsub -all NNNN $line {[\-0-9]+} line
regsub -all XXXX $line {[x0-9a-fA-F]+} line
diff --git a/testsuite/systemtap.syscall/test.tcl b/testsuite/systemtap.syscall/test.tcl
index b9d3c0d9..e640db66 100755
--- a/testsuite/systemtap.syscall/test.tcl
+++ b/testsuite/systemtap.syscall/test.tcl
@@ -67,6 +67,12 @@ proc run_one_test {filename flags bits} {
#regsub -all {\+} $line {\\+} line
#regsub -all {\*} $line {\\*} line
+ # Turn '[[[[' and ']]]]' into '(' and ')' respectively.
+ # Because normally parens get quoted, this allows us to
+ # have non-quoted parens.
+ regsub -all {\[\[\[\[} $line {(} line
+ regsub -all {\]\]\]\]} $line {)} line
+
regsub -all NNNN $line {[\-0-9]+} line
regsub -all XXXX $line {[x0-9a-fA-F]+} line
diff --git a/testsuite/transko/varargs.stp b/testsuite/transko/varargs.stp
new file mode 100755
index 00000000..f38309ad
--- /dev/null
+++ b/testsuite/transko/varargs.stp
@@ -0,0 +1,10 @@
+#! stap -p3
+
+probe begin {
+ // PR10750 enforces at most 32 print args
+ println(1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32,
+ 33)
+}
diff --git a/testsuite/transok/varargs.stp b/testsuite/transok/varargs.stp
new file mode 100755
index 00000000..216166f6
--- /dev/null
+++ b/testsuite/transok/varargs.stp
@@ -0,0 +1,9 @@
+#! stap -p3
+
+probe begin {
+ // PR10750 enforces at most 32 print args
+ println(1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32)
+}