summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2021-06-17 13:47:25 -0400
committerSasha Levin <sashal@kernel.org>2021-06-30 08:49:18 -0400
commit46ac8f9c1d5c06991b412b52b28fa010b0c72cc2 (patch)
treebcdbb34c82ec5148706bdd1cd4bd2cc3f001d2f9
parentff4c63f3e8cb7af2ce51cc56b031e08fd23c758b (diff)
downloadlinux-stable-46ac8f9c1d5c06991b412b52b28fa010b0c72cc2.tar.gz
linux-stable-46ac8f9c1d5c06991b412b52b28fa010b0c72cc2.tar.bz2
linux-stable-46ac8f9c1d5c06991b412b52b28fa010b0c72cc2.zip
tracing: Do not stop recording cmdlines when tracing is off
commit 85550c83da421fb12dc1816c45012e1e638d2b38 upstream. The saved_cmdlines is used to map pids to the task name, such that the output of the tracing does not just show pids, but also gives a human readable name for the task. If the name is not mapped, the output looks like this: <...>-1316 [005] ...2 132.044039: ... Instead of this: gnome-shell-1316 [005] ...2 132.044039: ... The names are updated when tracing is running, but are skipped if tracing is stopped. Unfortunately, this stops the recording of the names if the top level tracer is stopped, and not if there's other tracers active. The recording of a name only happens when a new event is written into a ring buffer, so there is no need to test if tracing is on or not. If tracing is off, then no event is written and no need to test if tracing is off or not. Remove the check, as it hides the names of tasks for events in the instance buffers. Cc: stable@vger.kernel.org Fixes: 7ffbd48d5cab2 ("tracing: Cache comms only after an event occurred") Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--kernel/trace/trace.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index cdf614943aa3..74ec372a3286 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1882,9 +1882,6 @@ void trace_find_cmdline(int pid, char comm[])
void tracing_record_cmdline(struct task_struct *tsk)
{
- if (atomic_read(&trace_record_cmdline_disabled) || !tracing_is_on())
- return;
-
if (!__this_cpu_read(trace_cmdline_save))
return;