Skip to content

Commit

Permalink
selftests/ftrace: Add a test case for repeating register/unregister f…
Browse files Browse the repository at this point in the history
…probe

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>
  • Loading branch information
Masami Hiramatsu (Google) authored and Steven Rostedt (Google) committed Dec 26, 2024
1 parent 91fce23 commit 0c2dd44
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0c2dd44

Please sign in to comment.