Skip to content

Commit 8205ff1

Browse files
committed
Merge tag 'trace-fixes-v4.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing fix from Steven Rostedt: "I previously sent a fix that prevents all trace events from being called if the current cpu is offline. But I forgot that in 3.18, we added lockdep checks to test RCU usage even when the event is disabled. Although there cannot be any bug when a cpu is going offline, we now get false warnings triggered by the added checks of the event being disabled. I removed the check from the tracepoint code itself, and added it to the condition section (which is "1" for 'no condition'). This way the online cpu check will get checked in all the right locations" * tag 'trace-fixes-v4.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix check for cpu online when event is disabled
2 parents 380173f + dc17147 commit 8205ff1

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

include/linux/tracepoint.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@ extern void syscall_unregfunc(void);
134134
void *it_func; \
135135
void *__data; \
136136
\
137-
if (!cpu_online(raw_smp_processor_id())) \
138-
return; \
139-
\
140137
if (!(cond)) \
141138
return; \
142139
prercu; \
@@ -343,15 +340,19 @@ extern void syscall_unregfunc(void);
343340
* "void *__data, proto" as the callback prototype.
344341
*/
345342
#define DECLARE_TRACE_NOARGS(name) \
346-
__DECLARE_TRACE(name, void, , 1, void *__data, __data)
343+
__DECLARE_TRACE(name, void, , \
344+
cpu_online(raw_smp_processor_id()), \
345+
void *__data, __data)
347346

348347
#define DECLARE_TRACE(name, proto, args) \
349-
__DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), 1, \
350-
PARAMS(void *__data, proto), \
351-
PARAMS(__data, args))
348+
__DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \
349+
cpu_online(raw_smp_processor_id()), \
350+
PARAMS(void *__data, proto), \
351+
PARAMS(__data, args))
352352

353353
#define DECLARE_TRACE_CONDITION(name, proto, args, cond) \
354-
__DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), PARAMS(cond), \
354+
__DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \
355+
cpu_online(raw_smp_processor_id()) && (PARAMS(cond)), \
355356
PARAMS(void *__data, proto), \
356357
PARAMS(__data, args))
357358

0 commit comments

Comments
 (0)