summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.syscall/nd_sys.stp
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2010-02-15 13:59:24 -0500
committerDave Brolley <brolley@redhat.com>2010-02-15 13:59:24 -0500
commited8abf2763d68a4404477e6b09fee0fe4d591970 (patch)
treea62ef645c92a11d334115eb9bb72e0271fc75bc5 /testsuite/systemtap.syscall/nd_sys.stp
parent27dc09b13650456b7b3efd45c07690083e526b6d (diff)
parentc8408b459b88a5aa5f4325e690aef95b5da7c2eb (diff)
downloadsystemtap-steved-ed8abf2763d68a4404477e6b09fee0fe4d591970.tar.gz
systemtap-steved-ed8abf2763d68a4404477e6b09fee0fe4d591970.tar.xz
systemtap-steved-ed8abf2763d68a4404477e6b09fee0fe4d591970.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
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")
+}