]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jul 2014 01:59:12 +0000 (18:59 -0700)
commitbdd1a65b62995eb29f93b2b0d54ef1f9b9a8ece3
tree1f87438d7f03402fbf40cce8a68355d1a709c724
parent866da94194a9f73095f0c6dd3e45425573b0da4d
tracing: Try again for saved cmdline if failed due to locking

commit 379cfdac37923653c9d4242d10052378b7563005 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace.c