]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Do not stop recording cmdlines when tracing is off
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 17 Jun 2021 17:47:25 +0000 (13:47 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 18 Jun 2021 13:10:00 +0000 (09:10 -0400)
commitd6fca4cabd3c0cdd4b676d46acd3603424f93bf4
treee49be683a697d609b148fe136b1690a4a30c97bf
parent75c06e43da95e465164fd88c16ed5065ac913c85
tracing: Do not stop recording cmdlines when tracing is off

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: a9049c9bfa220 ("tracing: Cache comms only after an event occurred")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace.c