This is a note to let you know that I've just added the patch titled tracing: Do not stop recording comms if the trace file is being read to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: tracing-do-not-stop-recording-comms-if-the-trace-file-is-being-read.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 4fdd595e4f9a1ff6d93ec702eaecae451cfc6591 Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx> Date: Thu, 17 Jun 2021 14:32:34 -0400 Subject: tracing: Do not stop recording comms if the trace file is being read From: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx> 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@xxxxxxxxxxxxxxx Fixes: 7ffbd48d5cab2 ("tracing: Cache comms only after an event occurred") Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- kernel/trace/trace.c | 9 --------- 1 file changed, 9 deletions(-) --- 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, 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, v return; #endif - if (!iter->snapshot) - atomic_dec(&trace_record_cmdline_disabled); - trace_access_unlock(iter->cpu_file); trace_event_read_unlock(); } Patches currently in stable-queue which might be from rostedt@xxxxxxxxxxx are queue-4.9/tracing-do-no-increment-trace_clock_global-by-one.patch queue-4.9/tracing-do-not-stop-recording-cmdlines-when-tracing-is-off.patch queue-4.9/tracing-do-not-stop-recording-comms-if-the-trace-file-is-being-read.patch