| 1 |
function print_all_trace_info(point) { |
| 2 |
printf("backtrace from %s:\n", pp()) |
| 3 |
print_backtrace() |
| 4 |
printf("--- %s ---\n", point) |
| 5 |
bt = backtrace() |
| 6 |
printf("the stack is %s\n", bt) |
| 7 |
print_syms(bt); |
| 8 |
print("--------\n") |
| 9 |
} |
| 10 |
|
| 11 |
probe begin { |
| 12 |
// Too difficult/different on different arches/kernels to check. |
| 13 |
// print_backtrace() |
| 14 |
log("<no kernel backtrace at begin>"); |
| 15 |
} |
| 16 |
|
| 17 |
probe end { |
| 18 |
print_backtrace() |
| 19 |
} |
| 20 |
|
| 21 |
global flag = 0 |
| 22 |
|
| 23 |
probe module("systemtap_test_module2").function("yyy_func2") { |
| 24 |
print_all_trace_info("yyy_func2") |
| 25 |
flag ++ |
| 26 |
} |
| 27 |
|
| 28 |
probe module("systemtap_test_module2").function("yyy_func3") { |
| 29 |
print_all_trace_info("yyy_func3") |
| 30 |
flag ++ |
| 31 |
} |
| 32 |
|
| 33 |
probe module("systemtap_test_module2").function("yyy_func4") { |
| 34 |
print_all_trace_info("yyy_func4") |
| 35 |
flag ++ |
| 36 |
exit(); |
| 37 |
} |
| 38 |
|
| 39 |
|