tracing: Try again for saved cmdline if failed due to locking
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Fri, 30 May 2014 13:42:39 +0000 (09:42 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Fri, 30 May 2014 13:42:39 +0000 (09:42 -0400)
commit379cfdac37923653c9d4242d10052378b7563005
tree441d3a81677f0b0031645dc176996bd93f230539
parent42584c81c5adc1737a6fe0687facc5e62a5dc8c1
tracing: Try again for saved cmdline if failed due to locking

In order to prevent the saved cmdline cache from being filled when
tracing is not active, the comms are only recorded after a trace event
is recorded.

The problem is, a comm can fail to be recorded if the trace_cmdline_lock
is held. That lock is taken via a trylock to allow it to happen from
any context (including NMI). If the lock fails to be taken, the comm
is skipped. No big deal, as we will try again later.

But! Because of the code that was added to only record after an event,
we may not try again later as the recording is made as a oneshot per
event per CPU.

Only disable the recording of the comm if the comm is actually recorded.

Fixes: 7ffbd48d5cab "tracing: Cache comms only after an event occurred"
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.c