Debian Codegraph @

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

raw
1 global t1, t2, t3
2
3 probe begin {
4 printf("BEGIN\n")
5 t1 = ktime_get_ns() // bpfinterp.cxx
6 }
7
8 probe timer.s(1) {
9 t2 = ktime_get_ns() // kernel bpf - XXX watch if timer.s() moves to userspace
10 }
11
12 probe perf.type(1).config(0).hz(1) {
13 t3 = ktime_get_ns() // kernel bpf
14 }
15
16
17 /*
18 probe kernel.function("SOMETHING") { # to trigger kernel side bpf func
19 t3 = ktime.get.ns()
20 }
21 */
22
23
24 probe timer.s(5) {
25 exit()
26 }
27
28 probe end {
29 if (t1 > 0 && t2 > 0 && t3 > 0)
30 printf("END PASS\n")
31 else
32 printf("END FAIL\n")
33 }