Skip to content

Commit b313bd9

Browse files
rostedtgregkh
authored andcommitted
tracing: Do not stop recording comms if the trace file is being read
commit 4fdd595 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: 7ffbd48 ("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>
1 parent adb3849 commit b313bd9

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

‎kernel/trace/trace.c‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2195,9 +2195,6 @@ struct saved_cmdlines_buffer {
21952195
};
21962196
static struct saved_cmdlines_buffer *savedcmd;
21972197

2198-
/* temporary disable recording */
2199-
static atomic_t trace_record_taskinfo_disabled __read_mostly;
2200-
22012198
static inline char *get_saved_cmdlines(int idx)
22022199
{
22032200
return &savedcmd->saved_cmdlines[idx * TASK_COMM_LEN];
@@ -3683,9 +3680,6 @@ static void *s_start(struct seq_file *m, loff_t *pos)
36833680
return ERR_PTR(-EBUSY);
36843681
#endif
36853682

3686-
if (!iter->snapshot)
3687-
atomic_inc(&trace_record_taskinfo_disabled);
3688-
36893683
if (*pos != iter->pos) {
36903684
iter->ent = NULL;
36913685
iter->cpu = 0;
@@ -3728,9 +3722,6 @@ static void s_stop(struct seq_file *m, void *p)
37283722
return;
37293723
#endif
37303724

3731-
if (!iter->snapshot)
3732-
atomic_dec(&trace_record_taskinfo_disabled);
3733-
37343725
trace_access_unlock(iter->cpu_file);
37353726
trace_event_read_unlock();
37363727
}

0 commit comments

Comments
 (0)