summaryrefslogtreecommitdiffstats
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
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.
-rwxr-xr-xtestsuite/semko/nodwf01.stp14
-rwxr-xr-xtestsuite/semko/nodwf02.stp14
-rwxr-xr-xtestsuite/semko/nodwf03.stp14
-rwxr-xr-xtestsuite/semko/nodwf04.stp14
-rwxr-xr-xtestsuite/semko/nodwf05.stp14
-rwxr-xr-xtestsuite/semko/nodwf06.stp14
-rwxr-xr-xtestsuite/semko/nodwf07.stp15
-rwxr-xr-xtestsuite/semko/nodwf08.stp14
-rwxr-xr-xtestsuite/semko/nodwf09.stp14
-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
16 files changed, 287 insertions, 0 deletions
diff --git a/testsuite/semko/nodwf01.stp b/testsuite/semko/nodwf01.stp
new file mode 100755
index 00000000..25217bac
--- /dev/null
+++ b/testsuite/semko/nodwf01.stp
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# Verify that --ignore-vmlinux "hides" vmlinux.
+
+stap -p2 --ignore-vmlinux -e '
+probe kernel.function("printk") {
+ printf("%s called\n", probefunc())
+ exit()
+}
+
+probe timer.sec(30) {
+ exit()
+}
+'
diff --git a/testsuite/semko/nodwf02.stp b/testsuite/semko/nodwf02.stp
new file mode 100755
index 00000000..8f82d54b
--- /dev/null
+++ b/testsuite/semko/nodwf02.stp
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# Verify that --ignore-dwarf "hides" dwarf info.
+
+stap -p2 --ignore-dwarf -e '
+probe kernel.function("printk") {
+ printf("%s called\n", probefunc())
+ exit()
+}
+
+probe timer.sec(30) {
+ exit()
+}
+'
diff --git a/testsuite/semko/nodwf03.stp b/testsuite/semko/nodwf03.stp
new file mode 100755
index 00000000..6b66f2e9
--- /dev/null
+++ b/testsuite/semko/nodwf03.stp
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# --kelf doesn't work if vmlinux can't be found.
+
+stap -p2 --ignore-vmlinux --kelf -e '
+probe kernel.function("printk") {
+ printf("%s called\n", probefunc())
+ exit()
+}
+
+probe timer.sec(30) {
+ exit()
+}
+'
diff --git a/testsuite/semko/nodwf04.stp b/testsuite/semko/nodwf04.stp
new file mode 100755
index 00000000..c20dec4f
--- /dev/null
+++ b/testsuite/semko/nodwf04.stp
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# The symbol table doesn't give us enough info to probe inline functions.
+
+stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e '
+probe kernel.function("list_empty").inline {
+ printf("%s called\n", probefunc())
+ exit()
+}
+
+probe timer.sec(15) {
+ exit()
+}
+'
diff --git a/testsuite/semko/nodwf05.stp b/testsuite/semko/nodwf05.stp
new file mode 100755
index 00000000..83fcfa3d
--- /dev/null
+++ b/testsuite/semko/nodwf05.stp
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# The symbol table doesn't give us enough info to map source files to functions.
+
+stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e '
+probe kernel.function("*@kernel/printk.c") {
+ printf("%s called\n", probefunc())
+ exit()
+}
+
+probe timer.sec(15) {
+ exit()
+}
+'
diff --git a/testsuite/semko/nodwf06.stp b/testsuite/semko/nodwf06.stp
new file mode 100755
index 00000000..7318cbec
--- /dev/null
+++ b/testsuite/semko/nodwf06.stp
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# The symbol table doesn't give us enough info to probe statements.
+
+stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e '
+probe kernel.statement("*@kernel/printk.c:639") {
+ printf("probe hit: %s\n", pp())
+ exit()
+}
+
+probe timer.sec(15) {
+ exit()
+}
+'
diff --git a/testsuite/semko/nodwf07.stp b/testsuite/semko/nodwf07.stp
new file mode 100755
index 00000000..4a2cf4a5
--- /dev/null
+++ b/testsuite/semko/nodwf07.stp
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# This should fail until/unless we expand our blacklist to cover symbols
+# in the symbol table that don't show up in dwarf.
+
+stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e '
+probe kernel.function("*") {
+ printf("%s called\n", probefunc())
+ exit()
+}
+
+probe timer.sec(15) {
+ exit()
+}
+'
diff --git a/testsuite/semko/nodwf08.stp b/testsuite/semko/nodwf08.stp
new file mode 100755
index 00000000..4b6d9da5
--- /dev/null
+++ b/testsuite/semko/nodwf08.stp
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# The regular blacklist should thwart this.
+
+stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e '
+probe kernel.function("register_kprobe") {
+ printf("%s called\n", probefunc())
+ exit()
+}
+
+probe timer.sec(30) {
+ exit()
+}
+'
diff --git a/testsuite/semko/nodwf09.stp b/testsuite/semko/nodwf09.stp
new file mode 100755
index 00000000..e103833f
--- /dev/null
+++ b/testsuite/semko/nodwf09.stp
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# The symbol table doesn't give us enough info to evaluate target variables.
+
+stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e '
+probe kernel.function("printk") {
+ printf("%s called; fmt = \"%s\"\n", probefunc(), kernel_string($fmt))
+ exit()
+}
+
+probe timer.sec(15) {
+ exit()
+}
+'
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()
+}
+'