tracing: Do not use PERF enums when perf is not defined
Steven Rostedt
maintainerPATCH 1/1 tracing: Do not use PERF enums when perf is not defined
From: Steven Rostedt <[email protected]>
An update was made to up the module ref count when a synthetic event is registered for both trace and perf events. But if perf is not configured in, the perf enums used will cause the kernel to fail to build.
Fixes a1e3ad43115e ("tracing: Ensure module defining synth event cannot be unloaded while tracing")
Reported-by kernel test robot <[email protected]>
Signed-off-by Steven Rostedt (Google) <[email protected]>
--- kernel/trace/trace_events_synth.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
kernel/trace/trace_events_synth.c +6 -2
@@ -859,8 +859,10 @@ static int synth_event_reg(struct trace_event_call *call, struct synth_event *event = container_of(call, struct synth_event, call);switch (type) { -case TRACE_REG_REGISTER : +#ifdef CONFIG_PERF_EVENTS case TRACE_REG_PERF_REGISTER : +#endif +case TRACE_REG_REGISTER :if (!try_module_get (event->mod))return -EBUSY ;break ;
@@ -871,8 +873,10 @@ static int synth_event_reg(struct trace_event_call *call,int ret =trace_event_reg (call, type, data);switch (type) { -case TRACE_REG_UNREGISTER : +#ifdef CONFIG_PERF_EVENTS case TRACE_REG_PERF_UNREGISTER : +#endif +case TRACE_REG_UNREGISTER :module_put (event->mod);break ;default :
Signature · 1 line
2.47.2