| 1 |
/* |
| 2 |
* kprobe_module.stp |
| 3 |
* |
| 4 |
* Simple function to test that systemtap can generate instrumentation |
| 5 |
* for a module function, install it, and get some output. |
| 6 |
*/ |
| 7 |
|
| 8 |
global count |
| 9 |
|
| 10 |
probe begin |
| 11 |
{ |
| 12 |
printf("systemtap starting probe\n") |
| 13 |
} |
| 14 |
|
| 15 |
%( $# == 1 %? |
| 16 |
probe kprobe.module("stap_kmodule").function("simple_timer_function").$1 |
| 17 |
%: |
| 18 |
probe kprobe.module("stap_kmodule").function("simple_timer_function") |
| 19 |
%) |
| 20 |
{ |
| 21 |
++count; |
| 22 |
} |
| 23 |
|
| 24 |
probe end |
| 25 |
{ |
| 26 |
printf("systemtap ending probe\n") |
| 27 |
printf("count = %d\n", count ? 1 : 0) |
| 28 |
} |