diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2021-06-17 14:32:34 -0400 |
---|---|---|
committer | Sasha Levin <sashal@kernel.org> | 2021-06-30 08:49:18 -0400 |
commit | 54657108d19c5683b6e9938f11f386308ee7d1d5 (patch) | |
tree | c310478d463ce8efd11c487a5cacbfb3e44df4ac | |
parent | 46ac8f9c1d5c06991b412b52b28fa010b0c72cc2 (diff) | |
download | linux-stable-54657108d19c5683b6e9938f11f386308ee7d1d5.tar.gz linux-stable-54657108d19c5683b6e9938f11f386308ee7d1d5.tar.bz2 linux-stable-54657108d19c5683b6e9938f11f386308ee7d1d5.zip |
tracing: Do not stop recording comms if the trace file is being read
commit 4fdd595e4f9a1ff6d93ec702eaecae451cfc6591 upstream.
A while ago, when the "trace" file was opened, tracing was stopped, and
code was added to stop recording the comms to saved_cmdlines, for mapping
of the pids to the task name.
Code has been added that only records the comm if a trace event occurred,
and there's no reason to not trace it if the trace file is opened.
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.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 74ec372a3286..e8bd8de856de 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1616,9 +1616,6 @@ struct saved_cmdlines_buffer { }; static struct saved_cmdlines_buffer *savedcmd; -/* temporary disable recording */ -static atomic_t trace_record_cmdline_disabled __read_mostly; - static inline char *get_saved_cmdlines(int idx) { return &savedcmd->saved_cmdlines[idx * TASK_COMM_LEN]; @@ -2825,9 +2822,6 @@ static void *s_start(struct seq_file *m, loff_t *pos) return ERR_PTR(-EBUSY); #endif - if (!iter->snapshot) - atomic_inc(&trace_record_cmdline_disabled); - if (*pos != iter->pos) { iter->ent = NULL; iter->cpu = 0; @@ -2870,9 +2864,6 @@ static void s_stop(struct seq_file *m, void *p) return; #endif - if (!iter->snapshot) - atomic_dec(&trace_record_cmdline_disabled); - trace_access_unlock(iter->cpu_file); trace_event_read_unlock(); } |