mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jan Kara <jack@suse.cz>, Dave Chinner <david@fromorbit.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 6/6] writeback: convert to relative older_than_this in trace events
Date: Thu, 5 May 2011 00:23:33 +0200	[thread overview]
Message-ID: <20110504222333.GL6968@quack.suse.cz> (raw)
In-Reply-To: <20110504091909.904141006@intel.com>

On Wed 04-05-11 17:17:13, Wu Fengguang wrote:
> This is a format change that could break established scripts.
> 
> But hopefully it's more human friendly to show the relative values like
> "30000" (30s old) or "0" (all fresh ones) than long absolute jiffy
> numbers.
  It's possibly more human friendly but probably also harder to handle in
scripts. I especially don't like the fact that the number will be changing
at different tracepoints - you'll then have to do some comparisons to find
out whether just the timestamp has been changed or whether just the time
passes by. It's not that hard to write a script doing absolute->relative
conversion (since you have time stamps in the traces) for those cases where
relative time is really what interests you. So do you have any particular
usecase in mind for the relative value?

								Honza
> 
> Note that the initial 30000 or 0 may increase over time as they are now
> relative numbers.
> 
> CC: Jan Kara <jack@suse.cz>
> CC: Dave Chinner <david@fromorbit.com> 
> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
> ---
>  include/trace/events/writeback.h |   11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> --- linux-next.orig/include/trace/events/writeback.h	2011-05-04 16:09:59.000000000 +0800
> +++ linux-next/include/trace/events/writeback.h	2011-05-04 16:10:57.000000000 +0800
> @@ -115,7 +115,7 @@ DECLARE_EVENT_CLASS(wbc_class,
>  		__field(int, for_reclaim)
>  		__field(int, range_cyclic)
>  		__field(int, more_io)
> -		__field(unsigned long, older_than_this)
> +		__field(int, older)
>  		__field(long, range_start)
>  		__field(long, range_end)
>  	),
> @@ -130,14 +130,15 @@ DECLARE_EVENT_CLASS(wbc_class,
>  		__entry->for_reclaim	= wbc->for_reclaim;
>  		__entry->range_cyclic	= wbc->range_cyclic;
>  		__entry->more_io	= wbc->more_io;
> -		__entry->older_than_this = wbc->older_than_this ?
> -						*wbc->older_than_this : 0;
> +		__entry->older		= wbc->older_than_this ?
> +				(jiffies - *wbc->older_than_this) * 1000 / HZ
> +				: -1;
>  		__entry->range_start	= (long)wbc->range_start;
>  		__entry->range_end	= (long)wbc->range_end;
>  	),
>  
>  	TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d "
> -		"bgrd=%d reclm=%d cyclic=%d more=%d older=0x%lx "
> +		"bgrd=%d reclm=%d cyclic=%d more=%d older=%d "
>  		"start=0x%lx end=0x%lx",
>  		__entry->name,
>  		__entry->nr_to_write,
> @@ -148,7 +149,7 @@ DECLARE_EVENT_CLASS(wbc_class,
>  		__entry->for_reclaim,
>  		__entry->range_cyclic,
>  		__entry->more_io,
> -		__entry->older_than_this,
> +		__entry->older,
>  		__entry->range_start,
>  		__entry->range_end)
>  )
> 
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2011-05-04 22:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-04  9:17 [PATCH 0/6] writeback fixes and " Wu Fengguang
2011-05-04  9:17 ` [PATCH 1/6] writeback: add bdi_dirty_limit() kernel-doc Wu Fengguang
2011-05-04  9:17 ` [PATCH 2/6] writeback: skip balance_dirty_pages() for in-memory fs Wu Fengguang
2011-05-04  9:17 ` [PATCH 3/6] writeback: make nr_to_write a per-file limit Wu Fengguang
2011-05-04  9:42   ` Christoph Hellwig
2011-05-04 11:52     ` Wu Fengguang
2011-05-04 15:51       ` Wu Fengguang
2011-05-04 16:18         ` Christoph Hellwig
2011-05-05 10:47           ` Wu Fengguang
2011-05-04  9:17 ` [PATCH 4/6] writeback: trace event writeback_single_inode Wu Fengguang
2011-05-04  9:17 ` [PATCH 5/6] writeback: trace event writeback_queue_io Wu Fengguang
2011-05-05 16:37   ` [PATCH 5/6] writeback: trace event writeback_queue_io (v2) Wu Fengguang
2011-05-05 17:26     ` Jan Kara
2011-05-04  9:17 ` [PATCH 6/6] writeback: convert to relative older_than_this in trace events Wu Fengguang
2011-05-04 22:23   ` Jan Kara [this message]
2011-05-05 12:33     ` Wu Fengguang
2011-05-04  9:46 ` [PATCH 0/6] writeback fixes and " Christoph Hellwig
2011-05-04  9:56   ` Wu Fengguang
2011-05-04 10:06     ` Dave Chinner
2011-05-04 11:18       ` Christoph Hellwig
2011-05-04 13:12       ` Theodore Tso
2011-05-04 22:31         ` Jan Kara

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=20110504222333.GL6968@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=david@fromorbit.com \
    --cc=fengguang.wu@intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome