doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/proc_by_pid.c
raw| 1 | #include "stdio.h" |
| 2 | #include "sys/sdt.h" |
| 3 | #include <unistd.h> |
| 4 | |
| 5 | void first_function() {} |
| 6 | void second_function() {first_function();} |
| 7 | void exit_probe_function() {} |
| 8 | |
| 9 | int main() |
| 10 | { |
| 11 | sleep(30); |
| 12 | STAP_PROBE(proc_by_pid, main_start); |
| 13 | marker_here: |
| 14 | first_function(); |
| 15 | STAP_PROBE(proc_by_pid, main_end); |
| 16 | second_function(); |
| 17 | exit_probe_function(); |
| 18 | return 0; |
| 19 | } |