diff options
author | David Smith <dsmith@redhat.com> | 2010-02-10 16:35:46 -0600 |
---|---|---|
committer | David Smith <dsmith@redhat.com> | 2010-02-10 16:35:46 -0600 |
commit | 42048078ab7712361ce54fa9face358f75e1d699 (patch) | |
tree | b17e3e87c0212125ac1c10669338098565dfbf81 /testsuite/systemtap.syscall/nd_sys.stp | |
parent | 6878a54351f98eff364ba8e9b43bc69a7d63f789 (diff) | |
download | systemtap-steved-42048078ab7712361ce54fa9face358f75e1d699.tar.gz systemtap-steved-42048078ab7712361ce54fa9face358f75e1d699.tar.xz systemtap-steved-42048078ab7712361ce54fa9face358f75e1d699.zip |
Fixed PR 11270 by adding nd_syscall testcase.
* testsuite/systemtap.syscall/test.tcl: Now uses global variable
'test_script' to find test script to run.
* testsuite/systemtap.syscall/syscall.exp: Sets test_script.
* testsuite/systemtap.syscall/nd_sys.stp: New test script. Copy of
sys.stp, but uses nd_syscall probes.
* testsuite/systemtap.syscall/nd_syscall.exp: New testcase. Copy of
syscall.exp, but uses nd_sys.stp test script.
Diffstat (limited to 'testsuite/systemtap.syscall/nd_sys.stp')
-rwxr-xr-x | testsuite/systemtap.syscall/nd_sys.stp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/testsuite/systemtap.syscall/nd_sys.stp b/testsuite/systemtap.syscall/nd_sys.stp new file mode 100755 index 00000000..5936cb77 --- /dev/null +++ b/testsuite/systemtap.syscall/nd_sys.stp @@ -0,0 +1,37 @@ +global indent, indent_str, entry_p + +probe begin { + indent = 0 + for (i=0; i<20; i++) { + if (i == 0) + indent_str[0] = "" + else + indent_str[i] = indent_str[i-1] . " " + } +} + + +probe nd_syscall.* ? { + if (pid() == target()) { + if (entry_p) printf("\n") + printf("%s%s: %s (%s) = ", indent_str[indent], execname(), name, argstr) +# printf("%s%s: %s (%s) = ", indent_str[indent], execname(), probefunc(), argstr) + indent++ + entry_p = 1 + } +} + +probe nd_syscall.*.return ? { + if (pid() == target()) { + if (indent) indent-- + if (entry_p) + printf("%s\n", retstr) + else + printf("%s%s\n", indent_str[indent],retstr) + entry_p = 0 + } +} + +probe end { + printf("\n") +} |