All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/2] btrfs: trace: Add trace events for extent_io_tree
Date: Thu, 28 Feb 2019 16:24:19 +0100	[thread overview]
Message-ID: <20190228152419.GH31119@twin.jikos.cz> (raw)
In-Reply-To: <20190228100255.10953-3-wqu@suse.com>

On Thu, Feb 28, 2019 at 06:02:55PM +0800, Qu Wenruo wrote:
>  TRACE_DEFINE_ENUM(FLUSH_DELAYED_ITEMS_NR);
> +#define show_extent_io_tree_owner(owner)				\
> +	__print_symbolic(owner,						\
> +		{ IO_TREE_FS_INFO_FREED_EXTENTS0, "FREED_EXTENTS0" },	\
> +		{ IO_TREE_FS_INFO_FREED_EXTENTS1, "FREED_EXTENTS1" },	\
> +		{ IO_TREE_INODE_IO_TREE,	 "INODE_IO_TREE" },	\
> +		{ IO_TREE_INODE_IO_FAILURE_TREE, "INODE_IO_FAILURE" },	\
> +		{ IO_TREE_RELOCATION_PROCESSED_BLOCKS, "RELOCATION" },	\
> +		{ IO_TREE_TRANSACTION_DIRTY_PAGES, "TRANS_DIRTY_PAGES" },\
> +		{ IO_TREE_ROOT_DIRTY_LOG_PAGES, "ROOT_DIRTY_LOG" },	\
> +		{ IO_TREE_TMP })

Please align the strings

> +
>  #define BTRFS_GROUP_FLAGS	\
>  	{ BTRFS_BLOCK_GROUP_DATA,	"DATA"},	\
>  	{ BTRFS_BLOCK_GROUP_SYSTEM,	"SYSTEM"},	\
> @@ -88,6 +100,25 @@ TRACE_DEFINE_ENUM(COMMIT_TRANS);
>  	{ BTRFS_BLOCK_GROUP_RAID5,	"RAID5"},	\
>  	{ BTRFS_BLOCK_GROUP_RAID6,	"RAID6"}
>  
> +#define EXTENT_FLAGS					\
> +	{ EXTENT_DIRTY,		"DIRTY"},		\
> +	{ EXTENT_WRITEBACK,	"WRITEBACK"},		\
> +	{ EXTENT_UPTODATE,	"UPTODATE"},		\
> +	{ EXTENT_LOCKED,	"LOCKED"},		\
> +	{ EXTENT_NEW,		"NEW"},			\
> +	{ EXTENT_DELALLOC,	"DELALLOC"},		\
> +	{ EXTENT_DEFRAG,	"DEFRAG"},		\
> +	{ EXTENT_BOUNDARY,	"BOUNDARY"},		\
> +	{ EXTENT_NODATASUM,	"NODATASUM"},		\
> +	{ EXTENT_CLEAR_META_RESV,"CLEAR_META_RSV"},	\
> +	{ EXTENT_FIRST_DELALLOC,"FIRST_DELALLOC"},	\
> +	{ EXTENT_NEED_WAIT,	"NEED_WAIT"},		\
> +	{ EXTENT_DAMAGED,	"DAMAGED"},		\
> +	{ EXTENT_NORESERVE,	"NORESERVE"},		\
> +	{ EXTENT_QGROUP_RESERVED,"QGROUP_RESERVED"},	\
> +	{ EXTENT_CLEAR_DATA_RESV,"CLEAR_DATA_RESV"},	\
> +	{ EXTENT_DELALLOC_NEW,	"DELALLOC_NEW"}

and there, the maximum line width is 80 and there's enough space.

> +
>  #define BTRFS_FSID_SIZE 16
>  #define TP_STRUCT__entry_fsid __array(u8, fsid, BTRFS_FSID_SIZE)
>  
> @@ -1878,6 +1909,126 @@ DEFINE_EVENT(btrfs__block_group, btrfs_skip_unused_block_group,
>  	TP_ARGS(bg_cache)
>  );
>  
> +TRACE_EVENT(btrfs_set_extent_bit,
> +	TP_PROTO(const struct extent_io_tree *tree,
> +		 u64 start, u64 len, unsigned set_bits),
> +
> +	TP_ARGS(tree, start, len, set_bits),
> +
> +	TP_STRUCT__entry(
> +		__field(	unsigned,	owner	)
> +		__field(	u64,		ino	)
> +		__field(	u64,		rootid	)
> +		__field(	u64,		start	)
> +		__field(	u64,		len	)
> +		__field(	unsigned,	set_bits)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->owner	= tree->owner;
> +		if (tree->private_data) {
> +			struct inode *inode = tree->private_data;
> +
> +			__entry->ino	= inode->i_ino;

Don't use raw i_ino but btrfs_ino

> +			__entry->rootid	=
> +				BTRFS_I(inode)->root->root_key.objectid;
> +		} else {
> +			__entry->ino	= 0;
> +			__entry->rootid	= 0;
> +		}
> +		__entry->start		= start;
> +		__entry->len		= len;
> +		__entry->set_bits	= set_bits;
> +	),

  reply	other threads:[~2019-02-28 15:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-28 10:02 [PATCH 0/2] btrfs: trace: Add trace events for extent_io_tree Qu Wenruo
2019-02-28 10:02 ` [PATCH 1/2] btrfs: Introduce extent_io_tree::owner to distinguish different io_trees Qu Wenruo
2019-02-28 15:32   ` David Sterba
2019-02-28 10:02 ` [PATCH 2/2] btrfs: trace: Add trace events for extent_io_tree Qu Wenruo
2019-02-28 15:24   ` David Sterba [this message]
2019-02-28 13:51 ` [PATCH 0/2] " David Sterba
2019-02-28 13:56   ` Qu Wenruo

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=20190228152419.GH31119@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.