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 <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Andrew Morton <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 092a385 commit cf64792

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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)