linux/kernel/trace
Steven Rostedt c8c9b1d2d5 fgraph: Fix set_graph_notrace with setting TRACE_GRAPH_NOTRACE_BIT
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@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/20250208001511.535be150@batman.local.home
Fixes: b84214890a ("function_graph: Move graph notrace bit to shadow stack global var")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2025-02-08 08:36:45 -05:00
..
rv
Kconfig
Makefile
blktrace.c
bpf_trace.c bpf-next-6.14 2025-01-23 08:04:07 -08:00
bpf_trace.h
error_report-traces.c
fgraph.c fgraph: Remove calltime and rettime from generic operations 2025-01-21 21:55:49 -05:00
fprobe.c
ftrace.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
ftrace_internal.h
kprobe_event_gen_test.c
pid_list.c
pid_list.h
power-traces.c
preemptirq_delay_test.c
rethook.c
ring_buffer.c ring-buffer: Do not allow events in NMI with generic atomic64 cmpxchg() 2025-01-21 15:19:00 -05:00
ring_buffer_benchmark.c
rpm-traces.c
synth_event_gen_test.c
trace.c tracing updates for v6.14: 2025-01-23 17:51:16 -08:00
trace.h Remove calltime and rettime from fgraph infrastructure 2025-01-23 17:59:25 -08:00
trace_benchmark.c
trace_benchmark.h
trace_boot.c
trace_branch.c
trace_btf.c
trace_btf.h
trace_clock.c
trace_dynevent.c
trace_dynevent.h
trace_entries.h fgraph: Remove calltime and rettime from generic operations 2025-01-21 21:55:49 -05:00
trace_eprobe.c tracing/eprobe: Adopt guard() and scoped_guard() 2025-01-10 09:00:12 +09:00
trace_event_perf.c
trace_events.c tracing updates for v6.14: 2025-01-23 17:51:16 -08:00
trace_events_filter.c
trace_events_filter_test.h
trace_events_hist.c tracing/hist: Support POLLPRI event for poll on histogram 2025-01-07 11:46:32 -05:00
trace_events_inject.c
trace_events_synth.c
trace_events_trigger.c
trace_events_user.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
trace_export.c
trace_fprobe.c tracing: Adopt __free() and guard() for trace_fprobe.c 2025-01-16 21:27:07 -05:00
trace_functions.c
trace_functions_graph.c fgraph: Fix set_graph_notrace with setting TRACE_GRAPH_NOTRACE_BIT 2025-02-08 08:36:45 -05:00
trace_hwlat.c
trace_irqsoff.c fgraph: Remove calltime and rettime from generic operations 2025-01-21 21:55:49 -05:00
trace_kdb.c
trace_kprobe.c tracing/kprobes: Simplify __trace_kprobe_create() by removing gotos 2025-01-10 09:01:14 +09:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_osnoise.c Runtime verifier and osnoise fixes for 6.14: 2025-01-26 14:19:45 -08:00
trace_output.c
trace_output.h
trace_preemptirq.c
trace_printk.c
trace_probe.c tracing: Use __free() in trace_probe for cleanup 2025-01-10 09:00:13 +09:00
trace_probe.h
trace_probe_kernel.h
trace_probe_tmpl.h
trace_recursion_record.c
trace_sched_switch.c
trace_sched_wakeup.c fgraph: Remove calltime and rettime from generic operations 2025-01-21 21:55:49 -05:00
trace_selftest.c
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c
trace_stat.c
trace_stat.h
trace_synth.h
trace_syscalls.c
trace_uprobe.c tracing/uprobe: Adopt guard() and scoped_guard() 2025-01-10 09:00:12 +09:00
tracing_map.c
tracing_map.h