Skip to content

Commit 0c2dd44

Browse files
mhiramatrostedt
authored andcommitted
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>
1 parent 91fce23 commit 0c2dd44

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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

0 commit comments

Comments
 (0)