2 # description: Kprobe dynamic event with function tracer
4 [ -f kprobe_events
] || exit_unsupported
# this is configurable
5 grep function available_tracers || exit_unsupported
# this is configurable
8 echo nop
> current_tracer
9 echo _do_fork
> set_ftrace_filter
10 echo 0 > events
/enable
12 echo 'p:testprobe _do_fork' > kprobe_events
14 # kprobe on / ftrace off
15 echo 1 > events
/kprobes
/testprobe
/enable
19 ! grep '_do_fork <-' trace
21 # kprobe on / ftrace on
22 echo function > current_tracer
26 grep '_do_fork <-' trace
28 # kprobe off / ftrace on
29 echo 0 > events
/kprobes
/testprobe
/enable
32 ! grep testprobe trace
33 grep '_do_fork <-' trace
35 # kprobe on / ftrace on
36 echo 1 > events
/kprobes
/testprobe
/enable
37 echo function > current_tracer
41 grep '_do_fork <-' trace
43 # kprobe on / ftrace off
44 echo nop
> current_tracer
48 ! grep '_do_fork <-' trace
51 echo nop
> current_tracer
52 echo > set_ftrace_filter
53 echo 0 > events
/kprobes
/testprobe
/enable