My environment is kernel-2.6.21-rc7, systemtap-20070505, elfutils-0.125 Systemtap.samples/system_func.stp probes sys_open and prints "sys_open". But system_func.stp taking some time to print "sys_open" and hence system_func.exp which greps "sys_open" is failing. ================================================================== Running /home/systemtap/tmp/stap_testing_200705070516/src/testsuite/systemtap.samples/system_func.e xp ... cat: __xyzzy123ABC__: No such file or directory root Waititing for processes to exit DONE FAIL: system_func (0,1,1) testcase /home/systemtap/tmp/stap_testing_200705070516/src/testsuite/systemtap.samples/system_func. exp completed in 6 seconds ================================================ I have added extra 10 secs timer to wait for "sys_open" message. This fixes the problem. ======================================= #! 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__") } probe timer.ms(10000) { exit() } probe end { # should succeed system("echo DONE") } ============================
This is an example of a common race between "begin" and other probes. Or at least, there used to be a race. Now, begin probes are strictly done first, and kprobes etc. are only registered afterward. What could work here even better is an added timer probe that is bound to run while the kprobes are active, and thus trigger sys_open soon: probe timer.ms(500) { system ("cat DOESNOTEXIST") }
Fixed to generate a call to sys_open() aftern the begin probe is run.
Bug is getting reproduced on systemtap-20070526 build.
Looks like there is still a race. Checked in some additional fixes.