1 #!/bin/sh 2 # SPDX-License-Identifier: GPL-2.0 3 # description: Kprobe dynamic event with function tracer 4 # requires: kprobe_events stack_trace_filter function:tracer 5 6 # prepare 7 echo nop > current_tracer 8 echo $FUNCTION_FORK > set_ftrace_filter 9 echo "p:testprobe $FUNCTION_FORK" > kprobe_events 10 11 # kprobe on / ftrace off 12 echo 1 > events/kprobes/testprobe/enable 13 echo > trace 14 ( echo "forked") 15 grep testprobe trace 16 ! grep "$FUNCTION_FORK <-" trace 17 18 # kprobe on / ftrace on 19 echo function > current_tracer 20 echo > trace 21 ( echo "forked") 22 grep testprobe trace 23 grep "$FUNCTION_FORK <-" trace 24 25 # kprobe off / ftrace on 26 echo 0 > events/kprobes/testprobe/enable 27 echo > trace 28 ( echo "forked") 29 ! grep testprobe trace 30 grep "$FUNCTION_FORK <-" trace 31 32 # kprobe on / ftrace on 33 echo 1 > events/kprobes/testprobe/enable 34 echo function > current_tracer 35 echo > trace 36 ( echo "forked") 37 grep testprobe trace 38 grep "$FUNCTION_FORK <-" trace 39 40 # kprobe on / ftrace off 41 echo nop > current_tracer 42 echo > trace 43 ( echo "forked") 44 grep testprobe trace 45 ! grep "$FUNCTION_FORK <-" trace
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.