summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.samples/system_func.stp
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.samples/system_func.stp')
-rw-r--r--testsuite/systemtap.samples/system_func.stp24
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/systemtap.samples/system_func.stp b/testsuite/systemtap.samples/system_func.stp
new file mode 100644
index 00000000..60d9a723
--- /dev/null
+++ b/testsuite/systemtap.samples/system_func.stp
@@ -0,0 +1,24 @@
+#! stap
+
+# test the system() function
+
+probe kernel.function("sys_open") {
+ # very inefficient. Testing only. DO NOT DO THIS
+ msg="echo sys_open"
+ system(msg)
+}
+
+probe begin {
+ # should succeed
+ system("whoami")
+
+ # should fail
+ system("cat __xyzzy123ABC__")
+
+ exit()
+}
+
+probe end {
+ # should succeed
+ system("echo DONE")
+}