History

tracing: Do not stop recording comms if the trace file is being read

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.

Steven Rostedt (VMware) committed 5 years ago

Commit 4fdd5951 parent 85550c81 file · +0 −9Browse files

Unified · Split

kernel/trace/trace.c+0−9
@@ -2198,9 +2198,6 @@ struct saved_cmdlines_buffer { · 2197 unmodified lines
21982198 };
21992199 static struct saved_cmdlines_buffer *savedcmd;
22002200
2201−/* temporary disable recording */
2202−static atomic_t trace_record_taskinfo_disabled __read_mostly;
2203−
22042201 static inline char *get_saved_cmdlines(int idx)
22052202 {
22062203 return &savedcmd->saved_cmdlines[idx * TASK_COMM_LEN];
@@ -3996,9 +3993,6 @@ static void *s_start(struct seq_file *m, loff_t *pos) · 1789 unmodified lines
39963993 return ERR_PTR(-EBUSY);
39973994 #endif
39983995
3999− if (!iter->snapshot)
4000− atomic_inc(&trace_record_taskinfo_disabled);
4001−
40023996 if (*pos != iter->pos) {
40033997 iter->ent = NULL;
40043998 iter->cpu = 0;
@@ -4041,9 +4035,6 @@ static void s_stop(struct seq_file *m, void *p) · 36 unmodified lines
40414035 return;
40424036 #endif
40434037
4044− if (!iter->snapshot)
4045− atomic_dec(&trace_record_taskinfo_disabled);
4046−
40474038 trace_access_unlock(iter->cpu_file);
40484039 trace_event_read_unlock();
40494040 }