Skip to content

Commit e07a1d5

Browse files
committed
tracing: Use __this_cpu_read() in trace_event_buffer_lock_reserver()
The value read by this_cpu_read() is used later and its use is expected to stay on the same CPU as being read. But this_cpu_read() does not warn if it is called without preemption disabled, where as __this_cpu_read() will check if preemption is disabled on CONFIG_DEBUG_PREEMPT Currently all callers have preemption disabled, but there may be new callers in the future that may not. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 7c689c8 commit e07a1d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2746,7 +2746,7 @@ trace_event_buffer_lock_reserve(struct trace_buffer **current_rb,
27462746

27472747
if (!tr->no_filter_buffering_ref &&
27482748
(trace_file->flags & (EVENT_FILE_FL_SOFT_DISABLED | EVENT_FILE_FL_FILTERED)) &&
2749-
(entry = this_cpu_read(trace_buffered_event))) {
2749+
(entry = __this_cpu_read(trace_buffered_event))) {
27502750
/*
27512751
* Filtering is on, so try to use the per cpu buffer first.
27522752
* This buffer will simulate a ring_buffer_event,

0 commit comments

Comments
 (0)