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 <[email protected]>
Cc: Florent Revest <[email protected]>
Cc: Martin KaFai Lau <[email protected]>
Cc: bpf <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Alan Maguire <[email protected]>
Cc: Mark Rutland <[email protected]>
Link: https://lore.kernel.org/173519009398.391279.4625924605120064761.stgit@devnote2
Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>
This commit is contained in:
Masami Hiramatsu (Google)
2024-12-26 10:50:06 -05:00
committed by Steven Rostedt (Google)
parent 91fce23a08
commit 0c2dd44d3f
@@ -0,0 +1,19 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Generic dynamic event - Repeating add/remove fprobe events
# requires: dynamic_events "f[:[<group>/][<event>]] <func-name>[%return] [<args>]":README
echo 0 > events/enable
echo > dynamic_events
PLACE=$FUNCTION_FORK
REPEAT_TIMES=64
for i in `seq 1 $REPEAT_TIMES`; do
echo "f:myevent $PLACE" >> dynamic_events
grep -q myevent dynamic_events
test -d events/fprobes/myevent
echo > dynamic_events
done
clear_trace