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.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -2198,9 +2198,6 @@ struct saved_cmdlines_buffer { · 2197 unmodified lines | |||
| 2198 | }; | 2198 | }; |
| 2199 | static struct saved_cmdlines_buffer *savedcmd; | 2199 | static struct saved_cmdlines_buffer *savedcmd; |
| 2200 | 2200 | ||
| 2201 | /* temporary disable recording */ | ||
| 2202 | static atomic_t trace_record_taskinfo_disabled __read_mostly; | ||
| 2203 | |||
| 2204 | static inline char *get_saved_cmdlines(int idx) | 2201 | static inline char *get_saved_cmdlines(int idx) |
| 2205 | { | 2202 | { |
| 2206 | return &savedcmd->saved_cmdlines[idx * TASK_COMM_LEN]; | 2203 | 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 | |||
| 3996 | return ERR_PTR(-EBUSY); | 3993 | return ERR_PTR(-EBUSY); |
| 3997 | #endif | 3994 | #endif |
| 3998 | 3995 | ||
| 3999 | if (!iter->snapshot) | ||
| 4000 | atomic_inc(&trace_record_taskinfo_disabled); | ||
| 4001 | |||
| 4002 | if (*pos != iter->pos) { | 3996 | if (*pos != iter->pos) { |
| 4003 | iter->ent = NULL; | 3997 | iter->ent = NULL; |
| 4004 | iter->cpu = 0; | 3998 | iter->cpu = 0; |
| @@ -4041,9 +4035,6 @@ static void s_stop(struct seq_file *m, void *p) · 36 unmodified lines | |||
| 4041 | return; | 4035 | return; |
| 4042 | #endif | 4036 | #endif |
| 4043 | 4037 | ||
| 4044 | if (!iter->snapshot) | ||
| 4045 | atomic_dec(&trace_record_taskinfo_disabled); | ||
| 4046 | |||
| 4047 | trace_access_unlock(iter->cpu_file); | 4038 | trace_access_unlock(iter->cpu_file); |
| 4048 | trace_event_read_unlock(); | 4039 | trace_event_read_unlock(); |
| 4049 | } | 4040 | } |