public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Mark Fasheh <mfasheh@suse.de>
Cc: Christoph Hellwig <hch@infradead.org>,
	Jeff Mahoney <jeffm@suse.com>,
	xfs@oss.sgi.com
Subject: Re: xfs-trace-ilock-more
Date: Fri, 6 Jan 2012 10:54:06 +1100	[thread overview]
Message-ID: <20120105235406.GH24466@dastard> (raw)
In-Reply-To: <20120105223859.GJ11114@wotan.suse.de>

On Thu, Jan 05, 2012 at 02:38:59PM -0800, Mark Fasheh wrote:
> On Sun, Dec 18, 2011 at 03:27:34PM -0500, Christoph Hellwig wrote:
> > Given that the patch is fairly clean can you send it to us for
> > inclusion?
> 
> Here goes. I updated the patch for 3.2 and of course gave it a quick test.
> 	--Mark
> 
> --
> Mark Fasheh
> 
> From: Mark Fasheh <mfasheh@suse.com>
> 
> [PATCH] xfs: add more ilock tracing
> 
> Let's get a trace of the amount of time spent in xfs_ilock(). This has
> helped us (SUSE) in investigating read/write performance issues in the past
> when ilock() contention has come up as a possibile issue.
> 
> Signed-off-by: Mark Fasheh <mfasheh@suse.de>

....

> --- a/fs/xfs/xfs_trace.h
> +++ b/fs/xfs/xfs_trace.h
> @@ -507,32 +507,35 @@ DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
>  
>  DECLARE_EVENT_CLASS(xfs_lock_class,
>  	TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
> -		 unsigned long caller_ip),
> -	TP_ARGS(ip,  lock_flags, caller_ip),
> +		 unsigned long start, unsigned long caller_ip),
> +	TP_ARGS(ip,lock_flags, start, caller_ip),
>  	TP_STRUCT__entry(
>  		__field(dev_t, dev)
>  		__field(xfs_ino_t, ino)
>  		__field(int, lock_flags)
> +		__field(unsigned long, start)
>  		__field(unsigned long, caller_ip)
>  	),
>  	TP_fast_assign(
>  		__entry->dev = VFS_I(ip)->i_sb->s_dev;
>  		__entry->ino = ip->i_ino;
>  		__entry->lock_flags = lock_flags;
> +		__entry->start = start;
>  		__entry->caller_ip = caller_ip;
>  	),
> -	TP_printk("dev %d:%d ino 0x%llx flags %s caller %pf",
> +	TP_printk("dev %d:%d ino 0x%llx flags %s wait %lu caller %pf",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
>  		  __entry->ino,
>  		  __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
> +		  (jiffies - __entry->start),

I'm not sure this is valid - the printk format can be used by tools
outside the kernel at a later time (e.g. they read from the kernel
in binary format). If you want this to be done, the it needs to be
calculated in the TP_fast_assign() macro.

Indeed, you are printing is the time delta between the start of
the operation and the completion. in that case, the delta should be
what is recorded in the trace point, not calculated implicitly
inside the format string of the trace point. i.e callers do:

	trace_xfs_iunlock(ip, lock_flags, jiffies - start, _RET_IP_);

to pass an explicit delta value to the trace point...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      reply	other threads:[~2012-01-05 23:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14  2:40 xfs-trace-ilock-more Christoph Hellwig
2011-12-14 18:27 ` xfs-trace-ilock-more Mark Fasheh
2011-12-14 19:24   ` xfs-trace-ilock-more Jeff Mahoney
2011-12-14 20:32     ` xfs-trace-ilock-more Dave Chinner
2011-12-14 22:42       ` xfs-trace-ilock-more Jeff Mahoney
2011-12-18 20:26     ` xfs-trace-ilock-more Christoph Hellwig
2011-12-18 20:27   ` xfs-trace-ilock-more Christoph Hellwig
2012-01-05 22:38     ` xfs-trace-ilock-more Mark Fasheh
2012-01-05 23:54       ` Dave Chinner [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=20120105235406.GH24466@dastard \
    --to=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=jeffm@suse.com \
    --cc=mfasheh@suse.de \
    --cc=xfs@oss.sgi.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