tracing: Fix stacktrace of latency tracers (irqsoff and friends)
authorSteven Rostedt <srostedt@redhat.com>
Thu, 19 Apr 2012 14:31:47 +0000 (10:31 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Thu, 19 Apr 2012 21:00:13 +0000 (17:00 -0400)
commitdb4c75cbebd7e5910cd3bcb6790272fcc3042857
tree068514135f1bfd68c6add551ec94545010ca5a73
parent348f0fc238efb441a28e7644c51f9fd3001b228a
tracing: Fix stacktrace of latency tracers (irqsoff and friends)

While debugging a latency with someone on IRC (mirage335) on #linux-rt (OFTC),
we discovered that the stacktrace output of the latency tracers
(preemptirqsoff) was empty.

This bug was caused by the creation of the dynamic length stack trace
again (like commit 12b5da3 "tracing: Fix ent_size in trace output" was).

This bug is caused by the latency tracers requiring the next event
to determine the time between the current event and the next. But by
grabbing the next event, the iter->ent_size is set to the next event
instead of the current one. As the stacktrace event is the last event,
this makes the ent_size zero and causes nothing to be printed for
the stack trace. The dynamic stacktrace uses the ent_size to determine
how much of the stack can be printed. The ent_size of zero means
no stack.

The simple fix is to save the iter->ent_size before finding the next event.

Note, mirage335 asked to remain anonymous from LKML and git, so I will
not add the Reported-by and Tested-by tags, even though he did report
the issue and tested the fix.

Cc: stable@vger.kernel.org # 3.1+
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace_output.c