summaryrefslogtreecommitdiffstats
path: root/testsuite/provok/one.stp
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/provok/one.stp')
-rwxr-xr-xtestsuite/provok/one.stp26
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/provok/one.stp b/testsuite/provok/one.stp
new file mode 100755
index 00000000..e51ee28a
--- /dev/null
+++ b/testsuite/provok/one.stp
@@ -0,0 +1,26 @@
+#! stap
+
+global ar1, ar2
+
+function string (v) { return "" } # to become built-in
+
+function search (key)
+{
+ if (key in ar1)
+ { ar1[key] ++; return ar2[ar1[key]] }
+ else
+ return "no can do"
+}
+
+probe syscall("zamboni")
+{
+ thread->ar2 = $tgid;
+ search ($pid)
+}
+
+probe end
+{
+ for (key in ar2)
+ # if (key in ar2)
+ printk ("this: " . string (key) . " was " . string (ar2[key]))
+}