Re: [PATCH 5/6] xfs: stringify btree cursor types in ftrace output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/28/18 5:29 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> 
> Use __print_symbolic to print the btree type in ftrace output.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

Ok, and because XFS_BTNUM_BNOi *shudder* et al are enums, you also
need the fancy wrappers.

> ---
>  fs/xfs/libxfs/xfs_types.h |    9 +++++++++
>  fs/xfs/scrub/trace.h      |   38 ++++++++++++++++++++++++++------------
>  fs/xfs/xfs_trace.h        |   12 ++++++++++--
>  3 files changed, 45 insertions(+), 14 deletions(-)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h
> index 297cf2318f83..eb04afe9cce0 100644
> --- a/fs/xfs/libxfs/xfs_types.h
> +++ b/fs/xfs/libxfs/xfs_types.h
> @@ -114,6 +114,15 @@ typedef enum {
>  	XFS_BTNUM_INOi, XFS_BTNUM_FINOi, XFS_BTNUM_REFCi, XFS_BTNUM_MAX
>  } xfs_btnum_t;
>  
> +#define XFS_BTNUM_STRINGS \
> +	{ XFS_BTNUM_BNOi,	"bnobt" }, \
> +	{ XFS_BTNUM_CNTi,	"cntbt" }, \
> +	{ XFS_BTNUM_RMAPi,	"rmapbt" }, \
> +	{ XFS_BTNUM_BMAPi,	"bmbt" }, \
> +	{ XFS_BTNUM_INOi,	"inobt" }, \
> +	{ XFS_BTNUM_FINOi,	"finobt" }, \
> +	{ XFS_BTNUM_REFCi,	"refcbt" }
> +

how do we decide whether to put these string translations for trace in common
headers (as here) vs. in the the trace file itself (as with, say,
XFS_AG_BTREE_CMP_FORMAT_STR) ?

-Eric



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux