| 1 |
global main_probes |
| 2 |
global test_function_probes |
| 3 |
#global end_probes |
| 4 |
|
| 5 |
probe timer.s(5) |
| 6 |
{ |
| 7 |
exit() |
| 8 |
} |
| 9 |
|
| 10 |
# Actual probes |
| 11 |
#probe process("probe_by_pid").function("main") |
| 12 |
probe process(@1).function("main").call |
| 13 |
{ |
| 14 |
main_probes[pid()]++ |
| 15 |
} |
| 16 |
|
| 17 |
probe process(@1).function("test_function") |
| 18 |
{ |
| 19 |
test_function_probes[pid()]++ |
| 20 |
} |
| 21 |
|
| 22 |
# Testsuite glue |
| 23 |
probe begin |
| 24 |
{ |
| 25 |
printf("systemtap starting probe\n"); |
| 26 |
} |
| 27 |
|
| 28 |
probe end |
| 29 |
{ |
| 30 |
printf("systemtap ending probe\n"); |
| 31 |
# We really shouldn't see any main_probes, since the system |
| 32 |
# has already called main before we start probing. |
| 33 |
foreach (pid in main_probes) { |
| 34 |
printf("%d: %d main probes\n", pid, main_probes[pid]) |
| 35 |
} |
| 36 |
foreach (pid in test_function_probes) { |
| 37 |
printf("%d: %d test_function probes\n", pid, test_function_probes[pid]) |
| 38 |
} |
| 39 |
} |