summaryrefslogtreecommitdiffstats
path: root/testsuite/semok
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/semok')
-rwxr-xr-xtestsuite/semok/fourteen.stp30
-rwxr-xr-xtestsuite/semok/thirteen.stp27
-rwxr-xr-xtestsuite/semok/twelve.stp17
3 files changed, 74 insertions, 0 deletions
diff --git a/testsuite/semok/fourteen.stp b/testsuite/semok/fourteen.stp
new file mode 100755
index 00000000..9326ebe2
--- /dev/null
+++ b/testsuite/semok/fourteen.stp
@@ -0,0 +1,30 @@
+#! stap -p2
+
+function trace (s) { return 0 }
+
+# recursive alias expansion
+
+probe foo = begin
+{
+ trace("hello")
+}
+
+probe bar = foo
+{
+ x=1
+}
+
+probe baz = bar
+{
+ y=2
+}
+
+probe quux = baz
+{
+ z = x + y
+}
+
+probe quux, end
+{
+ trace("goodbye")
+}
diff --git a/testsuite/semok/thirteen.stp b/testsuite/semok/thirteen.stp
new file mode 100755
index 00000000..91d767fb
--- /dev/null
+++ b/testsuite/semok/thirteen.stp
@@ -0,0 +1,27 @@
+#! stap -p2
+
+function trace (s) { return 0 }
+
+# define some aliases which resolve to kernel functions
+
+probe pipe_read = kernel.function("pipe_read")
+{
+ fname = "pipe_read"
+ reading_from_pipe = 1
+}
+
+probe pipe_write = kernel.function("pipe_write")
+{
+ fname = "pipe_write"
+ reading_from_pipe = 0
+}
+
+# use the aliases, including variables defined in them
+
+probe pipe_read, pipe_write
+{
+ if (reading_from_pipe)
+ trace("reading from pipe in " . fname)
+ else
+ trace("writing to pipe in " . fname)
+}
diff --git a/testsuite/semok/twelve.stp b/testsuite/semok/twelve.stp
new file mode 100755
index 00000000..8eccd463
--- /dev/null
+++ b/testsuite/semok/twelve.stp
@@ -0,0 +1,17 @@
+#! stap -p2
+
+function trace (s) { return 0 }
+
+# resolve to a set of kernel functions
+
+probe kernel.function("pipe_*")
+{
+ trace("doing something with a pipe")
+}
+
+# resolve to a set of module functions
+
+probe module("jbd").function("journal_get_*_access@*/transaction.c")
+{
+ trace("inside journal_get_*_access, in transaction.c")
+}