2 # SPDX-License-Identifier: GPL-2.0
3 # description: Kprobe dynamic event with function tracer
4 # requires: kprobe_events stack_trace_filter function:tracer
7 echo nop
> current_tracer
8 echo $FUNCTION_FORK > set_ftrace_filter
9 echo "p:testprobe $FUNCTION_FORK" > kprobe_events
11 # kprobe on / ftrace off
12 echo 1 > events
/kprobes
/testprobe
/enable
16 ! grep "$FUNCTION_FORK <-" trace
18 # kprobe on / ftrace on
19 echo function > current_tracer
23 grep "$FUNCTION_FORK <-" trace
25 # kprobe off / ftrace on
26 echo 0 > events
/kprobes
/testprobe
/enable
29 ! grep testprobe trace
30 grep "$FUNCTION_FORK <-" trace
32 # kprobe on / ftrace on
33 echo 1 > events
/kprobes
/testprobe
/enable
34 echo function > current_tracer
38 grep "$FUNCTION_FORK <-" trace
40 # kprobe on / ftrace off
41 echo nop
> current_tracer
45 ! grep "$FUNCTION_FORK <-" trace