doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/kprobes.stp
raw| 1 | /* |
| 2 | * kprobes.stp |
| 3 | * Probe to test the functionality of kprobe-based probes |
| 4 | * (Dwarfless Probing) |
| 5 | */ |
| 6 | global hit_str |
| 7 | |
| 8 | probe begin |
| 9 | { |
| 10 | println("systemtap starting probe"); |
| 11 | hit_str = "" |
| 12 | } |
| 13 | |
| 14 | probe kprobe.function("vfs_read") |
| 15 | { |
| 16 | hit_str = "probe point hit" |
| 17 | exit(); |
| 18 | } |
| 19 | |
| 20 | probe end |
| 21 | { |
| 22 | println("systemtap ending probe"); |
| 23 | println(hit_str); |
| 24 | delete hit_str; |
| 25 | } |