summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.syscall/nd_sys.stp
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.syscall/nd_sys.stp')
-rwxr-xr-xtestsuite/systemtap.syscall/nd_sys.stp37
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")
+}