Commit 126df08c authored by Denis Kirjanov's avatar Denis Kirjanov Committed by Michael Ellerman

powerpc/pseries: Don't trace hcalls on offline CPUs

If a cpu is hotplugged while the hcall trace points are active, it's
possible to hit a warning from RCU due to the trace points calling into
RCU from an offline cpu, eg:

  RCU used illegally from offline CPU!
  rcu_scheduler_active = 1, debug_locks = 1

Make the hypervisor tracepoints conditional by using
TRACE_EVENT_FN_COND.
Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarDenis Kirjanov <kda@linux-powerpc.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent f15838e9
...@@ -57,12 +57,14 @@ DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_exit, ...@@ -57,12 +57,14 @@ DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_exit,
extern void hcall_tracepoint_regfunc(void); extern void hcall_tracepoint_regfunc(void);
extern void hcall_tracepoint_unregfunc(void); extern void hcall_tracepoint_unregfunc(void);
TRACE_EVENT_FN(hcall_entry, TRACE_EVENT_FN_COND(hcall_entry,
TP_PROTO(unsigned long opcode, unsigned long *args), TP_PROTO(unsigned long opcode, unsigned long *args),
TP_ARGS(opcode, args), TP_ARGS(opcode, args),
TP_CONDITION(cpu_online(raw_smp_processor_id())),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(unsigned long, opcode) __field(unsigned long, opcode)
), ),
...@@ -76,13 +78,15 @@ TRACE_EVENT_FN(hcall_entry, ...@@ -76,13 +78,15 @@ TRACE_EVENT_FN(hcall_entry,
hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
); );
TRACE_EVENT_FN(hcall_exit, TRACE_EVENT_FN_COND(hcall_exit,
TP_PROTO(unsigned long opcode, unsigned long retval, TP_PROTO(unsigned long opcode, unsigned long retval,
unsigned long *retbuf), unsigned long *retbuf),
TP_ARGS(opcode, retval, retbuf), TP_ARGS(opcode, retval, retbuf),
TP_CONDITION(cpu_online(raw_smp_processor_id())),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(unsigned long, opcode) __field(unsigned long, opcode)
__field(unsigned long, retval) __field(unsigned long, retval)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment