diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-03-18 03:56:58 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-18 05:10:16 -0400 |
commit | 18aecd362a1c991fbf5f7919ae051a77532ba2f8 (patch) | |
tree | f19f11afa2b669a6acea5c98fda091b68993bc59 /kernel/trace/trace.c | |
parent | 03418c7efaa429dc7647ac93e3862e3fe1816873 (diff) |
tracing: stop command line recording when tracing is disabled
Impact: prevent overwrite of command line entries
When the tracer is stopped the command line recording continues to
record. The check for tracing_is_on() is not sufficient here as the
ringbuffer status is not affected by setting
debug/tracing/tracing_enabled to 0. On a non idle system this can
result in the loss of the command line information for the stopped
trace, which makes the trace harder to read and analyse.
Check tracer_enabled to allow further recording.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Steven Rostedt <srostedt@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 1ce6208fd727..7b6043ea256e 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -797,7 +797,8 @@ void trace_find_cmdline(int pid, char comm[]) | |||
797 | 797 | ||
798 | void tracing_record_cmdline(struct task_struct *tsk) | 798 | void tracing_record_cmdline(struct task_struct *tsk) |
799 | { | 799 | { |
800 | if (atomic_read(&trace_record_cmdline_disabled) || !tracing_is_on()) | 800 | if (atomic_read(&trace_record_cmdline_disabled) || !tracer_enabled || |
801 | !tracing_is_on()) | ||
801 | return; | 802 | return; |
802 | 803 | ||
803 | trace_save_cmdline(tsk); | 804 | trace_save_cmdline(tsk); |