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.stp23
1 files changed, 15 insertions, 8 deletions
diff --git a/testsuite/systemtap.samples/system_func.stp b/testsuite/systemtap.samples/system_func.stp
index 60d9a723..0b074514 100644
--- a/testsuite/systemtap.samples/system_func.stp
+++ b/testsuite/systemtap.samples/system_func.stp
@@ -2,20 +2,27 @@
# test the system() function
+global saw_echo
+
probe kernel.function("sys_open") {
- # very inefficient. Testing only. DO NOT DO THIS
- msg="echo sys_open"
- system(msg)
+ if (!saw_echo) {
+ # very inefficient. Testing only. DO NOT DO THIS
+ msg="echo sys_open"
+ system(msg)
+ saw_echo = 1
+ }
+}
+
+probe timer.ms(100) {
+ # should fail
+ system("cat __xyzzy123ABC__")
}
+probe timer.ms(110) { exit() }
+
probe begin {
# should succeed
system("whoami")
-
- # should fail
- system("cat __xyzzy123ABC__")
-
- exit()
}
probe end {