summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/general/para-callgraph.stp
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2008-08-20 14:41:38 -0400
committerDave Brolley <brolley@redhat.com>2008-08-20 14:41:38 -0400
commitdce882537b3a31d0b4fa2ebac0d4984ed6acd302 (patch)
tree7a740f602f05341e3022fd021435446152444336 /testsuite/systemtap.examples/general/para-callgraph.stp
parent1598733bd611536ea7a708c161bc4bbfbf25569c (diff)
parentef4042bd5adb8062c31789a9786bf558f5f11e9e (diff)
downloadsystemtap-steved-dce882537b3a31d0b4fa2ebac0d4984ed6acd302.tar.gz
systemtap-steved-dce882537b3a31d0b4fa2ebac0d4984ed6acd302.tar.xz
systemtap-steved-dce882537b3a31d0b4fa2ebac0d4984ed6acd302.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'testsuite/systemtap.examples/general/para-callgraph.stp')
-rwxr-xr-xtestsuite/systemtap.examples/general/para-callgraph.stp26
1 files changed, 14 insertions, 12 deletions
diff --git a/testsuite/systemtap.examples/general/para-callgraph.stp b/testsuite/systemtap.examples/general/para-callgraph.stp
index e28f5d6b..9abb00c2 100755
--- a/testsuite/systemtap.examples/general/para-callgraph.stp
+++ b/testsuite/systemtap.examples/general/para-callgraph.stp
@@ -1,22 +1,24 @@
#! /usr/bin/env stap
-function trace(entry_p) {
- if(tid() in trace)
- printf("%s%s%s\n",thread_indent(entry_p),
- (entry_p>0?"->":"<-"),
- probefunc())
+function trace(entry_p, extra) {
+ %( $# > 1 %? if (tid() in trace) %)
+ printf("%s%s%s %s\n",
+ thread_indent (entry_p),
+ (entry_p>0?"->":"<-"),
+ probefunc (),
+ extra)
}
+
+%( $# > 1 %?
global trace
-probe kernel.function(@1).call {
- if (execname() == "stapio") next # skip our own helper process
+probe $2.call {
trace[tid()] = 1
- trace(1)
}
-probe kernel.function(@1).return {
- trace(-1)
+probe $2.return {
delete trace[tid()]
}
+%)
-probe kernel.function(@2).call { trace(1) }
-probe kernel.function(@2).return { trace(-1) }
+probe $1.call { trace(1, $$parms) }
+probe $1.return { trace(-1, $$return) }