summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddomingo <ddomingo@redhat.com>2008-10-27 13:11:27 +1000
committerddomingo <ddomingo@redhat.com>2008-10-27 13:11:27 +1000
commit313cfc85e435b93bfa9110cda3e3f930de066643 (patch)
tree57e9fbb3dd445b93b282d561af6d86437644032a
parentd60f18067e710a120d3ff063c76500941a0b5ecb (diff)
downloadsystemtap-steved-313cfc85e435b93bfa9110cda3e3f930de066643.tar.gz
systemtap-steved-313cfc85e435b93bfa9110cda3e3f930de066643.tar.xz
systemtap-steved-313cfc85e435b93bfa9110cda3e3f930de066643.zip
added simplified, working para-callgraph
-rw-r--r--testsuite/systemtap.examples/general/para-callgraph-simple.meta7
-rwxr-xr-xtestsuite/systemtap.examples/general/para-callgraph-simple.stp40
2 files changed, 47 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/general/para-callgraph-simple.meta b/testsuite/systemtap.examples/general/para-callgraph-simple.meta
new file mode 100644
index 00000000..4a0bb251
--- /dev/null
+++ b/testsuite/systemtap.examples/general/para-callgraph-simple.meta
@@ -0,0 +1,7 @@
+title: Callgraph tracing with arguments
+name: para-callgraph.stp
+keywords: trace callgraph
+subsystem: general
+description: Print a timed per-thread callgraph, complete with function parameters and return values. The first parameter names the function probe points to trace. The optional second parameter names the probe points for trigger functions, which acts to enable tracing for only those functions that occur while the current thread is nested within the trigger.
+test_check: stap -p4 para-callgraph.stp sys_read '*@fs/*.c'
+test_installcheck: TBD
diff --git a/testsuite/systemtap.examples/general/para-callgraph-simple.stp b/testsuite/systemtap.examples/general/para-callgraph-simple.stp
new file mode 100755
index 00000000..17cf50a5
--- /dev/null
+++ b/testsuite/systemtap.examples/general/para-callgraph-simple.stp
@@ -0,0 +1,40 @@
+function trace(entry_p) {
+ if(tid() in trace)
+ printf("%s%s%s\n",thread_indent(entry_p),
+ (entry_p>0?"->":"<-"),
+ probefunc())
+}
+
+global trace
+probe kernel.function(@1).call {
+ if (execname() == "stapio") next # skip our own helper process
+ trace[tid()] = 1
+ trace(1)
+}
+probe kernel.function(@1).return {
+ trace(-1)
+ delete trace[tid()]
+}
+
+probe kernel.function(@2).call { trace(1) }
+probe kernel.function(@2).return { trace(-1) }
+function trace(entry_p) {
+ if(tid() in trace)
+ printf("%s%s%s\n",thread_indent(entry_p),
+ (entry_p>0?"->":"<-"),
+ probefunc())
+}
+
+global trace
+probe kernel.function(@1).call {
+ if (execname() == "stapio") next # skip our own helper process
+ trace[tid()] = 1
+ trace(1)
+}
+probe kernel.function(@1).return {
+ trace(-1)
+ delete trace[tid()]
+}
+
+probe kernel.function(@2).call { trace(1) }
+probe kernel.function(@2).return { trace(-1) }