Skip to content

Commit

Permalink
tracing: stop comm recording on tracing off
Browse files Browse the repository at this point in the history
Impact: fix for losing comms in trace

The command lines of tasks are cached at sched switch to not need
to record them at every trace point.  Disabling the tracing on stops
the recording of traces, but does not stop the caching of command lines.
When the tracing is off the cache may overflow and cause the tracing
to show incorrect tasks matching the PIDs.

This patch disables prevents updates to the comm cache when the ring buffer
is off.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
  • Loading branch information
Steven Rostedt committed Mar 17, 2009
1 parent 4ca5308 commit 6adaad1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ void trace_find_cmdline(int pid, char comm[])

void tracing_record_cmdline(struct task_struct *tsk)
{
if (atomic_read(&trace_record_cmdline_disabled))
if (atomic_read(&trace_record_cmdline_disabled) || !tracing_is_on())
return;

trace_save_cmdline(tsk);
Expand Down

0 comments on commit 6adaad1

Please sign in to comment.