doc/SystemTap_Beginners_Guide/testsuite/systemtap.bpf/bpf_tests/uprobes.stp
raw| 1 | // note: requires coreutils-debuginfo |
| 2 | |
| 3 | global f1, f2 |
| 4 | probe begin { |
| 5 | printf("BEGIN\n") |
| 6 | } |
| 7 | |
| 8 | // called by testsuite |
| 9 | probe process("/usr/bin/sleep").function("_fini") { |
| 10 | f1 = 1 |
| 11 | } |
| 12 | |
| 13 | probe process("/usr/bin/sleep").function("_fini").return { |
| 14 | f2 = 1 |
| 15 | exit() |
| 16 | } |
| 17 | |
| 18 | probe end { |
| 19 | if (f1 && f2) |
| 20 | printf("END PASS\n") |
| 21 | else |
| 22 | printf("END FAIL\n") |
| 23 | } |