summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-04-22 11:57:40 -0400
committerDave Brolley <brolley@redhat.com>2009-04-22 11:57:40 -0400
commitbc815e0692536da04956f038f5f79941579f8d74 (patch)
tree98b0f8cfdd90c225f5b5fede18352caee5d9a546 /testsuite
parent88e8da383e47adafc9e75c4f10aecd0ce4ad959f (diff)
parent247f1e1fa09953347a4e5313ae0022f151316dae (diff)
downloadsystemtap-steved-bc815e0692536da04956f038f5f79941579f8d74.tar.gz
systemtap-steved-bc815e0692536da04956f038f5f79941579f8d74.tar.xz
systemtap-steved-bc815e0692536da04956f038f5f79941579f8d74.zip
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/buildok/ustack.stp10
-rwxr-xr-xtestsuite/parseko/utrace01.stp2
-rwxr-xr-xtestsuite/semko/utrace01.stp4
-rwxr-xr-xtestsuite/semko/utrace03.stp2
-rwxr-xr-xtestsuite/semko/utrace04.stp4
-rwxr-xr-xtestsuite/semko/utrace08.stp4
-rwxr-xr-xtestsuite/semko/utrace09.stp4
-rwxr-xr-xtestsuite/semko/utrace10.stp4
-rwxr-xr-xtestsuite/semko/utrace11.stp4
-rwxr-xr-xtestsuite/semko/utrace12.stp4
-rwxr-xr-xtestsuite/semko/utrace13.stp4
-rwxr-xr-xtestsuite/semok/cast.stp4
-rwxr-xr-xtestsuite/semok/utrace01.stp4
-rw-r--r--testsuite/systemtap.base/cast.stp4
-rw-r--r--testsuite/systemtap.base/uprobes_ustack.exp97
-rw-r--r--testsuite/systemtap.base/uprobes_ustack.stp35
-rw-r--r--testsuite/systemtap.context/backtrace.tcl1
-rw-r--r--testsuite/systemtap.examples/index.html2
-rw-r--r--testsuite/systemtap.examples/index.txt2
-rw-r--r--testsuite/systemtap.examples/keyword-index.html2
-rw-r--r--testsuite/systemtap.examples/keyword-index.txt2
-rw-r--r--testsuite/systemtap.examples/process/sigmon.meta4
22 files changed, 161 insertions, 42 deletions
diff --git a/testsuite/buildok/ustack.stp b/testsuite/buildok/ustack.stp
new file mode 100755
index 00000000..23af0bff
--- /dev/null
+++ b/testsuite/buildok/ustack.stp
@@ -0,0 +1,10 @@
+#! stap -p4
+#
+# Test the translatability for ubacktrace(), print_ustack()
+# and print_ubacktrace()
+#
+probe begin
+{
+ print_ustack(ubacktrace());
+ print_ubacktrace();
+}
diff --git a/testsuite/parseko/utrace01.stp b/testsuite/parseko/utrace01.stp
index 1cb4227f..9f3619b5 100755
--- a/testsuite/parseko/utrace01.stp
+++ b/testsuite/parseko/utrace01.stp
@@ -1,4 +1,4 @@
#! stap -p2
# process NAME must be a string
-probe process(/bin/cat).death { }
+probe process(/bin/cat).end { }
diff --git a/testsuite/semko/utrace01.stp b/testsuite/semko/utrace01.stp
deleted file mode 100755
index a4707008..00000000
--- a/testsuite/semko/utrace01.stp
+++ /dev/null
@@ -1,4 +0,0 @@
-#! stap -p2
-
-# missing process NAME|PID
-probe process.death { }
diff --git a/testsuite/semko/utrace03.stp b/testsuite/semko/utrace03.stp
index c682410b..92177ffd 100755
--- a/testsuite/semko/utrace03.stp
+++ b/testsuite/semko/utrace03.stp
@@ -1,4 +1,4 @@
#! stap -p2
# invalid probe type
-probe process("/bin/cat").death.return { }
+probe process("/bin/cat").end.return { }
diff --git a/testsuite/semko/utrace04.stp b/testsuite/semko/utrace04.stp
index 6345f9f6..1d26a43c 100755
--- a/testsuite/semko/utrace04.stp
+++ b/testsuite/semko/utrace04.stp
@@ -1,4 +1,4 @@
#! stap -p2
-# death probes don't support target symbols
-probe process("/bin/cat").death.return { print($syscall) }
+# end probes don't support target symbols
+probe process("/bin/cat").end { print($syscall) }
diff --git a/testsuite/semko/utrace08.stp b/testsuite/semko/utrace08.stp
deleted file mode 100755
index a558a5be..00000000
--- a/testsuite/semko/utrace08.stp
+++ /dev/null
@@ -1,4 +0,0 @@
-#! stap -p2
-
-# process path must be absolute
-probe process("cat").death { }
diff --git a/testsuite/semko/utrace09.stp b/testsuite/semko/utrace09.stp
deleted file mode 100755
index 60c49cd2..00000000
--- a/testsuite/semko/utrace09.stp
+++ /dev/null
@@ -1,4 +0,0 @@
-#! stap -p2
-
-# process path must be absolute
-probe process("/foo/../bar").death { }
diff --git a/testsuite/semko/utrace10.stp b/testsuite/semko/utrace10.stp
deleted file mode 100755
index b46baea9..00000000
--- a/testsuite/semko/utrace10.stp
+++ /dev/null
@@ -1,4 +0,0 @@
-#! stap -p2
-
-# path can't contain an empty component
-probe process("/foo//bar").death { }
diff --git a/testsuite/semko/utrace11.stp b/testsuite/semko/utrace11.stp
deleted file mode 100755
index d78b602c..00000000
--- a/testsuite/semko/utrace11.stp
+++ /dev/null
@@ -1,4 +0,0 @@
-#! stap -p2
-
-# path can't end with '/'
-probe process("/foo/bar/").death { }
diff --git a/testsuite/semko/utrace12.stp b/testsuite/semko/utrace12.stp
deleted file mode 100755
index 478aa1d3..00000000
--- a/testsuite/semko/utrace12.stp
+++ /dev/null
@@ -1,4 +0,0 @@
-#! stap -p2
-
-# path can't end with '.'
-probe process("/foo/bar/.").death { }
diff --git a/testsuite/semko/utrace13.stp b/testsuite/semko/utrace13.stp
deleted file mode 100755
index 16cc0391..00000000
--- a/testsuite/semko/utrace13.stp
+++ /dev/null
@@ -1,4 +0,0 @@
-#! stap -p2
-
-# path can't end with '..'
-probe process("/foo/bar/..").death { }
diff --git a/testsuite/semok/cast.stp b/testsuite/semok/cast.stp
index d30823cd..769335f2 100755
--- a/testsuite/semok/cast.stp
+++ b/testsuite/semok/cast.stp
@@ -12,6 +12,6 @@ probe begin {
// but who knows what debuginfo is installed...
// check modules generated from headers
- println(@cast(0, "task_struct", "kmod<linux/sched.h>")->tgid)
- println(@cast(0, "timeval", "umod<sys/time.h>")->tv_sec)
+ println(@cast(0, "task_struct", "kernel<linux/sched.h>")->tgid)
+ println(@cast(0, "timeval", "<sys/time.h>")->tv_sec)
}
diff --git a/testsuite/semok/utrace01.stp b/testsuite/semok/utrace01.stp
new file mode 100755
index 00000000..864bdf15
--- /dev/null
+++ b/testsuite/semok/utrace01.stp
@@ -0,0 +1,4 @@
+#! stap -p2
+
+# process path doesn't need to be absolute
+probe process("cat").end { }
diff --git a/testsuite/systemtap.base/cast.stp b/testsuite/systemtap.base/cast.stp
index 33a14a28..6298a06d 100644
--- a/testsuite/systemtap.base/cast.stp
+++ b/testsuite/systemtap.base/cast.stp
@@ -11,7 +11,7 @@ probe begin
printf("PID %d != %d\n", pid, cast_pid)
// Compare PIDs using a generated kernel module
- cast_pid = @cast(curr, "task_struct", "kmod<linux/sched.h>")->tgid
+ cast_pid = @cast(curr, "task_struct", "kernel<linux/sched.h>")->tgid
if (pid == cast_pid)
println("PID2 OK")
else
@@ -27,7 +27,7 @@ probe begin
// Compare tv_sec using a generated user module
sec = 42
- cast_sec = @cast(get_timeval(sec), "timeval", "umod<sys/time.h>")->tv_sec
+ cast_sec = @cast(get_timeval(sec), "timeval", "<sys/time.h>")->tv_sec
if (sec == cast_sec)
println("tv_sec OK")
else
diff --git a/testsuite/systemtap.base/uprobes_ustack.exp b/testsuite/systemtap.base/uprobes_ustack.exp
new file mode 100644
index 00000000..bfc435e9
--- /dev/null
+++ b/testsuite/systemtap.base/uprobes_ustack.exp
@@ -0,0 +1,97 @@
+set test "uprobes_ustack"
+set testpath "$srcdir/$subdir"
+set testsrc "$testpath/uprobes_exe.c"
+set testsrclib "$testpath/uprobes_lib.c"
+set testexe "./uprobes_exe"
+set testlibname "uprobes_lib"
+set testlibdir "."
+set testso "$testlibdir/lib${testlibname}.so"
+set testflags "additional_flags=-g additional_flags=-O"
+set testlibflags "$testflags additional_flags=-fPIC additional_flags=-shared"
+set maintestflags "$testflags additional_flags=-L$testlibdir additional_flags=-l$testlibname additional_flags=-Wl,-rpath,$testlibdir"
+
+# Compile our test program and library.
+set res [target_compile $testsrclib $testso executable $testlibflags]
+if { $res != "" } {
+ verbose "target_compile for $testso failed: $res" 2
+ fail "$test compile $testsrclib"
+ return
+} else {
+ pass "$test compile $testsrclib"
+}
+
+set res [target_compile $testsrc $testexe executable $maintestflags]
+if { $res != "" } {
+ verbose "target_compile failed: $res" 2
+ fail "$test compile $testsrc"
+ return
+} else {
+ pass "$test compile $testsrc"
+}
+
+set ::result_string {exe: main=main
+exe: main_func=main_func
+exe: main_func=main_func
+exe: main_func=main_func
+lib: lib_main=lib_main
+lib: lib_func=lib_func
+lib: lib_func=lib_func
+lib: lib_func=lib_func}
+
+# Only run on make installcheck
+if {! [installtest_p]} { untested "$test"; return }
+if {! [utrace_p]} { untested $test; return }
+
+# Output is:
+#print_ubacktrace exe 0
+# 0x080484ba : main_func+0xa/0x29 [.../uprobes_exe]
+# 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe]
+#print_ustack exe 1
+# 0x080484ba : main_func+0xa/0x29 [.../uprobes_exe]
+# 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe]
+# 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe]
+#print_ubacktrace lib 2
+# 0x00db2422 : lib_func+0x16/0x2b [.../libuprobes_lib.so]
+# 0x00db2455 : lib_main+0x1e/0x29 [.../libuprobes_lib.so]
+# 0x080484d0 : main_func+0x20/0x29 [.../uprobes_exe]
+# 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe]
+# 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe]
+# 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe]
+#print_ustack lib 3
+# 0x00db2422 : lib_func+0x16/0x2b [.../libuprobes_lib.so]
+# 0x00db2431 : lib_func+0x25/0x2b [.../libuprobes_lib.so]
+# 0x00db2455 : lib_main+0x1e/0x29 [.../libuprobes_lib.so]
+# 0x080484d0 : main_func+0x20/0x29 [.../uprobes_exe]
+# 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe]
+# 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe]
+# 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe]
+
+set print 0
+set main 0
+set main_func 0
+set lib_main 0
+set lib_func 0
+# Needs extra space since on 64bit the last ubacktrace string is
+# 7 entries * (16 hex + 2 for 0x + 1 space) = 133 chars.
+# Default MAXSTRINGLEN is 128 chars.
+spawn stap -DMAXSTRINGLEN=133 $srcdir/$subdir/$test.stp -c $testexe
+
+wait
+expect {
+ -timeout 60
+ -re {^print_[^\r\n]+\r\n} {incr print; exp_continue}
+ -re {^ 0x[a-f0-9]+ : main\+0x[^\r\n]+\r\n} {incr main; exp_continue}
+ -re {^ 0x[a-f0-9]+ : main_func\+0x[^\r\n]+\r\n} {incr main_func; exp_continue}
+ -re {^ 0x[a-f0-9]+ : lib_main\+0x[^\r\n]+\r\n} {incr lib_main; exp_continue}
+ -re {^ 0x[a-f0-9]+ : lib_func\+0x[^\r\n]+\r\n} {incr lib_func; exp_continue}
+ timeout { fail "$test (timeout)" }
+ eof { }
+}
+
+if {$print == 4} {pass "$test print"} {fail "$test print ($print)"}
+if {$main == 4} {pass "$test main"} {fail "$test main ($main)"}
+if {$main_func == 9} {pass "$test main_func"} {fail "$test main_func ($main_func)"}
+if {$lib_main == 2} {pass "$test lib_main"} {fail "$test lib_main ($lib_main)"}
+if {$lib_func == 3} {pass "$test lib_func"} {fail "$test lib_func ($lib_func)"}
+
+#exec rm -f $testexe $testso
diff --git a/testsuite/systemtap.base/uprobes_ustack.stp b/testsuite/systemtap.base/uprobes_ustack.stp
new file mode 100644
index 00000000..6de03b42
--- /dev/null
+++ b/testsuite/systemtap.base/uprobes_ustack.stp
@@ -0,0 +1,35 @@
+// Prints backtrace from lib through exe twice using diffent ustack functions.
+
+global hits = 0;
+
+probe process("uprobes_exe").function("main_func")
+{
+ if (hits == 0)
+ {
+ log("print_ubacktrace exe 0");
+ print_ubacktrace();
+ hits++;
+ }
+ else if (hits == 1)
+ {
+ log("print_ustack exe 1");
+ print_ustack(ubacktrace());
+ hits++;
+ }
+}
+
+probe process("libuprobes_lib.so").function("lib_func")
+{
+ if (hits == 2)
+ {
+ log("print_ubacktrace lib 2");
+ print_ubacktrace();
+ hits++;
+ }
+ else if (hits == 3)
+ {
+ log("print_ustack lib 3");
+ print_ustack(ubacktrace());
+ hits++;
+ }
+}
diff --git a/testsuite/systemtap.context/backtrace.tcl b/testsuite/systemtap.context/backtrace.tcl
index 6edda812..975e6c4d 100644
--- a/testsuite/systemtap.context/backtrace.tcl
+++ b/testsuite/systemtap.context/backtrace.tcl
@@ -5,6 +5,7 @@ set m4 0
set m5 0
set m6 0
+#spawn stap -d kernel -d systemtap_test_module1 -DMAXSTRINGLEN=256 $srcdir/$subdir/backtrace.stp
spawn stap -DMAXSTRINGLEN=256 $srcdir/$subdir/backtrace.stp
#exp_internal 1
expect {
diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html
index a2dc7d5c..0df681ac 100644
--- a/testsuite/systemtap.examples/index.html
+++ b/testsuite/systemtap.examples/index.html
@@ -121,7 +121,7 @@ keywords: <a href="keyword-index.html#SIGNALS">SIGNALS</a> <br>
<li><a href="process/sigkill.stp">process/sigkill.stp</a> - Track SIGKILL Signals<br>
keywords: <a href="keyword-index.html#SIGNALS">SIGNALS</a> <br>
<p>The script traces any SIGKILL signals. When that SIGKILL signal is sent to a process, the script prints out the signal name, the desination executable and process ID, the executable name user ID that sent the signal.</p></li>
-<li><a href="process/syscalls_by_pid.stp">process/syscalls_by_pid.stp</a> - System-Wide Count of Syscalls by PID<br>
+<li><a href="process/sigmon.stp">process/sigmon.stp</a> - Track a particular signal to a specific process<br>
keywords: <a href="keyword-index.html#SIGNALS">SIGNALS</a> <br>
<p>The script watches for a particular signal sent to a specific process. When that signal is sent to the specified process, the script prints out the PID and executable of the process sending the signal, the PID and executable name of the process receiving the signal, and the signal number and name.</p></li>
<li><a href="process/sleepingBeauties.stp">process/sleepingBeauties.stp</a> - Generating Backtraces of Threads Waiting for IO Operations<br>
diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt
index 2f85628a..fa344933 100644
--- a/testsuite/systemtap.examples/index.txt
+++ b/testsuite/systemtap.examples/index.txt
@@ -245,7 +245,7 @@ keywords: signals
that sent the signal.
-process/syscalls_by_pid.stp - System-Wide Count of Syscalls by PID
+process/sigmon.stp - Track a particular signal to a specific process
keywords: signals
The script watches for a particular signal sent to a specific
diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html
index 473c0091..7edbec21 100644
--- a/testsuite/systemtap.examples/keyword-index.html
+++ b/testsuite/systemtap.examples/keyword-index.html
@@ -234,7 +234,7 @@ keywords: <a href="keyword-index.html#SIGNALS">SIGNALS</a> <br>
<li><a href="process/sigkill.stp">process/sigkill.stp</a> - Track SIGKILL Signals<br>
keywords: <a href="keyword-index.html#SIGNALS">SIGNALS</a> <br>
<p>The script traces any SIGKILL signals. When that SIGKILL signal is sent to a process, the script prints out the signal name, the desination executable and process ID, the executable name user ID that sent the signal.</p></li>
-<li><a href="process/syscalls_by_pid.stp">process/syscalls_by_pid.stp</a> - System-Wide Count of Syscalls by PID<br>
+<li><a href="process/sigmon.stp">process/sigmon.stp</a> - Track a particular signal to a specific process<br>
keywords: <a href="keyword-index.html#SIGNALS">SIGNALS</a> <br>
<p>The script watches for a particular signal sent to a specific process. When that signal is sent to the specified process, the script prints out the PID and executable of the process sending the signal, the PID and executable name of the process receiving the signal, and the signal number and name.</p></li>
</ul>
diff --git a/testsuite/systemtap.examples/keyword-index.txt b/testsuite/systemtap.examples/keyword-index.txt
index 1d5add5f..b53e776f 100644
--- a/testsuite/systemtap.examples/keyword-index.txt
+++ b/testsuite/systemtap.examples/keyword-index.txt
@@ -449,7 +449,7 @@ keywords: signals
that sent the signal.
-process/syscalls_by_pid.stp - System-Wide Count of Syscalls by PID
+process/sigmon.stp - Track a particular signal to a specific process
keywords: signals
The script watches for a particular signal sent to a specific
diff --git a/testsuite/systemtap.examples/process/sigmon.meta b/testsuite/systemtap.examples/process/sigmon.meta
index 18834997..fe192248 100644
--- a/testsuite/systemtap.examples/process/sigmon.meta
+++ b/testsuite/systemtap.examples/process/sigmon.meta
@@ -1,5 +1,5 @@
-title: System-Wide Count of Syscalls by PID
-name: syscalls_by_pid.stp
+title: Track a particular signal to a specific process
+name: sigmon.stp
version: 1.0
author: IBM
keywords: signals