selftests: tracing: Update fprobe selftest for ftrace based fprobe
Masami Hiramatsu (Google)
maintainerPATCH 1/1 selftests: tracing: Update fprobe selftest for ftrace based fprobe
From: Masami Hiramatsu (Google) <[email protected]>
Since the ftrace fprobe is both fgraph and ftrace based implemented, the selftest needs to be updated. This does not count the actual number of lines, but just check the differences.
--- .../ftrace/test.d/dynevent/add_remove_fprobe.tc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-)
tools/testing/selftests/ftrace/test.d/dynevent/add_remove_fprobe.tc +4 -14
@@ -28,25 +28,21 @@ test -d events/fprobes/myevent1 test -d events/fprobes/myevent2 echo 1 > events/fprobes/myevent1/enable -# Make sure the event is attached and is the only one +# Make sure the event is attached. grep -q $PLACE enabled_functions cnt=`cat enabled_functions | wc -l` -if [ $cnt -ne $((ocnt + 1)) ]; then +if [ $cnt -eq $ocnt ]; then exit_fail fi echo 1 > events/fprobes/myevent2/enable -# It should till be the only attached function -cnt=`cat enabled_functions | wc -l` -if [ $cnt -ne $((ocnt + 1)) ]; then - exit_fail -fi +cnt2=`cat enabled_functions | wc -l` echo 1 > events/fprobes/myevent3/enable # If the function is different, the attached function should be increased grep -q $PLACE2 enabled_functions cnt=`cat enabled_functions | wc -l` -if [ $cnt -ne $((ocnt + 2)) ]; then +if [ $cnt -eq $cnt2 ]; then exit_fail fi
@@ -56,12 +52,6 @@ echo "-:myevent2" >> dynamic_events grep -q myevent1 dynamic_events ! grep -q myevent2 dynamic_events -# should still have 2 left -cnt=`cat enabled_functions | wc -l` -if [ $cnt -ne $((ocnt + 2)) ]; then - exit_fail -fi - echo 0 > events/fprobes/enable echo > dynamic_events
Shuah Khan
maintainerQuoted 11 lines · Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) <[email protected]>
Since the ftrace fprobe is both fgraph and ftrace based implemented, the selftest needs to be updated. This does not count the actual number of lines, but just check the differences.
Signed-off-by Masami Hiramatsu (Google) <[email protected]>--- .../ftrace/test.d/dynevent/add_remove_fprobe.tc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-)
Steve, do you want me to take this through my tree?
thanks,
-- Shuah
Steven Rostedt
maintainerQuoted 7 lines · On Wed, 19 Nov 2025 15:16:04 -0700 Shuah Khan <[email protected]> wrote:
Quoted 6 lines · Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) <[email protected]>
Since the ftrace fprobe is both fgraph and ftrace based implemented, the selftest needs to be updated. This does not count the actual number of lines, but just check the differences.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Masami Hiramatsu (Google) <[email protected]>--- .../ftrace/test.d/dynevent/add_remove_fprobe.tc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-)Steve, do you want me to take this through my tree?
Yes please, unless Masami thinks otherwise.
-- Steve
Shuah Khan
maintainerQuoted 16 lines · Steven Rostedt
Quoted 13 lines · On Wed, 19 Nov 2025 15:16:04 -0700 Shuah Khan <[email protected]> wrote:
Quoted 11 lines · Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) <[email protected]>
Since the ftrace fprobe is both fgraph and ftrace based implemented, the selftest needs to be updated. This does not count the actual number of lines, but just check the differences.
Signed-off-by Masami Hiramatsu (Google) <[email protected]>--- .../ftrace/test.d/dynevent/add_remove_fprobe.tc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-)
Quoted 4 lines
Quoted 1 line
Steve, do you want me to take this through my tree?
Yes please, unless Masami thinks otherwise.
Applied to linux-kselftest next for Linux 6.19-rc1.
thanks,
-- Shuah