History

trace_workqueues: fix empty line's output

Empty lines separate cpus stat. After previous fix(trace_stat: keep original order) applied, the empty lines are displayed at incorrect position.

Lai Jiangshan committed 17 years ago

Commit 2f63b841 parent 220ba351 file · +6 −6Browse files

Showing the changes to kernel/trace/trace_workqueue.c (1 of 1 file). Show all

Unified · Split

kernel/trace/trace_workqueue.c+6−6
@@ -196,6 +196,11 @@ static int workqueue_stat_show(struct seq_file *s, void *p) · 195 unmodified lines
196196 struct pid *pid;
197197 struct task_struct *tsk;
198198
199+ spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
200+ if (&cws->list == workqueue_cpu_stat(cpu)->list.next)
201+ seq_printf(s, "\n");
202+ spin_unlock_irqrestore(&workqueue_cpu_stat(cpu)->lock, flags);
203+
199204 pid = find_get_pid(cws->pid);
200205 if (pid) {
201206 tsk = get_pid_task(pid, PIDTYPE_PID);
@@ -208,18 +213,13 @@ static int workqueue_stat_show(struct seq_file *s, void *p) · 6 unmodified lines
208213 put_pid(pid);
209214 }
210215
211− spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
212− if (&cws->list == workqueue_cpu_stat(cpu)->list.next)
213− seq_printf(s, "\n");
214− spin_unlock_irqrestore(&workqueue_cpu_stat(cpu)->lock, flags);
215−
216216 return 0;
217217 }
218218
219219 static int workqueue_stat_headers(struct seq_file *s)
220220 {
221221 seq_printf(s, "# CPU INSERTED EXECUTED NAME\n");
222− seq_printf(s, "# | | | |\n\n");
222+ seq_printf(s, "# | | | |\n");
223223 return 0;
224224 }
225225