Debian Codegraph @

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

raw
1 global output_string
2
3 # Original (parent) probes
4 probe process(@1).mark("main")
5 {
6 output_string .= sprintf("main - pid: %d\n", $arg1)
7 }
8 probe process(@1).mark("child1_pid")
9 {
10 output_string .= sprintf("main - child pid: %d\n", $arg1)
11 }
12 probe process(@1).mark("main2")
13 {
14 output_string .= sprintf("main - finished\n")
15 exit()
16 }
17
18 # Child1 probes
19 probe process(@1).mark("child1")
20 {
21 output_string .= sprintf("child1 - pid: %d\n", $arg1)
22 }
23 probe process(@1).mark("child2_pid")
24 {
25 output_string .= sprintf("child1 - child2 pid: %d\n", $arg1)
26 }
27
28 # Child2 probes
29 probe process(@1).mark("child2")
30 {
31 output_string .= sprintf("child2 - pid: %d\n", $arg1)
32 }
33
34 # Testsuite glue
35 probe begin
36 {
37 printf("systemtap starting probe\n");
38 }
39
40 probe end
41 {
42 printf("systemtap ending probe\n");
43 printf("%s", output_string);
44 }