diff options
-rw-r--r-- | tapset/task.stp | 14 | ||||
-rw-r--r-- | testsuite/systemtap.base/mysql.exp | 2 | ||||
-rw-r--r-- | testsuite/systemtap.base/postgres.exp | 2 | ||||
-rw-r--r-- | testsuite/systemtap.base/tcl.exp | 2 | ||||
-rw-r--r-- | testsuite/systemtap.base/xulrunner.exp | 133 |
5 files changed, 143 insertions, 10 deletions
diff --git a/tapset/task.stp b/tapset/task.stp index 3bb65413..90579d5d 100644 --- a/tapset/task.stp +++ b/tapset/task.stp @@ -45,21 +45,21 @@ function task_parent:long (task:long) %{ /* pure */ // EXIT_DEAD 32 function task_state:long (task:long) { - return @cast(task, "task_struct", "kernel")->state + return @cast(task, "task_struct", "kernel<linux/sched.h>")->state } // Return the name of the given task function task_execname:string (task:long) { - return kernel_string(@cast(task, "task_struct", "kernel")->comm) + return kernel_string(@cast(task, "task_struct", "kernel<linux/sched.h>")->comm) } // Return the process id of the given task function task_pid:long (task:long) { - return @cast(task, "task_struct", "kernel")->tgid + return @cast(task, "task_struct", "kernel<linux/sched.h>")->tgid } @@ -95,7 +95,7 @@ function pid2execname:string (pid:long) { // Return the thread id of the given task function task_tid:long (task:long) { - return @cast(task, "task_struct", "kernel")->pid + return @cast(task, "task_struct", "kernel<linux/sched.h>")->pid } @@ -181,11 +181,11 @@ function task_nice:long (task:long) %{ /* pure */ function task_cpu:long (task:long) { %( kernel_v >= "2.6.22" %? - ti = @cast(task, "task_struct", "kernel")->stack + ti = @cast(task, "task_struct", "kernel<linux/sched.h>")->stack %: - ti = @cast(task, "task_struct", "kernel")->thread_info + ti = @cast(task, "task_struct", "kernel<linux/sched.h>")->thread_info %) - return @cast(ti, "thread_info", "kernel")->cpu + return @cast(ti, "thread_info", "kernel<linux/sched.h>")->cpu } // Return the number of open file handlers for the given task diff --git a/testsuite/systemtap.base/mysql.exp b/testsuite/systemtap.base/mysql.exp index 44b30cf4..efeffbae 100644 --- a/testsuite/systemtap.base/mysql.exp +++ b/testsuite/systemtap.base/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.base/postgres.exp index ceef9437..2d58a54f 100644 --- a/testsuite/systemtap.base/postgres.exp +++ b/testsuite/systemtap.base/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.base/tcl.exp b/testsuite/systemtap.base/tcl.exp index 7e21091a..8056f5e5 100644 --- a/testsuite/systemtap.base/tcl.exp +++ b/testsuite/systemtap.base/tcl.exp @@ -87,7 +87,7 @@ puts $fp " function run_tests \{ (cd $tcldir/.. MOD=stapsdt_\$(date +%j%k%M%N | sed 's/ //') -/work/scox/virginsystemtap/install/bin/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 +$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 diff --git a/testsuite/systemtap.base/xulrunner.exp b/testsuite/systemtap.base/xulrunner.exp new file mode 100644 index 00000000..be2db0c7 --- /dev/null +++ b/testsuite/systemtap.base/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} +} |