Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.clone/probe_by_pid_utrace.stp

raw
1 global begin_probes
2 global syscall_probes
3 global end_probes
4
5 probe timer.s(5)
6 {
7 exit()
8 }
9
10 # Actual probes
11 probe process($1).begin
12 {
13 begin_probes[pid()]++
14 }
15
16 probe process($1).syscall
17 {
18 syscall_probes[pid()]++
19 }
20
21 probe process($1).end
22 {
23 end_probes[pid()]++
24 }
25
26 # Testsuite glue
27 probe begin
28 {
29 printf("systemtap starting probe\n");
30 }
31
32 probe end
33 {
34 printf("systemtap ending probe\n");
35 foreach (pid in begin_probes) {
36 printf("%d: %d begin probes\n", pid, begin_probes[pid])
37 }
38 foreach (pid in syscall_probes) {
39 printf("%d: %d syscall probes\n", pid, syscall_probes[pid])
40 }
41 # We really shouldn't see any end_probes fired...
42 foreach (pid in end_probes) {
43 printf("%d: %d end probes\n", pid, end_probes[pid])
44 }
45 }