2 # SPDX-License-Identifier: GPL-2.0
3 # description: Kprobe dynamic event with function tracer
5 [ -f kprobe_events
] || exit_unsupported
# this is configurable
6 grep "function" available_tracers || exit_unsupported
# this is configurable
9 echo nop
> current_tracer
10 echo _do_fork
> set_ftrace_filter
11 echo 'p:testprobe _do_fork' > kprobe_events
13 # kprobe on / ftrace off
14 echo 1 > events
/kprobes
/testprobe
/enable
18 ! grep '_do_fork <-' trace
20 # kprobe on / ftrace on
21 echo function > current_tracer
25 grep '_do_fork <-' trace
27 # kprobe off / ftrace on
28 echo 0 > events
/kprobes
/testprobe
/enable
31 ! grep testprobe trace
32 grep '_do_fork <-' trace
34 # kprobe on / ftrace on
35 echo 1 > events
/kprobes
/testprobe
/enable
36 echo function > current_tracer
40 grep '_do_fork <-' trace
42 # kprobe on / ftrace off
43 echo nop
> current_tracer
47 ! grep '_do_fork <-' trace