Skip to content

Commit cf64792

Browse files
committed
tracing: branch: Use trace_tracing_is_on_cpu() instead of "disabled" field
The branch tracer currently checks the per CPU "disabled" field to know if tracing is enabled or not for the CPU. As the "disabled" value is not used anymore to turn of tracing generically, use tracing_tracer_is_on_cpu() instead. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Andrew Morton <akpm@linux-foundation.org> Link: https://lore.kernel.org/20250505212236.224658526@goodmis.org Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 092a385 commit cf64792

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

kernel/trace/trace_branch.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ probe_likely_condition(struct ftrace_likely_data *f, int val, int expect)
3232
{
3333
struct trace_array *tr = branch_tracer;
3434
struct trace_buffer *buffer;
35-
struct trace_array_cpu *data;
3635
struct ring_buffer_event *event;
3736
struct trace_branch *entry;
3837
unsigned long flags;
@@ -54,8 +53,7 @@ probe_likely_condition(struct ftrace_likely_data *f, int val, int expect)
5453

5554
raw_local_irq_save(flags);
5655
current->trace_recursion |= TRACE_BRANCH_BIT;
57-
data = this_cpu_ptr(tr->array_buffer.data);
58-
if (atomic_read(&data->disabled))
56+
if (!tracer_tracing_is_on_cpu(tr, raw_smp_processor_id()))
5957
goto out;
6058

6159
trace_ctx = tracing_gen_ctx_flags(flags);

0 commit comments

Comments
 (0)