Debian Codegraph @

testsuite/systemtap.examples/general/para-callgraph-verbose.stp

raw
1 #! /usr/bin/env stap
2
3 function trace(entry_p, extra) {
4 %( $# > 1 %? if (tid() in trace) %)
5 printf("%s%s%s %s\n",
6 thread_indent (entry_p),
7 (entry_p>0?"->":"<-"),
8 ppfunc (),
9 extra)
10 }
11
12
13 %( $# > 1 %?
14 global trace
15 probe $2.call {
16 trace[tid()] = 1
17 }
18 probe $2.return {
19 delete trace[tid()]
20 }
21 %)
22
23 probe $1.call { trace(1, $$parms$$) }
24 probe $1.return { trace(-1, $$return) }