From: Steven Rostedt <rostedt@xxxxxxxxxxx> commit c8c9b1d2d5b4377c72a979f5a26e842a869aefc9 upstream. The code was restructured where the function graph notrace code, that would not trace a function and all its children is done by setting a NOTRACE flag when the function that is not to be traced is hit. There's a TRACE_GRAPH_NOTRACE_BIT which defines the bit in the flags and a TRACE_GRAPH_NOTRACE which is the mask with that bit set. But the restructuring used TRACE_GRAPH_NOTRACE_BIT when it should have used TRACE_GRAPH_NOTRACE. For example: # cd /sys/kernel/tracing # echo set_track_prepare stack_trace_save > set_graph_notrace # echo function_graph > current_tracer # cat trace [..] 0) | __slab_free() { 0) | free_to_partial_list() { 0) | arch_stack_walk() { 0) | __unwind_start() { 0) 0.501 us | get_stack_info(); Where a non filter trace looks like: # echo > set_graph_notrace # cat trace 0) | free_to_partial_list() { 0) | set_track_prepare() { 0) | stack_trace_save() { 0) | arch_stack_walk() { 0) | __unwind_start() { Where the filter should look like: # cat trace 0) | free_to_partial_list() { 0) | _raw_spin_lock_irqsave() { 0) 0.350 us | preempt_count_add(); 0) 0.351 us | do_raw_spin_lock(); 0) 2.440 us | } Cc: stable@xxxxxxxxxxxxxxx Cc: Masami Hiramatsu <mhiramat@xxxxxxxxxx> Cc: Mark Rutland <mark.rutland@xxxxxxx> Cc: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx> Link: https://lore.kernel.org/20250208001511.535be150@xxxxxxxxxxxxxxxxx Fixes: b84214890a9bc ("function_graph: Move graph notrace bit to shadow stack global var") Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- kernel/trace/trace_functions_graph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c @@ -198,7 +198,7 @@ int trace_graph_entry(struct ftrace_grap * returning from the function. */ if (ftrace_graph_notrace_addr(trace->func)) { - *task_var |= TRACE_GRAPH_NOTRACE_BIT; + *task_var |= TRACE_GRAPH_NOTRACE; /* * Need to return 1 to have the return called * that will clear the NOTRACE bit. Patches currently in stable-queue which might be from rostedt@xxxxxxxxxxx are queue-6.13/ring-buffer-do-not-allow-events-in-nmi-with-generic-atomic64-cmpxchg.patch queue-6.13/tracing-osnoise-fix-resetting-of-tracepoints.patch queue-6.13/atomic64-use-arch_spin_locks-instead-of-raw_spin_locks.patch queue-6.13/fgraph-fix-set_graph_notrace-with-setting-trace_graph_notrace_bit.patch queue-6.13/rtla-timerlat_top-set-osnoise_workload-for-kernel-threads.patch queue-6.13/rtla-osnoise-distinguish-missing-workload-option.patch queue-6.13/rtla-timerlat_hist-set-osnoise_workload-for-kernel-threads.patch queue-6.13/ring-buffer-make-reading-page-consistent-with-the-co.patch queue-6.13/rv-reset-per-task-monitors-also-for-idle-tasks.patch queue-6.13/rtla-timerlat_top-stop-timerlat-tracer-on-signal.patch queue-6.13/rtla-timerlat_hist-stop-timerlat-tracer-on-signal.patch queue-6.13/rtla-add-trace_instance_stop.patch