diff options
Diffstat (limited to 'testsuite/systemtap.syscall/sys.stp')
-rwxr-xr-x | testsuite/systemtap.syscall/sys.stp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/testsuite/systemtap.syscall/sys.stp b/testsuite/systemtap.syscall/sys.stp new file mode 100755 index 00000000..ab822ebb --- /dev/null +++ b/testsuite/systemtap.syscall/sys.stp @@ -0,0 +1,37 @@ +global indent, indent_str, entry + +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 syscall.* { + if (pid() == target()) { + if (entry) 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 = 1 + } +} + +probe syscall.*.return { + if (pid() == target()) { + if (indent) indent-- + if (entry) + printf("%s\n", retstr) + else + printf("%s%s\n", indent_str[indent],retstr) + entry = 0 + } +} + +probe end { + printf("\n") +} |