Debian Codegraph @

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

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