Skip to content

Commit

Permalink
tracing: Do not stop recording comms if the trace file is being read
Browse files Browse the repository at this point in the history
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: [email protected]
Fixes: 7ffbd48 ("tracing: Cache comms only after an event occurred")
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
rostedt committed Jun 18, 2021
1 parent 85550c8 commit 4fdd595
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2198,9 +2198,6 @@ struct saved_cmdlines_buffer {
};
static struct saved_cmdlines_buffer *savedcmd;

/* temporary disable recording */
static atomic_t trace_record_taskinfo_disabled __read_mostly;

static inline char *get_saved_cmdlines(int idx)
{
return &savedcmd->saved_cmdlines[idx * TASK_COMM_LEN];
Expand Down Expand Up @@ -3996,9 +3993,6 @@ static void *s_start(struct seq_file *m, loff_t *pos)
return ERR_PTR(-EBUSY);
#endif

if (!iter->snapshot)
atomic_inc(&trace_record_taskinfo_disabled);

if (*pos != iter->pos) {
iter->ent = NULL;
iter->cpu = 0;
Expand Down Expand Up @@ -4041,9 +4035,6 @@ static void s_stop(struct seq_file *m, void *p)
return;
#endif

if (!iter->snapshot)
atomic_dec(&trace_record_taskinfo_disabled);

trace_access_unlock(iter->cpu_file);
trace_event_read_unlock();
}
Expand Down

0 comments on commit 4fdd595

Please sign in to comment.