public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Zhaolei <zhaolei@cn.fujitsu.com>
Cc: Ingo Molnar <mingo@elte.hu>, Steven Rostedt <rostedt@goodmis.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] tracing/workqueue: make events sort in ascending order
Date: Tue, 26 May 2009 23:01:15 +0200	[thread overview]
Message-ID: <20090526210113.GG5969@nowhere> (raw)
In-Reply-To: <4A1BA696.9090404@cn.fujitsu.com>

On Tue, May 26, 2009 at 04:21:42PM +0800, Zhaolei wrote:
> Events in workqueue tracer need to be sorted in ascending order to make user
> clear.
> But now it is reversed by "tracing/stat: replace linked list by an rbtree
> for sorting"(53059c9b67a62a3dc8c80204d3da42b9267ea5a0).
> We need to define a custom cmp() callback to make sorting correct.


That's my bad, the reverse sorting subsequent to this patch is an accident
so the fix should be done in the stat tracing framework.

I'll fix that.

The other patches for the workqueue tracer look good. I'll apply
them and send a pull request to Ingo.

Thanks!



> 
> Before patch:
>  # CPU INSERTED EXECUTED   MAX us   AVG us   TASKNAME:PID
>  #  |     |        |         |        |      `-WORKFUNC
>  #  |     |        |         |        |           |
>      0        1        1     1155     1155   `-xprt_autoclose
>      0       19       19      864      143   |-xs_udp_connect_worker4
>  ...
>      0        1        1     4825     4825   |-reg_todo
>      0      443      515                     events/0:5
> 
> After patch:
>  # CPU INSERTED EXECUTED   MAX us   AVG us   TASKNAME:PID
>  #  |     |        |         |        |      `-WORKFUNC
>  #  |     |        |         |        |           |
>      0      443      515                     events/0:5
>      0        1        1     4825     4825   |-reg_todo
>  ...
>      0       19       19      797      134   |-xs_udp_connect_worker4
>      0        1        1     8359     8359   `-xprt_autoclose
> 
> Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
> ---
>  kernel/trace/trace_workqueue.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/kernel/trace/trace_workqueue.c b/kernel/trace/trace_workqueue.c
> index 53fe43e..7fa0d23 100644
> --- a/kernel/trace/trace_workqueue.c
> +++ b/kernel/trace/trace_workqueue.c
> @@ -383,6 +383,12 @@ static void *workqueue_stat_next(void *prev, int idx)
>  	return ret;
>  }
>  
> +/* To make events sort in ascending order */
> +static int workqueue_stat_cmp(void *p1, void *p2)
> +{
> +	return -1;
> +}
> +
>  static int workqueue_stat_show(struct seq_file *s, void *p)
>  {
>  	struct workfunc_stats *wfstat = p;
> @@ -470,6 +476,7 @@ static struct tracer_stat workqueue_stats __read_mostly = {
>  	.name		= "workqueues",
>  	.stat_start	= workqueue_stat_start,
>  	.stat_next	= workqueue_stat_next,
> +	.stat_cmp	= workqueue_stat_cmp,
>  	.stat_show	= workqueue_stat_show,
>  	.stat_headers	= workqueue_stat_headers,
>  	.file_open	= workqueue_stat_file_open,
> -- 
> 1.5.5.3
> 


      reply	other threads:[~2009-05-26 21:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-26  8:06 [PATCH 1/3] tracing/workqueue: fix list header and function name format Zhaolei
2009-05-26  8:21 ` [PATCH 2/3] tracing/workqueue: cleanup for trace_workqueue.c Zhaolei
2009-05-26  8:21 ` [PATCH 3/3] tracing/workqueue: make events sort in ascending order Zhaolei
2009-05-26 21:01   ` Frederic Weisbecker [this message]

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=20090526210113.GG5969@nowhere \
    --to=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=zhaolei@cn.fujitsu.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