linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Cc: linux-xfs@vger.kernel.org, John Garry <john.g.garry@oracle.com>,
	ojaswin@linux.ibm.com, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 2/2] iomap: trace: Add missing flags to [IOMAP_|IOMAP_F_]FLAGS_STRINGS
Date: Mon, 7 Apr 2025 11:48:51 -0700	[thread overview]
Message-ID: <20250407184851.GF6266@frogsfrogsfrogs> (raw)
In-Reply-To: <bf67e3e6af1cdc3c6cba83e204f440db1cbfda24.1743691371.git.ritesh.list@gmail.com>

On Thu, Apr 03, 2025 at 11:52:28PM +0530, Ritesh Harjani (IBM) wrote:
> This adds missing iomap flags to IOMAP_FLAGS_STRINGS &
> IOMAP_F_FLAGS_STRINGS for tracing. While we are at it, let's also print
> values of iomap->type & iomap->flags.
> 
> e.g. trace for ATOMIC_BIO flag set
> xfs_io-1203    [000] .....   183.001559: iomap_iter_dstmap: dev 8:32 ino 0xc bdev 8:32 addr 0x84200000 offset 0x0 length 0x10000 type MAPPED (0x2) flags DIRTY|ATOMIC_BIO (0x102)
> 
> e.g. trace with DONTCACHE flag set
> xfs_io-1110    [007] .....   238.780532: iomap_iter: dev 8:16 ino 0x83 pos 0x1000 length 0x1000 status 0 flags WRITE|DONTCACHE (0x401) ops xfs_buffered_write_iomap_ops caller iomap_file_buffered_write+0xab/0x0
> 
> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

