tracing: stop comm recording on tracing off

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Sunday, April 5, 2009 - 12:13 pm

Gitweb:     http://git.kernel.org/linus/6adaad14d7d4d3ef31b4e2dc992b18b5da7c4eb3
Commit:     6adaad14d7d4d3ef31b4e2dc992b18b5da7c4eb3
Parent:     4ca530852346be239b7c19e7bec5d2b78855bebe
Author:     Steven Rostedt <srostedt@redhat.com>
AuthorDate: Mon Mar 16 21:57:17 2009 -0400
Committer:  Steven Rostedt <srostedt@redhat.com>
CommitDate: Mon Mar 16 23:31:15 2009 -0400

    tracing: stop comm recording on tracing off
    
    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>
---
 kernel/trace/trace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 2796bd2..8f89690 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -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);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
tracing: stop comm recording on tracing off, Linux Kernel Mailing ..., (Sun Apr 5, 12:13 pm)