Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.bpf/bpf_tests/kprobes.stp

raw
1 global res1, res2
2 probe begin {
3 printf("BEGIN\n")
4 }
5
6 probe kernel.function("vfs_read") {
7 res1 = 1
8 }
9
10 probe kernel.function("vfs_read").return {
11 res2 = 1
12 exit()
13 }
14
15 probe end {
16 if (res1 == 1 && res2 == 1)
17 printf("END PASS\n")
18 else
19 printf("END FAIL\n")
20 }