[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090325133439.GF5976@nowhere>
Date: Wed, 25 Mar 2009 14:34:40 +0100
From: Frederic Weisbecker <fweisbec@...il.com>
To: Lai Jiangshan <laijs@...fujitsu.com>
Cc: Ingo Molnar <mingo@...e.hu>, Steven Rostedt <srostedt@...hat.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] trace_workqueues: fix empty line's output
On Wed, Mar 25, 2009 at 04:59:18PM +0800, Lai Jiangshan wrote:
>
> Empty lines separate cpus stat. After previous
> fix(trace_stat: keep original order) applied, the empty lines
> are displayed at incorrect position.
>
> Signed-off-by: Lai Jiangshan <laijs@...fujitsu.com>
> ---
> diff --git a/kernel/trace/trace_workqueue.c b/kernel/trace/trace_workqueue.c
> index 9ab035b..797201e 100644
> --- a/kernel/trace/trace_workqueue.c
> +++ b/kernel/trace/trace_workqueue.c
> @@ -196,6 +196,11 @@ static int workqueue_stat_show(struct seq_file *s, void *p)
> struct pid *pid;
> struct task_struct *tsk;
>
> + spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
> + if (&cws->list == workqueue_cpu_stat(cpu)->list.next)
> + seq_printf(s, "\n");
> + spin_unlock_irqrestore(&workqueue_cpu_stat(cpu)->lock, flags);
> +
> pid = find_get_pid(cws->pid);
> if (pid) {
> tsk = get_pid_task(pid, PIDTYPE_PID);
> @@ -208,18 +213,13 @@ static int workqueue_stat_show(struct seq_file *s, void *p)
> put_pid(pid);
> }
>
> - spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
> - if (&cws->list == workqueue_cpu_stat(cpu)->list.next)
> - seq_printf(s, "\n");
> - spin_unlock_irqrestore(&workqueue_cpu_stat(cpu)->lock, flags);
> -
> return 0;
> }
>
> static int workqueue_stat_headers(struct seq_file *s)
> {
> seq_printf(s, "# CPU INSERTED EXECUTED NAME\n");
> - seq_printf(s, "# | | | |\n\n");
> + seq_printf(s, "# | | | |\n");
> return 0;
> }
>
>
>
Looks good.
Acked-by: Frederic Weisbecker <fweisbec@...il.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists