Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.clone/dtrace_vfork_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_pid")
9 {
10 output_string .= sprintf("parent - child pid: %d\n", $arg1)
11 }
12 probe process(@1).mark("finished")
13 {
14 output_string .= sprintf("parent - finished\n")
15 exit()
16 }
17
18 # Child probes
19 probe process(@2).mark("main")
20 {
21 output_string .= sprintf("child - pid: %d\n", $arg1)
22 }
23
24 # Testsuite glue
25 probe begin
26 {
27 printf("systemtap starting probe\n");
28 }
29
30 probe end
31 {
32 printf("systemtap ending probe\n");
33 printf("%s", output_string);
34 }