xfs
[Top] [All Lists]

Re: [PATCH 08/21] make btree tracing generic

To: Christoph Hellwig <hch@xxxxxx>
Subject: Re: [PATCH 08/21] make btree tracing generic
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 30 Jul 2008 11:39:20 +1000
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20080729193044.GI19104@xxxxxx>
Mail-followup-to: Christoph Hellwig <hch@xxxxxx>, xfs@xxxxxxxxxxx
References: <20080729193044.GI19104@xxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
On Tue, Jul 29, 2008 at 09:30:44PM +0200, Christoph Hellwig wrote:
> make the existing bmap btree tracing generic so that it applies to all
> btree types.
> 
> Some fragments lifted from a patch by Dave Chinner.
> 
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> 
> Index: linux-2.6-xfs/fs/xfs/xfs_btree.h
> ===================================================================
> --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h     2008-07-29 16:23:23.000000000 
> +0200
> +++ linux-2.6-xfs/fs/xfs/xfs_btree.h  2008-07-29 16:52:06.000000000 +0200
> @@ -190,6 +190,25 @@ struct xfs_btree_ops {
>  
>       /* get inode rooted btree root */
>       struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *);
> +
> +     /* btree tracing */
> +#ifdef XFS_BTREE_TRACE
> +     void            (*trace_enter)(struct xfs_btree_cur *, const char *,
> +                                    char *, int, int, __psunsigned_t,
> +                                    __psunsigned_t, __psunsigned_t,
> +                                    __psunsigned_t, __psunsigned_t,
> +                                    __psunsigned_t, __psunsigned_t,
> +                                    __psunsigned_t, __psunsigned_t,
> +                                    __psunsigned_t, __psunsigned_t);

Would it be better to use a 'trace args' structure here rather
than passing a heap of parameters? memset(args, 0,...) rather than
passing a whole heap of zeros in most cases seems like a better
approach to me, esp. as they all get cast to (void *) anyway....

> +static void
> +xfsidb_btree_trace_record(

shouldn't these all use "xfsidbg" prefixes?

Otherwise looks ok.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx


<Prev in Thread] Current Thread [Next in Thread>