summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-03-11 20:30:58 -0700
committerJosh Stone <jistone@redhat.com>2009-03-11 20:41:25 -0700
commit6769e48794cfbeda3957f691077fb9d65f3e87bc (patch)
treec0c5ca23e400a9b02daf1c34fe5958f3f7888ed6
parent139dee87b8824df4d7562a980e886a6e6f0b8308 (diff)
downloadsystemtap-steved-6769e48794cfbeda3957f691077fb9d65f3e87bc.tar.gz
systemtap-steved-6769e48794cfbeda3957f691077fb9d65f3e87bc.tar.xz
systemtap-steved-6769e48794cfbeda3957f691077fb9d65f3e87bc.zip
Add test to compile and run all tracepoints
This checks that kernel.trace("*") will compile, with all context variables accessed as well. For kernels without tracepoints, it will just hit a "begin" and quit. This doesn't ensure that kernel.trace("*") will always find something when it should, though...
-rw-r--r--testsuite/systemtap.base/tracepoints.exp3
-rw-r--r--testsuite/systemtap.base/tracepoints.stp23
2 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/tracepoints.exp b/testsuite/systemtap.base/tracepoints.exp
new file mode 100644
index 00000000..bea461c4
--- /dev/null
+++ b/testsuite/systemtap.base/tracepoints.exp
@@ -0,0 +1,3 @@
+set test "tracepoints"
+set ::result_string {tracepoints OK}
+stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.base/tracepoints.stp b/testsuite/systemtap.base/tracepoints.stp
new file mode 100644
index 00000000..bdb4d730
--- /dev/null
+++ b/testsuite/systemtap.base/tracepoints.stp
@@ -0,0 +1,23 @@
+// This checks that we can compile and register every tracepoint
+// we can find, along with all of their context variables.
+global hits
+probe all_tracepoints = kernel.trace("*")
+{
+ if ($$name . $$vars . $$parms == "")
+ next
+
+ // Allow it to quit once we hit our hundredth tracepoint
+ if (++hits < 100)
+ next
+}
+
+// If there aren't any tracepoints in the kernel,
+// we use "begin" instead to quit right away.
+probe all_tracepoints!, begin {
+ println("tracepoints OK")
+ exit()
+}
+
+// give hits a use so there's no warning
+// when we don't have tracepoints
+probe never { hits++ }