From 355fc303a5a99f085c5f3e323f446b67778558ad Mon Sep 17 00:00:00 2001 From: hunt Date: Tue, 1 May 2007 17:20:57 +0000 Subject: 2007-05-01 Martin Hunt * systemtap.samples/system_func.*: New test. --- testsuite/systemtap.samples/system_func.stp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 testsuite/systemtap.samples/system_func.stp (limited to 'testsuite/systemtap.samples/system_func.stp') 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") +} -- cgit