summaryrefslogtreecommitdiffstats
path: root/testsuite/semok
diff options
context:
space:
mode:
authorJim Keniston <jkenisto@us.ibm.com>2008-04-18 16:28:55 -0700
committerJim Keniston <jkenisto@us.ibm.com>2008-04-18 16:28:55 -0700
commit65da5355aa93d507d8ed8ca97ce7bed234af638a (patch)
treeb42b4a867f52df9eb826fa5732fab76a2cf38394 /testsuite/semok
parent5f0a03a685a11bda62d69588f39e3fc26375d180 (diff)
downloadsystemtap-steved-65da5355aa93d507d8ed8ca97ce7bed234af638a.tar.gz
systemtap-steved-65da5355aa93d507d8ed8ca97ce7bed234af638a.tar.xz
systemtap-steved-65da5355aa93d507d8ed8ca97ce7bed234af638a.zip
* testsuite/{semok,semko}/nodwf*.stp
Shows what we currently can and can't do.
Diffstat (limited to 'testsuite/semok')
-rwxr-xr-xtestsuite/semok/nodwf01.stp12
-rwxr-xr-xtestsuite/semok/nodwf02.stp44
-rwxr-xr-xtestsuite/semok/nodwf03.stp13
-rwxr-xr-xtestsuite/semok/nodwf04.stp14
-rwxr-xr-xtestsuite/semok/nodwf05.stp46
-rwxr-xr-xtestsuite/semok/nodwf06.stp14
-rwxr-xr-xtestsuite/semok/nodwf07.stp17
7 files changed, 160 insertions, 0 deletions
diff --git a/testsuite/semok/nodwf01.stp b/testsuite/semok/nodwf01.stp
new file mode 100755
index 00000000..c7a08f2a
--- /dev/null
+++ b/testsuite/semok/nodwf01.stp
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e '
+global nret
+
+probe syscall.*.return {
+ /* NB: $return does NOT currently work here. */
+ printf("%s returns %s\n", name, returnstr(2));
+ if (nret++ > 50)
+ exit()
+}
+'
diff --git a/testsuite/semok/nodwf02.stp b/testsuite/semok/nodwf02.stp
new file mode 100755
index 00000000..545f6154
--- /dev/null
+++ b/testsuite/semok/nodwf02.stp
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e '
+global ncall
+
+/*
+ * We want
+ * probe syscall.*
+ * but in the syscall tapset, the prologue blocks for the following system
+ * calls contain "if" statements that cause target variables to be read...
+ * and we cannot evaluate target variables without dwarf.
+ * bdflush, clock_nanosleep, fork, futex, getrusage, mq_open, open, sysfs
+ */
+probe
+ syscall.a*,
+ /* skip b */
+ /* skip c */
+ syscall.d*,
+ syscall.e*,
+ /* skip f */
+ /* skip g */
+ /* no h */
+ syscall.i*,
+ /* no j */
+ syscall.k*,
+ syscall.l*,
+ /* skip m */
+ syscall.n*,
+ /* skip o */
+ syscall.p*,
+ syscall.q*,
+ syscall.r*,
+ /* skip s */
+ syscall.t*,
+ syscall.u*,
+ syscall.v*,
+ syscall.w*
+ /* no xyz */
+{
+ printf("%s called\n", name)
+ if (ncall++ > 50)
+ exit()
+}
+'
diff --git a/testsuite/semok/nodwf03.stp b/testsuite/semok/nodwf03.stp
new file mode 100755
index 00000000..6f8b3629
--- /dev/null
+++ b/testsuite/semok/nodwf03.stp
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# Test function-name wildcard.
+
+stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e '
+global ncall
+
+probe kernel.function("sys_*") {
+ printf("%s called\n", probefunc())
+ if (ncall++ > 50)
+ exit()
+}
+'
diff --git a/testsuite/semok/nodwf04.stp b/testsuite/semok/nodwf04.stp
new file mode 100755
index 00000000..84438fda
--- /dev/null
+++ b/testsuite/semok/nodwf04.stp
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# Like nodwf01.stp, but extract the symbol table from vmlinux.
+
+stap -p2 --ignore-dwarf --kelf -e '
+global nret
+
+probe syscall.*.return {
+ /* NB: $return does NOT currently work here. */
+ printf("%s returns %s\n", name, returnstr(2));
+ if (nret++ > 50)
+ exit()
+}
+'
diff --git a/testsuite/semok/nodwf05.stp b/testsuite/semok/nodwf05.stp
new file mode 100755
index 00000000..d0043eab
--- /dev/null
+++ b/testsuite/semok/nodwf05.stp
@@ -0,0 +1,46 @@
+#!/bin/sh
+#
+# Like nodwf02.stp, but extract the symbol table from vmlinux.
+
+stap -p2 --ignore-dwarf --kelf -e '
+global ncall
+
+/*
+ * We want
+ * probe syscall.*
+ * but in the syscall tapset, the prologue blocks for the following system
+ * calls contain "if" statements that cause target variables to be read...
+ * and we cannot evaluate target variables without dwarf.
+ * bdflush, clock_nanosleep, fork, futex, getrusage, mq_open, open, sysfs
+ */
+probe
+ syscall.a*,
+ /* skip b */
+ /* skip c */
+ syscall.d*,
+ syscall.e*,
+ /* skip f */
+ /* skip g */
+ /* no h */
+ syscall.i*,
+ /* no j */
+ syscall.k*,
+ syscall.l*,
+ /* skip m */
+ syscall.n*,
+ /* skip o */
+ syscall.p*,
+ syscall.q*,
+ syscall.r*,
+ /* skip s */
+ syscall.t*,
+ syscall.u*,
+ syscall.v*,
+ syscall.w*
+ /* no xyz */
+{
+ printf("%s called\n", name)
+ if (ncall++ > 50)
+ exit()
+}
+'
diff --git a/testsuite/semok/nodwf06.stp b/testsuite/semok/nodwf06.stp
new file mode 100755
index 00000000..d27e3f84
--- /dev/null
+++ b/testsuite/semok/nodwf06.stp
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# Test function-name wildcard.
+# Like nodwf03.stp, but extract the symbol table from vmlinux.
+
+stap -p2 --ignore-dwarf --kelf -e '
+global ncall
+
+probe kernel.function("sys_*") {
+ printf("%s called\n", probefunc())
+ if (ncall++ > 50)
+ exit()
+}
+'
diff --git a/testsuite/semok/nodwf07.stp b/testsuite/semok/nodwf07.stp
new file mode 100755
index 00000000..d886ac79
--- /dev/null
+++ b/testsuite/semok/nodwf07.stp
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# Test module-name and function-name wildcards.
+
+stap -p2 --ignore-dwarf --kelf -e '
+global ncall
+
+probe module("*").function("*_probe") {
+ printf("%s called\n", probefunc())
+ if (ncall++ > 50)
+ exit()
+}
+
+probe timer.sec(5) {
+ exit()
+}
+'