tracing: Show the preempt count of when the event was called
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Fri, 17 Jun 2016 21:40:58 +0000 (17:40 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 20 Jun 2016 13:54:21 +0000 (09:54 -0400)
commite947841c0dce9db675a957182214ef8091ac3d61
tree8388467c005b99695103a85f03a9b21a6194b5b0
parentaad108aa9d1aca5be178ef40325dcc99b448e866
tracing: Show the preempt count of when the event was called

Because tracepoint callbacks are done with preemption enabled, the trace
events are always called with preempt disable due to the
rcu_read_lock_sched_notrace() in __DO_TRACE(). This causes the preempt count
shown in the recorded trace event to be inaccurate. It is always one more
that what the preempt_count was when the tracepoint was called.

If CONFIG_PREEMPT is enabled, subtract 1 from the preempt_count before
recording it in the trace buffer.

Link: http://lkml.kernel.org/r/20160525132537.GA10808@linutronix.de
Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace_events.c