From 2c279bc4231e44dba80e5fdb10aa1626e412eab3 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sat, 31 Oct 2009 13:54:41 -0400 Subject: reorganize app tests; rewrite tcl as sample of improvements * testsuite/configure.ac (--enable-testapps): New option. * testsuite/Makefile.am (TESTAPPS): Pass to dejagnu. * testsuite/systemtap.base/{xulrunner,tcl,mysql,postgres}: Moved under new systemtap.apps/ subdirectory. * testsuite/systemtap.apps/stap-tcl.sh: New file to build tcl. * testsuite/systemtap.apps/stap-tcl.stp: New file to test tcl. * testsuite/systemtap.apps/tcl.exp: New simplified test driver. * dtrace.in: Disable STAP_HAS_SEMAPHORES as they don't work on shlibs yet. * includes/sys/sdt.h (STAP_SEMAPHORE): Include __builtin_expect for unlikely. --- dtrace.in | 2 +- includes/sys/sdt.h | 2 +- testsuite/Makefile.am | 4 +- testsuite/Makefile.in | 4 +- testsuite/configure | 20 ++ testsuite/configure.ac | 12 ++ testsuite/systemtap.apps/mysql.exp | 344 +++++++++++++++++++++++++++++++++ testsuite/systemtap.apps/postgres.exp | 166 ++++++++++++++++ testsuite/systemtap.apps/stap-tcl.sh | 25 +++ testsuite/systemtap.apps/stap-tcl.stp | 30 +++ testsuite/systemtap.apps/tcl.exp | 67 +++++++ testsuite/systemtap.apps/xulrunner.exp | 133 +++++++++++++ testsuite/systemtap.base/mysql.exp | 344 --------------------------------- testsuite/systemtap.base/postgres.exp | 166 ---------------- testsuite/systemtap.base/tcl.exp | 165 ---------------- testsuite/systemtap.base/xulrunner.exp | 133 ------------- 16 files changed, 804 insertions(+), 813 deletions(-) create mode 100644 testsuite/systemtap.apps/mysql.exp create mode 100644 testsuite/systemtap.apps/postgres.exp create mode 100644 testsuite/systemtap.apps/stap-tcl.sh create mode 100644 testsuite/systemtap.apps/stap-tcl.stp create mode 100644 testsuite/systemtap.apps/tcl.exp create mode 100644 testsuite/systemtap.apps/xulrunner.exp delete mode 100644 testsuite/systemtap.base/mysql.exp delete mode 100644 testsuite/systemtap.base/postgres.exp delete mode 100644 testsuite/systemtap.base/tcl.exp delete mode 100644 testsuite/systemtap.base/xulrunner.exp diff --git a/dtrace.in b/dtrace.in index d147addb..74d70e77 100755 --- a/dtrace.in +++ b/dtrace.in @@ -46,7 +46,7 @@ class provider: self.f = open(provider) self.h = open(header,mode='w') self.h.write("/* Generated by the Systemtap dtrace wrapper */\n") - self.h.write("\n#define STAP_HAS_SEMAPHORES 1\n\n") + # self.h.write("\n#define STAP_HAS_SEMAPHORES 1\n\n") self.h.write("\n#include \n\n") in_comment = False typedefs = "" diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h index d31d7326..3847c497 100644 --- a/includes/sys/sdt.h +++ b/includes/sys/sdt.h @@ -42,7 +42,7 @@ #if defined STAP_HAS_SEMAPHORES && defined EXPERIMENTAL_UTRACE_SDT #define STAP_SEMAPHORE(probe) \ - if ( probe ## _semaphore ) + if (__builtin_expect ( probe ## _semaphore , 0)) #else #define STAP_SEMAPHORE(probe) #endif 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 7358bd2c..3853cdd4 100644 --- a/testsuite/Makefile.in +++ b/testsuite/Makefile.in @@ -95,6 +95,7 @@ datarootdir = @datarootdir@ dejazilla = @dejazilla@ docdir = @docdir@ dvidir = @dvidir@ +enable_testapps = @enable_testapps@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ @@ -122,6 +123,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 @@ -134,7 +136,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/configure b/testsuite/configure index 5e75929c..d64ca089 100755 --- a/testsuite/configure +++ b/testsuite/configure @@ -602,6 +602,7 @@ PACKAGE_BUGREPORT='systemtap@sources.redhat.com' ac_subst_vars='LTLIBOBJS LIBOBJS +enable_testapps dejazilla MAINT MAINTAINER_MODE_FALSE @@ -671,6 +672,7 @@ ac_user_opts=' enable_option_checking enable_maintainer_mode enable_dejazilla +enable_testapps ' ac_precious_vars='build_alias host_alias @@ -1308,6 +1310,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 + markers Report bugs to . _ACEOF @@ -2317,6 +2322,21 @@ $as_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 + +{ $as_echo "$as_me:$LINENO: Will test ${enable_testapps-none} from: $apps" >&5 +$as_echo "$as_me: Will test ${enable_testapps-none} from: $apps" >&6;} + + ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF diff --git a/testsuite/configure.ac b/testsuite/configure.ac index 5166d226..bc5aed17 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 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.apps/mysql.exp b/testsuite/systemtap.apps/mysql.exp new file mode 100644 index 00000000..efeffbae --- /dev/null +++ b/testsuite/systemtap.apps/mysql.exp @@ -0,0 +1,344 @@ +set test "mysql" + +# Test sdt support in mysql. + +global env + +if {! [info exists env(SYSTEMTAP_TEST_SDT)]} { + unsupported "mysql (\"SYSTEMTAP_TEST_SDT\" not in env)" + return +} + +########## Create /tmp/stap-mysql.stp ########## +set msdata "[pwd]/stap-mysql" +set mysqlrelease "mysql-5.4.1-beta" +set mysqldir "[pwd]/mysql/install/" +set testsuite "[pwd]" + +set fp [open "$testsuite/stap-mysql.stp" "w"] +puts $fp " +probe process(@1).mark(\"connection__start\") +{ + arg2 = user_string(\$arg2) + arg3 = user_string(\$arg3) + printf(\"%s %#x %s %s\\n\",\"connection__start\", \$arg1, arg2, arg3); +} +probe process(@1).mark(\"connection__done\") +{ + printf(\"%s %#x %#x \\n\",\"connection__done\", \$arg1, \$arg2); +} +probe process(@1).mark(\"command__start\") +{ + arg3 = user_string(\$arg3) + arg4 = user_string(\$arg4) + printf(\"%s %#x %#x %s %s\\n\",\"command__start\", \$arg1, \$arg2, arg3, arg4); +} +probe process(@1).mark(\"command__done\") +{ + printf(\"%s %#x\\n\",\"command__done\", \$arg1); +} +probe process(@1).mark(\"query__start\") +{ + arg1 = user_string(\$arg1) + arg3 = user_string(\$arg3) + arg4 = user_string(\$arg4) + arg5 = user_string(\$arg5) + printf(\"%s %s %#x %s %s %s\\n\",\"query__start\", arg1, \$arg2, + arg3, arg4, arg5); +} +probe process(@1).mark(\"query__done\") +{ + printf(\"%s %#x\\n\",\"query__done\", \$arg1); +} +probe process(@1).mark(\"query__parse__start\") +{ + arg1 = user_string(\$arg1) + printf(\"%s %s\\n\",\"query__parse__start\", arg1); +} +probe process(@1).mark(\"query__parse__done\") +{ + printf(\"%s %#x\\n\",\"query__parse__done\", \$arg1); +} +probe process(@1).mark(\"query__cache__hit\") +{ + arg1=user_string(\$arg1) + arg2=user_string(\$arg2) + printf(\"%s %s %s \\n\",\"query__cache__hit\", arg1, arg2); +} +probe process(@1).mark(\"query__cache__miss\") +{ + arg1=user_string(\$arg1) + printf(\"%s %s\\n\",\"query__cache__miss\", arg1); +} +probe process(@1).mark(\"query__exec__start\") +{ + arg1=user_string(\$arg1) + arg3=user_string(\$arg3) + arg4=user_string(\$arg4) + arg5=user_string(\$arg5) + printf(\"%s %s %#x %s %s %s\\n\",\"query__exec__start\", arg1, \$arg2, + arg3, arg4, arg5); +} +probe process(@1).mark(\"query__exec__done\") +{ + printf(\"%s %#x\\n\",\"query__exec__done\", \$arg1); +} +probe process(@1).mark(\"insert__row__start\") +{ + arg1=user_string(\$arg1) + arg2=user_string(\$arg2) + printf(\"%s %s %s \\n\",\"insert__row__start\", arg1, arg2); +} +probe process(@1).mark(\"insert__row__done\") +{ + printf(\"%s %#x\\n\",\"insert__row__done\", \$arg1); +} +probe process(@1).mark(\"update__row__start\") +{ + arg1=user_string(\$arg1) + arg2=user_string(\$arg2) + printf(\"%s %s %s \\n\",\"update__row__start\", arg1, arg2); +} +probe process(@1).mark(\"update__row__done\") +{ + printf(\"%s %#x\\n\",\"update__row__done\", \$arg1); +} +probe process(@1).mark(\"delete__row__start\") +{ + arg1=user_string(\$arg1) + arg2=user_string(\$arg2) + printf(\"%s %s %s \\n\",\"delete__row__start\", arg1, arg2); +} +probe process(@1).mark(\"delete__row__done\") +{ + printf(\"%s %#x\\n\",\"delete__row__done\", \$arg1); +} +probe process(@1).mark(\"handler__rdlock__start\") +{ + arg1=user_string(\$arg1) + arg2=user_string(\$arg2) + printf(\"%s %s %s \\n\",\"handler__rdlock__start\", arg1, arg2); +} +probe process(@1).mark(\"handler__wrlock__start\") +{ + arg1=user_string(\$arg1) + arg2=user_string(\$arg2) + printf(\"%s %s %s \\n\",\"handler__wrlock__start\", arg1, arg2); +} +probe process(@1).mark(\"handler__unlock__start\") +{ + arg1=user_string(\$arg1) + arg2=user_string(\$arg2) + printf(\"%s %s %s \\n\",\"handler__unlock__start\", arg1, arg2); +} +probe process(@1).mark(\"handler__rdlock__done\") +{ + printf(\"%s %#x\\n\",\"handler__rdlock__done\", \$arg1); +} +probe process(@1).mark(\"handler__wrlock__done\") +{ + printf(\"%s %#x\\n\",\"handler__wrlock__done\", \$arg1); +} +probe process(@1).mark(\"handler__unlock__done\") +{ + printf(\"%s %#x\\n\",\"handler__unlock__done\", \$arg1); +} +probe process(@1).mark(\"filesort__start\") +{ + printf(\"%s %#x %#x \\n\",\"filesort__start\", \$arg1, \$arg2); +} +probe process(@1).mark(\"filesort__done\") +{ + printf(\"%s %#x %#x \\n\",\"filesort__done\", \$arg1, \$arg2); +} +probe process(@1).mark(\"select__start\") +{ + arg1=user_string(\$arg1) + printf(\"%s %s\\n\",\"select__start\", arg1); +} +probe process(@1).mark(\"select__done\") +{ + printf(\"%s %#x %#x \\n\",\"select__done\", \$arg1, \$arg2); +} +probe process(@1).mark(\"insert__start\") +{ + arg1=user_string(\$arg1) + printf(\"%s %s\\n\",\"insert__start\", arg1); +} +probe process(@1).mark(\"insert__done\") +{ + printf(\"%s %#x %#x \\n\",\"insert__done\", \$arg1, \$arg2); +} +probe process(@1).mark(\"insert__select__start\") +{ + arg1=user_string(\$arg1) + printf(\"%s %s\\n\",\"insert__select__start\", arg1); +} +probe process(@1).mark(\"insert__select__done\") +{ + printf(\"%s %#x %#x \\n\",\"insert__select__done\", \$arg1, \$arg2); +} +probe process(@1).mark(\"update__start\") +{ + arg1=user_string(\$arg1) + printf(\"%s %s\\n\",\"update__start\", arg1); +} +probe process(@1).mark(\"update__done\") +{ + printf(\"%s %#x %#x %#x\\n\",\"update__done\", \$arg1, \$arg2, \$arg3); +} +probe process(@1).mark(\"multi__update__start\") +{ + arg1=user_string(\$arg1) + printf(\"%s %s\\n\",\"multi__update__start\", arg1); +} +probe process(@1).mark(\"multi__update__done\") +{ + printf(\"%s %#x %#x %#x\\n\",\"multi__update__done\", \$arg1, \$arg2, \$arg3); +} +probe process(@1).mark(\"delete__start\") +{ + arg1=user_string(\$arg1) + printf(\"%s %s\\n\",\"delete__start\", arg1); +} +probe process(@1).mark(\"delete__done\") +{ + printf(\"%s %#x %#x \\n\",\"delete__done\", \$arg1, \$arg2); +} +probe process(@1).mark(\"multi__delete__start\") +{ + arg1=user_string(\$arg1) + printf(\"%s %s\\n\",\"multi__delete__start\", arg1); +} +probe process(@1).mark(\"multi__delete__done\") +{ + printf(\"%s %#x %#x \\n\",\"multi__delete__done\", \$arg1, \$arg2); +} +probe process(@1).mark(\"net__read__start\") +{ + printf(\"%s \\n\",\"net__read__start\"); +} +probe process(@1).mark(\"net__read__done\") +{ + printf(\"%s %#x %#x \\n\",\"net__read__done\", \$arg1, \$arg2); +} +probe process(@1).mark(\"net__write__start\") +{ + printf(\"%s %#x\\n\",\"net__write__start\", \$arg1); +} +probe process(@1).mark(\"net__write__done\") +{ + printf(\"%s %#x\\n\",\"net__write__done\", \$arg1); +} +" +close $fp + +########## Begin /tmp/stap-mysql.sh ########## +set fp [open "$testsuite/stap-mysql.sh" "w"] +puts $fp " +##### begin run_tests ##### +function run_tests \{ +/bin/rm -rf $testsuite/stap-mysql +$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/ //') +$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 + if $mysqldir/bin/mysqladmin ping --socket=$msdata/mysql.sock + then break; + fi + sleep 5 +done + +for i in select join insert query +do + echo '##### ' \$i + ./mysql-test-run.pl --force --extern socket=$msdata/mysql.sock \ + --tmpdir=/tmp/,mysql --vardir=/tmp/,mysql --do-test=\$i +done > $testsuite/stap-mysql.log +) + +ACQUIRE=\$(grep 'handler__unlock__start' $testsuite/stap-mysql-markers.log | wc -l) +RELEASE=\$(grep 'handler__unlock__done' $testsuite/stap-mysql-markers.log | wc -l) +COMMAND=\$(grep 'command__start' $testsuite/stap-mysql-markers.log | wc -l) +QUERY=\$(grep 'query__start' $testsuite/stap-mysql-markers.log | wc -l) +RDLOCK=\$(grep 'handler__rdlock__start' $testsuite/stap-mysql-markers.log | wc -l) +SELECT=\$(grep 'select_start' $testsuite/stap-mysql-markers.log | wc -l) +OKAY=\$(grep 'All.*tests were successful' $testsuite/stap-mysql.log | wc -l) + +echo ACQUIRE=\$ACQUIRE RELEASE=\$RELEASE COMMAND=\$COMMAND QUERY=\$QUERY RDLOCK=\$RDLOCK SELECT=\$SELECT OKAY=\$OKAY +if \[ \$ACQUIRE -gt 10000 -a \$RELEASE -gt 1000 -a \$COMMAND -gt 12000 -a \$QUERY -gt 13000 -a \$RDLOCK -gt 3000 \] ; then + echo PASS: mysql markers \$1 +else + echo FAIL: mysql markers \$1 +fi + +if \[ \$OKAY -eq 4 \] ; then + echo PASS: mysql tests \$1 +else + echo FAIL: mysql tests \$1 +fi + +$mysqldir/bin/mysqladmin shutdown -u root --socket=stap-mysql/mysql.sock +kill \$STAPPID +\} +##### end run_tests ##### + +if \[ ! -r $mysqlrelease.tar.gz \] ; then +wget http://dev.mysql.com/get/Downloads/MySQL-5.4/$mysqlrelease.tar.gz/from/ftp://mirror.services.wisc.edu/mirrors/mysql/ +fi + +if \[ ! -d mysql/src \] ; then +tar -x -z -f $mysqlrelease.tar.gz +mkdir mysql +mv $mysqlrelease mysql/src +fi + +if \[ ! -f mysql/install/bin/mysql \] ; then +cd mysql +mkdir bld +cd bld +# Force the use of dtrace +sed -i -e 's/HAVE_DTRACE_DASH_G=\"no\"/HAVE_DTRACE_DASH_G=\"yes\"/' ../src/configure +../src/configure --enable-dtrace --prefix=$mysqldir +for i in \$(find . -name Makefile) ; do + sed -i -e 's/^CXXFLAGS =/& -g/' \$i +done + +make -j2 +cp ./abi_check.out ../../src/include/mysql.h.pp +make -j2 +make install +fi + +run_tests uprobe +" +########## End /tmp/stap-mysql.sh ########## +close $fp + +########## /tmp/stap-mysql.sh does most of the work ########## +verbose -log Running mysql testsuite +spawn sh stap-mysql.sh 2>&1 +expect { + -timeout 1000 + -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 $msdata} +catch {exec rm -rf $testsuite/stap-mysql.stp $testsuite/stap-mysql.log \ + $testsuite/stap-mysql-markers.log $testsuite/stap-mysql.sh $mysqlrelease.tar.gz} +catch {exec rm -rf mysql} +} diff --git a/testsuite/systemtap.apps/postgres.exp b/testsuite/systemtap.apps/postgres.exp new file mode 100644 index 00000000..2d58a54f --- /dev/null +++ b/testsuite/systemtap.apps/postgres.exp @@ -0,0 +1,166 @@ +set test "postgres" + +# Test sdt support in postgres. + +global env + +if {! [info exists env(SYSTEMTAP_TEST_SDT)]} { + unsupported "postgres (\"SYSTEMTAP_TEST_SDT\" not in env)" + return +} + +########## Create /tmp/stap-postgres.stp ########## +set postgresbuild "[pwd]/postgresql-8.3.6/bld" +set postgresdir "[pwd]/postgresql-8.3.6/install/" +set pgdata "/tmp/stap-postgres" + + +set fp [open "$pgdata.stp" "w"] +puts $fp " +probe process(\"$postgresdir/bin/postgres\").mark(\"transaction__start\") +{ + printf(\"%s %#x\\n\", \$\$name, \$arg1); +} +probe process(\"$postgresdir/bin/postgres\").mark(\"transaction__commit\") +{ + printf(\"%s %#x\\n\", \$\$name, \$arg1); +} +probe process(\"$postgresdir/bin/postgres\").mark(\"transaction__abort\") +{ + printf(\"%s %#x\\n\", \$\$name, \$arg1); +} +probe process(\"$postgresdir/bin/postgres\").mark(\"lock__startwait\") +{ + printf(\"%s %#x %#x\\n\", \$\$name, \$arg1, \$arg2); +} +probe process(\"$postgresdir/bin/postgres\").mark(\"lock__endwait\") +{ + printf(\"%s %#x %#x\\n\", \$\$name, \$arg1, \$arg2); +} +probe process(\"$postgresdir/bin/postgres\").mark(\"lwlock__endwait\") +{ + printf(\"%s %#x %#x\\n\", \$\$name, \$arg1, \$arg2); +} +probe process(\"$postgresdir/bin/postgres\").mark(\"lwlock__acquire\") +{ + printf(\"%s %#x %#x\\n\", \$\$name, \$arg1, \$arg2); +} +probe process(\"$postgresdir/bin/postgres\").mark(\"lwlock__condacquire__fail\") +{ + printf(\"%s %#x %#x\\n\", \$\$name, + \$arg1, \$arg2); +} +probe process(\"$postgresdir/bin/postgres\").mark(\"lwlock__condacquire\") +{ + printf(\"%s %#x %#x\\n\", \$\$name, \$arg1, \$arg2); +} +probe process(\"$postgresdir/bin/postgres\").mark(\"lwlock__release\") +{ + printf(\"%s %#x\\n\", \$\$name, \$arg1); +} +" +close $fp + +########## Begin /tmp/stap-postgres.sh ########## +set fp [open "$pgdata.sh" "w"] +puts $fp " +function run_tests \{ +/bin/rm -rf $pgdata +$postgresdir/bin/initdb $pgdata + +which stap +$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 +for i in \$(seq 0 10) ; do + if $postgresdir/bin/pg_ctl status -D $pgdata + then break; + fi + sleep 5 +done + +(cd $postgresbuild/src/test/regress/ + make installcheck > $pgdata.log 2>&1) + +ACQUIRE=\$(grep 'lwlock__acquire 0x\[0-9\]* 0x\[0-9\]*' $pgdata-markers.log | wc -l) +RELEASE=\$(grep 'lwlock__release 0x\[0-9\]*' $pgdata-markers.log | wc -l) +START=\$(grep 'transaction__start 0x\[0-9\]*' $pgdata-markers.log | wc -l) +COMMIT=\$(grep 'transaction__commit 0x\[0-9\]*' $pgdata-markers.log | wc -l) +OKAY=\$(grep 'test .*ok' $pgdata.log | wc -l) + +echo lwlock__acquire=\$ACQUIRE lwlock__release=\$RELEASE transaction__start=\$START transaction__commit=\$COMMIT test-ok=\$OKAY +: 44873 75325 591 489 0 + +if \[ \$ACQUIRE -gt 40000 -a \$RELEASE -gt 70000 -a \$START -gt 500 -a \$COMMIT -gt 400 \] ; then + echo PASS: postgres tests \$1 +else + echo FAIL: postgres tests \$1 +fi + +if \[ \$OKAY -gt 100 \] ; then + echo PASS: postgres markers \$1 +else + echo FAIL: postgres markers \$1 +fi + +/usr/local/pgsql/bin/pg_ctl stop -D $pgdata +kill \$STAPPID +\} + +if \[ ! -r postgresql-8.3.6.tar.bz2 \] ; then +wget http://wwwmaster.postgresql.org/redir/198/h/source/v8.3.6/postgresql-8.3.6.tar.bz2 +fi + +if \[ ! -d $postgresbuild/src/backend \] ; then +tar -x -f postgresql-8.3.6.tar.bz2 +fi + +cd postgresql-8.3.6/ +mkdir bld;cd bld +../configure --enable-dtrace --prefix=$postgresdir +# sed -i -e 's/ifeq (\$(PORTNAME), solaris)/ifeq (\$(enable_dtrace), yes)/' src/backend/Makefile +sed -i -e 's/^CFLAGS = -O2.*\$/& -g -DEXPERIMENTAL_UTRACE_SDT/' src/Makefile.global +make +make install +run_tests utrace + +sed -i -e 's/UTRACE/KPROBE/' src/Makefile.global +(cd src/backend/utils/ + make clean) +make +make install +run_tests kprobe + +sed -i -e 's/-DEXPERIMENTAL_KPROBE_SDT//' src/Makefile.global +(cd src/backend/utils/ + make clean) +make +make install +run_tests uprobe +" +########## End /tmp/stap-postgres.sh ########## +close $fp + +########## /tmp/stap-postgres.sh does most of the work ########## +verbose -log Running postgres testsuite +spawn sh $pgdata.sh 2>&1 +expect { + -timeout 1000 + -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 $pgdata} +catch {exec rm -rf $pgdata.stp $pgdata.log \ + $pgdata-markers.log $pgdata.sh postgresql-8.3.6.tar.bz2} +catch {exec rm -rf postgresql-8.3.6} +} 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/mysql.exp b/testsuite/systemtap.base/mysql.exp deleted file mode 100644 index efeffbae..00000000 --- a/testsuite/systemtap.base/mysql.exp +++ /dev/null @@ -1,344 +0,0 @@ -set test "mysql" - -# Test sdt support in mysql. - -global env - -if {! [info exists env(SYSTEMTAP_TEST_SDT)]} { - unsupported "mysql (\"SYSTEMTAP_TEST_SDT\" not in env)" - return -} - -########## Create /tmp/stap-mysql.stp ########## -set msdata "[pwd]/stap-mysql" -set mysqlrelease "mysql-5.4.1-beta" -set mysqldir "[pwd]/mysql/install/" -set testsuite "[pwd]" - -set fp [open "$testsuite/stap-mysql.stp" "w"] -puts $fp " -probe process(@1).mark(\"connection__start\") -{ - arg2 = user_string(\$arg2) - arg3 = user_string(\$arg3) - printf(\"%s %#x %s %s\\n\",\"connection__start\", \$arg1, arg2, arg3); -} -probe process(@1).mark(\"connection__done\") -{ - printf(\"%s %#x %#x \\n\",\"connection__done\", \$arg1, \$arg2); -} -probe process(@1).mark(\"command__start\") -{ - arg3 = user_string(\$arg3) - arg4 = user_string(\$arg4) - printf(\"%s %#x %#x %s %s\\n\",\"command__start\", \$arg1, \$arg2, arg3, arg4); -} -probe process(@1).mark(\"command__done\") -{ - printf(\"%s %#x\\n\",\"command__done\", \$arg1); -} -probe process(@1).mark(\"query__start\") -{ - arg1 = user_string(\$arg1) - arg3 = user_string(\$arg3) - arg4 = user_string(\$arg4) - arg5 = user_string(\$arg5) - printf(\"%s %s %#x %s %s %s\\n\",\"query__start\", arg1, \$arg2, - arg3, arg4, arg5); -} -probe process(@1).mark(\"query__done\") -{ - printf(\"%s %#x\\n\",\"query__done\", \$arg1); -} -probe process(@1).mark(\"query__parse__start\") -{ - arg1 = user_string(\$arg1) - printf(\"%s %s\\n\",\"query__parse__start\", arg1); -} -probe process(@1).mark(\"query__parse__done\") -{ - printf(\"%s %#x\\n\",\"query__parse__done\", \$arg1); -} -probe process(@1).mark(\"query__cache__hit\") -{ - arg1=user_string(\$arg1) - arg2=user_string(\$arg2) - printf(\"%s %s %s \\n\",\"query__cache__hit\", arg1, arg2); -} -probe process(@1).mark(\"query__cache__miss\") -{ - arg1=user_string(\$arg1) - printf(\"%s %s\\n\",\"query__cache__miss\", arg1); -} -probe process(@1).mark(\"query__exec__start\") -{ - arg1=user_string(\$arg1) - arg3=user_string(\$arg3) - arg4=user_string(\$arg4) - arg5=user_string(\$arg5) - printf(\"%s %s %#x %s %s %s\\n\",\"query__exec__start\", arg1, \$arg2, - arg3, arg4, arg5); -} -probe process(@1).mark(\"query__exec__done\") -{ - printf(\"%s %#x\\n\",\"query__exec__done\", \$arg1); -} -probe process(@1).mark(\"insert__row__start\") -{ - arg1=user_string(\$arg1) - arg2=user_string(\$arg2) - printf(\"%s %s %s \\n\",\"insert__row__start\", arg1, arg2); -} -probe process(@1).mark(\"insert__row__done\") -{ - printf(\"%s %#x\\n\",\"insert__row__done\", \$arg1); -} -probe process(@1).mark(\"update__row__start\") -{ - arg1=user_string(\$arg1) - arg2=user_string(\$arg2) - printf(\"%s %s %s \\n\",\"update__row__start\", arg1, arg2); -} -probe process(@1).mark(\"update__row__done\") -{ - printf(\"%s %#x\\n\",\"update__row__done\", \$arg1); -} -probe process(@1).mark(\"delete__row__start\") -{ - arg1=user_string(\$arg1) - arg2=user_string(\$arg2) - printf(\"%s %s %s \\n\",\"delete__row__start\", arg1, arg2); -} -probe process(@1).mark(\"delete__row__done\") -{ - printf(\"%s %#x\\n\",\"delete__row__done\", \$arg1); -} -probe process(@1).mark(\"handler__rdlock__start\") -{ - arg1=user_string(\$arg1) - arg2=user_string(\$arg2) - printf(\"%s %s %s \\n\",\"handler__rdlock__start\", arg1, arg2); -} -probe process(@1).mark(\"handler__wrlock__start\") -{ - arg1=user_string(\$arg1) - arg2=user_string(\$arg2) - printf(\"%s %s %s \\n\",\"handler__wrlock__start\", arg1, arg2); -} -probe process(@1).mark(\"handler__unlock__start\") -{ - arg1=user_string(\$arg1) - arg2=user_string(\$arg2) - printf(\"%s %s %s \\n\",\"handler__unlock__start\", arg1, arg2); -} -probe process(@1).mark(\"handler__rdlock__done\") -{ - printf(\"%s %#x\\n\",\"handler__rdlock__done\", \$arg1); -} -probe process(@1).mark(\"handler__wrlock__done\") -{ - printf(\"%s %#x\\n\",\"handler__wrlock__done\", \$arg1); -} -probe process(@1).mark(\"handler__unlock__done\") -{ - printf(\"%s %#x\\n\",\"handler__unlock__done\", \$arg1); -} -probe process(@1).mark(\"filesort__start\") -{ - printf(\"%s %#x %#x \\n\",\"filesort__start\", \$arg1, \$arg2); -} -probe process(@1).mark(\"filesort__done\") -{ - printf(\"%s %#x %#x \\n\",\"filesort__done\", \$arg1, \$arg2); -} -probe process(@1).mark(\"select__start\") -{ - arg1=user_string(\$arg1) - printf(\"%s %s\\n\",\"select__start\", arg1); -} -probe process(@1).mark(\"select__done\") -{ - printf(\"%s %#x %#x \\n\",\"select__done\", \$arg1, \$arg2); -} -probe process(@1).mark(\"insert__start\") -{ - arg1=user_string(\$arg1) - printf(\"%s %s\\n\",\"insert__start\", arg1); -} -probe process(@1).mark(\"insert__done\") -{ - printf(\"%s %#x %#x \\n\",\"insert__done\", \$arg1, \$arg2); -} -probe process(@1).mark(\"insert__select__start\") -{ - arg1=user_string(\$arg1) - printf(\"%s %s\\n\",\"insert__select__start\", arg1); -} -probe process(@1).mark(\"insert__select__done\") -{ - printf(\"%s %#x %#x \\n\",\"insert__select__done\", \$arg1, \$arg2); -} -probe process(@1).mark(\"update__start\") -{ - arg1=user_string(\$arg1) - printf(\"%s %s\\n\",\"update__start\", arg1); -} -probe process(@1).mark(\"update__done\") -{ - printf(\"%s %#x %#x %#x\\n\",\"update__done\", \$arg1, \$arg2, \$arg3); -} -probe process(@1).mark(\"multi__update__start\") -{ - arg1=user_string(\$arg1) - printf(\"%s %s\\n\",\"multi__update__start\", arg1); -} -probe process(@1).mark(\"multi__update__done\") -{ - printf(\"%s %#x %#x %#x\\n\",\"multi__update__done\", \$arg1, \$arg2, \$arg3); -} -probe process(@1).mark(\"delete__start\") -{ - arg1=user_string(\$arg1) - printf(\"%s %s\\n\",\"delete__start\", arg1); -} -probe process(@1).mark(\"delete__done\") -{ - printf(\"%s %#x %#x \\n\",\"delete__done\", \$arg1, \$arg2); -} -probe process(@1).mark(\"multi__delete__start\") -{ - arg1=user_string(\$arg1) - printf(\"%s %s\\n\",\"multi__delete__start\", arg1); -} -probe process(@1).mark(\"multi__delete__done\") -{ - printf(\"%s %#x %#x \\n\",\"multi__delete__done\", \$arg1, \$arg2); -} -probe process(@1).mark(\"net__read__start\") -{ - printf(\"%s \\n\",\"net__read__start\"); -} -probe process(@1).mark(\"net__read__done\") -{ - printf(\"%s %#x %#x \\n\",\"net__read__done\", \$arg1, \$arg2); -} -probe process(@1).mark(\"net__write__start\") -{ - printf(\"%s %#x\\n\",\"net__write__start\", \$arg1); -} -probe process(@1).mark(\"net__write__done\") -{ - printf(\"%s %#x\\n\",\"net__write__done\", \$arg1); -} -" -close $fp - -########## Begin /tmp/stap-mysql.sh ########## -set fp [open "$testsuite/stap-mysql.sh" "w"] -puts $fp " -##### begin run_tests ##### -function run_tests \{ -/bin/rm -rf $testsuite/stap-mysql -$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/ //') -$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 - if $mysqldir/bin/mysqladmin ping --socket=$msdata/mysql.sock - then break; - fi - sleep 5 -done - -for i in select join insert query -do - echo '##### ' \$i - ./mysql-test-run.pl --force --extern socket=$msdata/mysql.sock \ - --tmpdir=/tmp/,mysql --vardir=/tmp/,mysql --do-test=\$i -done > $testsuite/stap-mysql.log -) - -ACQUIRE=\$(grep 'handler__unlock__start' $testsuite/stap-mysql-markers.log | wc -l) -RELEASE=\$(grep 'handler__unlock__done' $testsuite/stap-mysql-markers.log | wc -l) -COMMAND=\$(grep 'command__start' $testsuite/stap-mysql-markers.log | wc -l) -QUERY=\$(grep 'query__start' $testsuite/stap-mysql-markers.log | wc -l) -RDLOCK=\$(grep 'handler__rdlock__start' $testsuite/stap-mysql-markers.log | wc -l) -SELECT=\$(grep 'select_start' $testsuite/stap-mysql-markers.log | wc -l) -OKAY=\$(grep 'All.*tests were successful' $testsuite/stap-mysql.log | wc -l) - -echo ACQUIRE=\$ACQUIRE RELEASE=\$RELEASE COMMAND=\$COMMAND QUERY=\$QUERY RDLOCK=\$RDLOCK SELECT=\$SELECT OKAY=\$OKAY -if \[ \$ACQUIRE -gt 10000 -a \$RELEASE -gt 1000 -a \$COMMAND -gt 12000 -a \$QUERY -gt 13000 -a \$RDLOCK -gt 3000 \] ; then - echo PASS: mysql markers \$1 -else - echo FAIL: mysql markers \$1 -fi - -if \[ \$OKAY -eq 4 \] ; then - echo PASS: mysql tests \$1 -else - echo FAIL: mysql tests \$1 -fi - -$mysqldir/bin/mysqladmin shutdown -u root --socket=stap-mysql/mysql.sock -kill \$STAPPID -\} -##### end run_tests ##### - -if \[ ! -r $mysqlrelease.tar.gz \] ; then -wget http://dev.mysql.com/get/Downloads/MySQL-5.4/$mysqlrelease.tar.gz/from/ftp://mirror.services.wisc.edu/mirrors/mysql/ -fi - -if \[ ! -d mysql/src \] ; then -tar -x -z -f $mysqlrelease.tar.gz -mkdir mysql -mv $mysqlrelease mysql/src -fi - -if \[ ! -f mysql/install/bin/mysql \] ; then -cd mysql -mkdir bld -cd bld -# Force the use of dtrace -sed -i -e 's/HAVE_DTRACE_DASH_G=\"no\"/HAVE_DTRACE_DASH_G=\"yes\"/' ../src/configure -../src/configure --enable-dtrace --prefix=$mysqldir -for i in \$(find . -name Makefile) ; do - sed -i -e 's/^CXXFLAGS =/& -g/' \$i -done - -make -j2 -cp ./abi_check.out ../../src/include/mysql.h.pp -make -j2 -make install -fi - -run_tests uprobe -" -########## End /tmp/stap-mysql.sh ########## -close $fp - -########## /tmp/stap-mysql.sh does most of the work ########## -verbose -log Running mysql testsuite -spawn sh stap-mysql.sh 2>&1 -expect { - -timeout 1000 - -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 $msdata} -catch {exec rm -rf $testsuite/stap-mysql.stp $testsuite/stap-mysql.log \ - $testsuite/stap-mysql-markers.log $testsuite/stap-mysql.sh $mysqlrelease.tar.gz} -catch {exec rm -rf mysql} -} diff --git a/testsuite/systemtap.base/postgres.exp b/testsuite/systemtap.base/postgres.exp deleted file mode 100644 index 2d58a54f..00000000 --- a/testsuite/systemtap.base/postgres.exp +++ /dev/null @@ -1,166 +0,0 @@ -set test "postgres" - -# Test sdt support in postgres. - -global env - -if {! [info exists env(SYSTEMTAP_TEST_SDT)]} { - unsupported "postgres (\"SYSTEMTAP_TEST_SDT\" not in env)" - return -} - -########## Create /tmp/stap-postgres.stp ########## -set postgresbuild "[pwd]/postgresql-8.3.6/bld" -set postgresdir "[pwd]/postgresql-8.3.6/install/" -set pgdata "/tmp/stap-postgres" - - -set fp [open "$pgdata.stp" "w"] -puts $fp " -probe process(\"$postgresdir/bin/postgres\").mark(\"transaction__start\") -{ - printf(\"%s %#x\\n\", \$\$name, \$arg1); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"transaction__commit\") -{ - printf(\"%s %#x\\n\", \$\$name, \$arg1); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"transaction__abort\") -{ - printf(\"%s %#x\\n\", \$\$name, \$arg1); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"lock__startwait\") -{ - printf(\"%s %#x %#x\\n\", \$\$name, \$arg1, \$arg2); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"lock__endwait\") -{ - printf(\"%s %#x %#x\\n\", \$\$name, \$arg1, \$arg2); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"lwlock__endwait\") -{ - printf(\"%s %#x %#x\\n\", \$\$name, \$arg1, \$arg2); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"lwlock__acquire\") -{ - printf(\"%s %#x %#x\\n\", \$\$name, \$arg1, \$arg2); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"lwlock__condacquire__fail\") -{ - printf(\"%s %#x %#x\\n\", \$\$name, - \$arg1, \$arg2); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"lwlock__condacquire\") -{ - printf(\"%s %#x %#x\\n\", \$\$name, \$arg1, \$arg2); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"lwlock__release\") -{ - printf(\"%s %#x\\n\", \$\$name, \$arg1); -} -" -close $fp - -########## Begin /tmp/stap-postgres.sh ########## -set fp [open "$pgdata.sh" "w"] -puts $fp " -function run_tests \{ -/bin/rm -rf $pgdata -$postgresdir/bin/initdb $pgdata - -which stap -$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 -for i in \$(seq 0 10) ; do - if $postgresdir/bin/pg_ctl status -D $pgdata - then break; - fi - sleep 5 -done - -(cd $postgresbuild/src/test/regress/ - make installcheck > $pgdata.log 2>&1) - -ACQUIRE=\$(grep 'lwlock__acquire 0x\[0-9\]* 0x\[0-9\]*' $pgdata-markers.log | wc -l) -RELEASE=\$(grep 'lwlock__release 0x\[0-9\]*' $pgdata-markers.log | wc -l) -START=\$(grep 'transaction__start 0x\[0-9\]*' $pgdata-markers.log | wc -l) -COMMIT=\$(grep 'transaction__commit 0x\[0-9\]*' $pgdata-markers.log | wc -l) -OKAY=\$(grep 'test .*ok' $pgdata.log | wc -l) - -echo lwlock__acquire=\$ACQUIRE lwlock__release=\$RELEASE transaction__start=\$START transaction__commit=\$COMMIT test-ok=\$OKAY -: 44873 75325 591 489 0 - -if \[ \$ACQUIRE -gt 40000 -a \$RELEASE -gt 70000 -a \$START -gt 500 -a \$COMMIT -gt 400 \] ; then - echo PASS: postgres tests \$1 -else - echo FAIL: postgres tests \$1 -fi - -if \[ \$OKAY -gt 100 \] ; then - echo PASS: postgres markers \$1 -else - echo FAIL: postgres markers \$1 -fi - -/usr/local/pgsql/bin/pg_ctl stop -D $pgdata -kill \$STAPPID -\} - -if \[ ! -r postgresql-8.3.6.tar.bz2 \] ; then -wget http://wwwmaster.postgresql.org/redir/198/h/source/v8.3.6/postgresql-8.3.6.tar.bz2 -fi - -if \[ ! -d $postgresbuild/src/backend \] ; then -tar -x -f postgresql-8.3.6.tar.bz2 -fi - -cd postgresql-8.3.6/ -mkdir bld;cd bld -../configure --enable-dtrace --prefix=$postgresdir -# sed -i -e 's/ifeq (\$(PORTNAME), solaris)/ifeq (\$(enable_dtrace), yes)/' src/backend/Makefile -sed -i -e 's/^CFLAGS = -O2.*\$/& -g -DEXPERIMENTAL_UTRACE_SDT/' src/Makefile.global -make -make install -run_tests utrace - -sed -i -e 's/UTRACE/KPROBE/' src/Makefile.global -(cd src/backend/utils/ - make clean) -make -make install -run_tests kprobe - -sed -i -e 's/-DEXPERIMENTAL_KPROBE_SDT//' src/Makefile.global -(cd src/backend/utils/ - make clean) -make -make install -run_tests uprobe -" -########## End /tmp/stap-postgres.sh ########## -close $fp - -########## /tmp/stap-postgres.sh does most of the work ########## -verbose -log Running postgres testsuite -spawn sh $pgdata.sh 2>&1 -expect { - -timeout 1000 - -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 $pgdata} -catch {exec rm -rf $pgdata.stp $pgdata.log \ - $pgdata-markers.log $pgdata.sh postgresql-8.3.6.tar.bz2} -catch {exec rm -rf postgresql-8.3.6} -} diff --git a/testsuite/systemtap.base/tcl.exp b/testsuite/systemtap.base/tcl.exp deleted file mode 100644 index 8056f5e5..00000000 --- a/testsuite/systemtap.base/tcl.exp +++ /dev/null @@ -1,165 +0,0 @@ -set test "tcl" - -# Test sdt support in tcl. - -global env - -if {! [info exists env(SYSTEMTAP_TEST_SDT)]} { - unsupported "tcl (\"SYSTEMTAP_TEST_SDT\" not in env)" - return -} - -########## Create /tmp/stap-tcl.stp ########## -set tclreleasemajor "8.6" -set tclrelease "8.6b1" -set tcldir "[pwd]/tcl/install/" -set testsuite "[pwd]" - -set fp [open "$testsuite/stap-tcl.stp" "w"] -puts $fp " -probe process(@1).mark(\"proc__entry\") -{ - printf (\"%s %#x,%#x,%#x\\n\",\$\$name, \$arg1,\$arg2,\$arg3) -} -probe process(@1).mark(\"proc__return\") -{ - printf (\"%s %#x,%#x\\n\",\$\$name, \$arg1,\$arg2) -} -probe process(@1).mark(\"proc__result\") -{ - printf (\"%s %#x,%#x,%#x,%#x\\n\",\$\$name, \$arg1,\$arg2,\$arg3,\$arg4) -} -probe process(@1).mark(\"proc__args\") -{ - printf (\"%s %#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x\\n\",\$\$name, \$arg1,\$arg2,\$arg3,\$arg4,\$arg5,\$arg6,\$arg7,\$arg8,\$arg9,\$arg10) -} -probe process(@1).mark(\"proc__info\") -{ - printf (\"%s %#x,%#x,%#x,%#x,%#x,%#x\\n\",\$\$name, \$arg1,\$arg2,\$arg3,\$arg4,\$arg5,\$arg6) -} -probe process(@1).mark(\"cmd__entry\") -{ - printf (\"%s %#x,%#x,%#x\\n\",\$\$name, \$arg1,\$arg2,\$arg3) -} -probe process(@1).mark(\"cmd__return\") -{ - printf (\"%s %#x,%#x\\n\",\$\$name, \$arg1,\$arg2) -} -probe process(@1).mark(\"cmd__result\") -{ - printf (\"%s %#x,%#x,%#x,%#x\\n\",\$\$name, \$arg1,\$arg2,\$arg3,\$arg4) -} -probe process(@1).mark(\"cmd__args\") -{ - printf (\"%s %#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x\\n\",\$\$name, \$arg1,\$arg2,\$arg3,\$arg4,\$arg5,\$arg6,\$arg7,\$arg8,\$arg9,\$arg10) -} -probe process(@1).mark(\"cmd__info\") -{ - printf (\"%s %#x,%#x,%#x,%#x,%#x,%#x\\n\",\$\$name, \$arg1,\$arg2,\$arg3,\$arg4,\$arg5,\$arg6) -} -probe process(@1).mark(\"inst__start\") -{ - printf (\"%s %#x,%#x,%#x\\n\",\$\$name, \$arg1,\$arg2,\$arg3) -} -probe process(@1).mark(\"inst__done\") -{ - printf (\"%s %#x,%#x,%#x\\n\",\$\$name, \$arg1,\$arg2,\$arg3) -} -probe process(@1).mark(\"obj__create\") -{ - printf (\"%s %#x\\n\",\$\$name, \$arg1) -} -probe process(@1).mark(\"obj__free\") -{ - printf (\"%s %#x\\n\",\$\$name, \$arg1) -} -probe process(@1).mark(\"tcl__probe\") -{ - printf (\"%s %#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x,%#x\\n\",\$\$name, \$arg1,\$arg2,\$arg3,\$arg4,\$arg5,\$arg6,\$arg7,\$arg8,\$arg9,\$arg10) -} -" -close $fp - -########## Begin /tmp/stap-tcl.sh ########## -set fp [open "$testsuite/stap-tcl.sh" "w"] -puts $fp " -##### begin run_tests ##### -function run_tests \{ -(cd $tcldir/.. -MOD=stapsdt_\$(date +%j%k%M%N | sed 's/ //') -$env(SYSTEMTAP_PATH)/stap -m \$MOD -c install/bin/tclsh$tclreleasemajor $testsuite/stap-tcl.stp $testsuite/tcl/install/lib//libtcl$tclreleasemajor.so << END >$testsuite/stap-tcl-markers.log 2>&1 -source src/tests/all.tcl -quit -END -) - -PROC_ENTRY=\$(grep 'proc__entry' $testsuite/stap-tcl-markers.log | wc -l) -PROC_RETURN=\$(grep 'proc__return' $testsuite/stap-tcl-markers.log | wc -l) -PROC_RESULT=\$(grep 'proc__result' $testsuite/stap-tcl-markers.log | wc -l) -PROC_ARGS=\$(grep 'proc__args' $testsuite/stap-tcl-markers.log | wc -l) -PROC_INFO=\$(grep 'proc__info' $testsuite/stap-tcl-markers.log | wc -l) -CMD_ENTRY=\$(grep 'cmd__entry' $testsuite/stap-tcl-markers.log | wc -l) -CMD_RETURN=\$(grep 'cmd__return' $testsuite/stap-tcl-markers.log | wc -l) -CMD_RESULT=\$(grep 'cmd__result' $testsuite/stap-tcl-markers.log | wc -l) -CMD_ARGS=\$(grep 'cmd__args' $testsuite/stap-tcl-markers.log | wc -l) -CMD_INFO=\$(grep 'cmd__info' $testsuite/stap-tcl-markers.log | wc -l) -INST_START=\$(grep 'inst__start' $testsuite/stap-tcl-markers.log | wc -l) -INST_DONE=\$(grep 'inst__done' $testsuite/stap-tcl-markers.log | wc -l) -OBJ_CREATE=\$(grep 'obj__create' $testsuite/stap-tcl-markers.log | wc -l) -OBJ_FREE=\$(grep 'obj__free' $testsuite/stap-tcl-markers.log | wc -l) - -echo PROC_ENTRY=\$PROC_ENTRY PROC_RETURN=\$PROC_RETURN PROC_RESULT=\$PROC_RESULT PROC_ARGS=\$PROC_ARGS PROC_INFO=\$PROC_INFO CMD_ENTRY=\$CMD_ENTRY CMD_RETURN=\$CMD_RETURN CMD_RESULT=\$CMD_RESULT CMD_ARGS=\$CMD_ARGS CMD_INFO=\$CMD_INFO INST_START=\$INST_START INST_DONE=\$INST_DONE OBJ_CREATE=\$OBJ_CREATE OBJ_FREE=\$OBJ_FREE - -if \[ \$PROC_ENTRY -gt 9000 -a \$PROC_RETURN -gt 9000 -a \$PROC_RESULT -gt 9000 -a \$PROC_ARGS -gt 9000 -a \$PROC_INFO -gt 9000 -a \$CMD_ENTRY -gt 37000 -a \$CMD_RETURN -gt 37000 -a \$CMD_RESULT -gt 37000 -a \$CMD_ARGS -gt 3700 -a \$CMD_INFO -gt 37000 -a \$INST_START -gt 542000 -a \$INST_DONE -gt 542000 -a \$OBJ_CREATE -gt 723000 -a \$OBJ_FREE -gt 704000 \] ; then - echo PASS: tcl markers \$1 -else - echo FAIL: tcl markers \$1 -fi - -\} -##### end run_tests ##### - -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 -mkdir tcl -mv tcl$tclrelease tcl/src -fi - -if \[ ! -d tcl/install/bin \] ; then -cd tcl/src/unix -./configure --prefix=$tcldir --enable-dtrace CFLAGS='-I$env(SYSTEMTAP_INCLUDES) -g' - -make -j2 -make install -fi - -run_tests uprobe -" -########## End /tmp/stap-tcl.sh ########## -close $fp - -########## /tmp/stap-tcl.sh does most of the work ########## -verbose -log Running tcl testsuite -spawn sh stap-tcl.sh 2>&1 -expect { - -timeout 1000 - -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-tcl.stp tcl$tclrelease-src.tar.gz \ - $testsuite/stap-tcl-markers.log $testsuite/stap-tcl.sh } -catch {exec rm -rf tcl} -} diff --git a/testsuite/systemtap.base/xulrunner.exp b/testsuite/systemtap.base/xulrunner.exp deleted file mode 100644 index be2db0c7..00000000 --- a/testsuite/systemtap.base/xulrunner.exp +++ /dev/null @@ -1,133 +0,0 @@ -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} -} -- cgit