]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/ftrace: Fix reading enabled_functions in add_remove_fprobe_module test
authorSteven Rostedt <rostedt@goodmis.org>
Wed, 8 Jul 2026 19:32:39 +0000 (15:32 -0400)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 10 Jul 2026 16:14:42 +0000 (10:14 -0600)
commit22a78be4123dce81d72c963a98b774b7d5e1f8e5
tree3acb75cde8c506c80363ffee892db2d371a6dd2a
parentdc59e4fea9d83f03bad6bddf3fa2e52491777482
selftests/ftrace: Fix reading enabled_functions in add_remove_fprobe_module test

The add_remove_fprobe_module test checks the number of functions added to
the enabled_functions file to make sure that the functions added or
removed is as expected. The issue is that it expects this file to be empty
on start up.

Now that systemd uses BPF that attaches to functions via ftrace, this file
is not empty in several systems:

 # cat /sys/kernel/tracing/enabled_functions
 bpf_lsm_file_open (1) R   D   M  tramp: ftrace_regs_caller+0x0/0x61 (call_direct_funcs+0x0/0x50)
direct(jmp)-->bpf_trampoline_6442529439+0x0/0xe9

Change the test to read the number of lines in enabled_functions at the
start of the test and subtract that from the value of the count for the
checks within the test.

Link: https://lore.kernel.org/r/20260708153239.055d56dd@gandalf.local.home
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/ftrace/test.d/dynevent/add_remove_fprobe_module.tc