Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/ftrace: Add a test case for repeating register/unregister fprobe

This test case repeats define and undefine the fprobe dynamic event to
ensure that the fprobe does not cause any issue with such operations.

Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Florent Revest <revest@chromium.org>
Cc: Martin KaFai Lau <martin.lau@linux.dev>
Cc: bpf <bpf@vger.kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Alan Maguire <alan.maguire@oracle.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/173519009398.391279.4625924605120064761.stgit@devnote2
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

authored by

Masami Hiramatsu (Google) and committed by
Steven Rostedt (Google)
0c2dd44d 91fce23a

+19
+19
tools/testing/selftests/ftrace/test.d/dynevent/add_remove_fprobe_repeat.tc
··· 1 + #!/bin/sh 2 + # SPDX-License-Identifier: GPL-2.0 3 + # description: Generic dynamic event - Repeating add/remove fprobe events 4 + # requires: dynamic_events "f[:[<group>/][<event>]] <func-name>[%return] [<args>]":README 5 + 6 + echo 0 > events/enable 7 + echo > dynamic_events 8 + 9 + PLACE=$FUNCTION_FORK 10 + REPEAT_TIMES=64 11 + 12 + for i in `seq 1 $REPEAT_TIMES`; do 13 + echo "f:myevent $PLACE" >> dynamic_events 14 + grep -q myevent dynamic_events 15 + test -d events/fprobes/myevent 16 + echo > dynamic_events 17 + done 18 + 19 + clear_trace