public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Ingo Molnar <mingo@elte.hu>, Steven Rostedt <srostedt@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] trace_workqueues: fix empty line's output
Date: Wed, 25 Mar 2009 14:34:40 +0100	[thread overview]
Message-ID: <20090325133439.GF5976@nowhere> (raw)
In-Reply-To: <49C9F266.2060706@cn.fujitsu.com>

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@cn.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@gmail.com>


  reply	other threads:[~2009-03-25 13:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-25  8:59 [PATCH 2/2] trace_workqueues: fix empty line's output Lai Jiangshan
2009-03-25 13:34 ` Frederic Weisbecker [this message]
2009-03-25 17:33 ` [tip:tracing/ftrace] " Lai Jiangshan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090325133439.GF5976@nowhere \
    --to=fweisbec@gmail.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=srostedt@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox