Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/pr10854.stp

raw
1 function trace(entry_p) {
2 if(tid() in trace)
3 printf("%s%s%s\n",thread_indent(entry_p),
4 (entry_p>0?"->":"<-"),
5 probefunc())
6 }
7
8 global trace
9 probe kernel.function(@1).call {
10 if (pid() == stp_pid()) next # skip our own helper process
11 trace[tid()] = 1
12 trace(1)
13 }
14 probe kernel.function(@1).return {
15 if (pid() == stp_pid()) next # skip our own helper process
16 trace(-1)
17 delete trace[tid()]
18 }
19
20 probe kernel.function(@2).call { trace(1) }
21 probe kernel.function(@2).return { trace(-1) }