Seems reasonable to me
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  fs/iomap/trace.h | 27 +++++++++++++++++++++------
>  1 file changed, 21 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/iomap/trace.h b/fs/iomap/trace.h
> index 9eab2c8ac3c5..455cc6f90be0 100644
> --- a/fs/iomap/trace.h
> +++ b/fs/iomap/trace.h
> @@ -99,7 +99,11 @@ DEFINE_RANGE_EVENT(iomap_dio_rw_queued);
>  	{ IOMAP_FAULT,		"FAULT" }, \
>  	{ IOMAP_DIRECT,		"DIRECT" }, \
>  	{ IOMAP_NOWAIT,		"NOWAIT" }, \
> -	{ IOMAP_ATOMIC,		"ATOMIC" }
> +	{ IOMAP_OVERWRITE_ONLY,	"OVERWRITE_ONLY" }, \
> +	{ IOMAP_UNSHARE,	"UNSHARE" }, \
> +	{ IOMAP_DAX,		"DAX" }, \
> +	{ IOMAP_ATOMIC,		"ATOMIC" }, \
> +	{ IOMAP_DONTCACHE,	"DONTCACHE" }
> 
>  #define IOMAP_F_FLAGS_STRINGS \
>  	{ IOMAP_F_NEW,		"NEW" }, \
> @@ -107,7 +111,14 @@ DEFINE_RANGE_EVENT(iomap_dio_rw_queued);
>  	{ IOMAP_F_SHARED,	"SHARED" }, \
>  	{ IOMAP_F_MERGED,	"MERGED" }, \
>  	{ IOMAP_F_BUFFER_HEAD,	"BH" }, \
> -	{ IOMAP_F_SIZE_CHANGED,	"SIZE_CHANGED" }
> +	{ IOMAP_F_XATTR,	"XATTR" }, \
> +	{ IOMAP_F_BOUNDARY,	"BOUNDARY" }, \
> +	{ IOMAP_F_ANON_WRITE,	"ANON_WRITE" }, \
> +	{ IOMAP_F_ATOMIC_BIO,	"ATOMIC_BIO" }, \
> +	{ IOMAP_F_PRIVATE,	"PRIVATE" }, \
> +	{ IOMAP_F_SIZE_CHANGED,	"SIZE_CHANGED" }, \
> +	{ IOMAP_F_STALE,	"STALE" }
> +
> 
>  #define IOMAP_DIO_STRINGS \
>  	{IOMAP_DIO_FORCE_WAIT,	"DIO_FORCE_WAIT" }, \
> @@ -138,7 +149,7 @@ DECLARE_EVENT_CLASS(iomap_class,
>  		__entry->bdev = iomap->bdev ? iomap->bdev->bd_dev : 0;
>  	),
>  	TP_printk("dev %d:%d ino 0x%llx bdev %d:%d addr 0x%llx offset 0x%llx "
> -		  "length 0x%llx type %s flags %s",
> +		  "length 0x%llx type %s (0x%x) flags %s (0x%x)",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
>  		  __entry->ino,
>  		  MAJOR(__entry->bdev), MINOR(__entry->bdev),
> @@ -146,7 +157,9 @@ DECLARE_EVENT_CLASS(iomap_class,
>  		  __entry->offset,
>  		  __entry->length,
>  		  __print_symbolic(__entry->type, IOMAP_TYPE_STRINGS),
> -		  __print_flags(__entry->flags, "|", IOMAP_F_FLAGS_STRINGS))
> +		  __entry->type,
> +		  __print_flags(__entry->flags, "|", IOMAP_F_FLAGS_STRINGS),
> +		  __entry->flags)
>  )
> 
>  #define DEFINE_IOMAP_EVENT(name)		\
> @@ -185,7 +198,7 @@ TRACE_EVENT(iomap_writepage_map,
>  		__entry->bdev = iomap->bdev ? iomap->bdev->bd_dev : 0;
>  	),
>  	TP_printk("dev %d:%d ino 0x%llx bdev %d:%d pos 0x%llx dirty len 0x%llx "
> -		  "addr 0x%llx offset 0x%llx length 0x%llx type %s flags %s",
> +		  "addr 0x%llx offset 0x%llx length 0x%llx type %s (0x%x) flags %s (0x%x)",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
>  		  __entry->ino,
>  		  MAJOR(__entry->bdev), MINOR(__entry->bdev),
> @@ -195,7 +208,9 @@ TRACE_EVENT(iomap_writepage_map,
>  		  __entry->offset,
>  		  __entry->length,
>  		  __print_symbolic(__entry->type, IOMAP_TYPE_STRINGS),
> -		  __print_flags(__entry->flags, "|", IOMAP_F_FLAGS_STRINGS))
> +		  __entry->type,
> +		  __print_flags(__entry->flags, "|", IOMAP_F_FLAGS_STRINGS),
> +		  __entry->flags)
>  );
> 
>  TRACE_EVENT(iomap_iter,
> --
> 2.48.1
> 
> 

  reply	other threads:[~2025-04-07 18:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03 18:22 [PATCH 1/2] Documentation: iomap: Add missing flags description Ritesh Harjani (IBM)
2025-04-03 18:22 ` [PATCH 2/2] iomap: trace: Add missing flags to [IOMAP_|IOMAP_F_]FLAGS_STRINGS Ritesh Harjani (IBM)
2025-04-07 18:48   ` Darrick J. Wong [this message]
2025-04-04  9:36 ` [PATCH 1/2] Documentation: iomap: Add missing flags description John Garry
2025-04-04 10:23   ` Ritesh Harjani
2025-04-07  8:45     ` John Garry
2025-04-07 16:37       ` Darrick J. Wong
2025-04-07  8:50   ` Christoph Hellwig
2025-04-07 16:43     ` Darrick J. Wong
2025-04-07 16:17   ` Darrick J. Wong
2025-04-07 16:25 ` Darrick J. Wong
2025-04-07 18:30   ` Ritesh Harjani

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=20250407184851.GF6266@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=john.g.garry@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=ritesh.list@gmail.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;
as well as URLs for NNTP newsgroup(s).