public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: record whichfork in iext tracepoints
@ 2018-01-10 21:50 Darrick J. Wong
  2018-01-11 12:04 ` Brian Foster
  0 siblings, 1 reply; 3+ messages in thread
From: Darrick J. Wong @ 2018-01-10 21:50 UTC (permalink / raw)
  To: xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Record the whichfork number of the fork being operated on in iext
tracepoints.  This makes it easier to trace our way through complex
remapping operations like copy on write.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_trace.h |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index cd87985..1c38b79 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -233,6 +233,7 @@ DECLARE_EVENT_CLASS(xfs_bmap_class,
 		__field(xfs_exntst_t, state)
 		__field(int, bmap_state)
 		__field(unsigned long, caller_ip)
+		__field(int, whichfork)
 	),
 	TP_fast_assign(
 		struct xfs_ifork	*ifp;
@@ -250,11 +251,19 @@ DECLARE_EVENT_CLASS(xfs_bmap_class,
 		__entry->state = r.br_state;
 		__entry->bmap_state = state;
 		__entry->caller_ip = caller_ip;
-	),
-	TP_printk("dev %d:%d ino 0x%llx state %s cur 0x%p/%d "
+		if (ifp == XFS_IFORK_PTR(ip, XFS_DATA_FORK))
+			__entry->whichfork = XFS_DATA_FORK;
+		else if (ifp == XFS_IFORK_PTR(ip, XFS_ATTR_FORK))
+			__entry->whichfork = XFS_ATTR_FORK;
+		else if (ifp == XFS_IFORK_PTR(ip, XFS_COW_FORK))
+			__entry->whichfork = XFS_COW_FORK;
+		else
+			__entry->whichfork = -1;
+	),
+	TP_printk("dev %d:%d ino 0x%llx fork %d state %s cur 0x%p/%d "
 		  "offset %lld block %lld count %lld flag %d caller %ps",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
-		  __entry->ino,
+		  __entry->ino, __entry->whichfork,
 		  __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
 		  __entry->leaf,
 		  __entry->pos,

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs: record whichfork in iext tracepoints
  2018-01-10 21:50 [PATCH] xfs: record whichfork in iext tracepoints Darrick J. Wong
@ 2018-01-11 12:04 ` Brian Foster
  2018-01-11 17:07   ` Darrick J. Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Foster @ 2018-01-11 12:04 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: xfs

On Wed, Jan 10, 2018 at 01:50:03PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Record the whichfork number of the fork being operated on in iext
> tracepoints.  This makes it easier to trace our way through complex
> remapping operations like copy on write.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  fs/xfs/xfs_trace.h |   15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
> index cd87985..1c38b79 100644
> --- a/fs/xfs/xfs_trace.h
> +++ b/fs/xfs/xfs_trace.h
> @@ -233,6 +233,7 @@ DECLARE_EVENT_CLASS(xfs_bmap_class,
>  		__field(xfs_exntst_t, state)
>  		__field(int, bmap_state)
>  		__field(unsigned long, caller_ip)
> +		__field(int, whichfork)
>  	),
>  	TP_fast_assign(
>  		struct xfs_ifork	*ifp;
> @@ -250,11 +251,19 @@ DECLARE_EVENT_CLASS(xfs_bmap_class,
>  		__entry->state = r.br_state;
>  		__entry->bmap_state = state;
>  		__entry->caller_ip = caller_ip;
> -	),
> -	TP_printk("dev %d:%d ino 0x%llx state %s cur 0x%p/%d "
> +		if (ifp == XFS_IFORK_PTR(ip, XFS_DATA_FORK))
> +			__entry->whichfork = XFS_DATA_FORK;
> +		else if (ifp == XFS_IFORK_PTR(ip, XFS_ATTR_FORK))
> +			__entry->whichfork = XFS_ATTR_FORK;
> +		else if (ifp == XFS_IFORK_PTR(ip, XFS_COW_FORK))
> +			__entry->whichfork = XFS_COW_FORK;
> +		else
> +			__entry->whichfork = -1;
> +	),
> +	TP_printk("dev %d:%d ino 0x%llx fork %d state %s cur 0x%p/%d "
>  		  "offset %lld block %lld count %lld flag %d caller %ps",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
> -		  __entry->ino,
> +		  __entry->ino, __entry->whichfork,
>  		  __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),

Doesn't ->bmap_state include this information? Looks like attr/cow
strings are included in the EXT_FLAGS list as well.

Brian

>  		  __entry->leaf,
>  		  __entry->pos,
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs: record whichfork in iext tracepoints
  2018-01-11 12:04 ` Brian Foster
@ 2018-01-11 17:07   ` Darrick J. Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2018-01-11 17:07 UTC (permalink / raw)
  To: Brian Foster; +Cc: xfs

On Thu, Jan 11, 2018 at 07:04:04AM -0500, Brian Foster wrote:
> On Wed, Jan 10, 2018 at 01:50:03PM -0800, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > Record the whichfork number of the fork being operated on in iext
> > tracepoints.  This makes it easier to trace our way through complex
> > remapping operations like copy on write.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  fs/xfs/xfs_trace.h |   15 ++++++++++++---
> >  1 file changed, 12 insertions(+), 3 deletions(-)
> > 
> > diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
> > index cd87985..1c38b79 100644
> > --- a/fs/xfs/xfs_trace.h
> > +++ b/fs/xfs/xfs_trace.h
> > @@ -233,6 +233,7 @@ DECLARE_EVENT_CLASS(xfs_bmap_class,
> >  		__field(xfs_exntst_t, state)
> >  		__field(int, bmap_state)
> >  		__field(unsigned long, caller_ip)
> > +		__field(int, whichfork)
> >  	),
> >  	TP_fast_assign(
> >  		struct xfs_ifork	*ifp;
> > @@ -250,11 +251,19 @@ DECLARE_EVENT_CLASS(xfs_bmap_class,
> >  		__entry->state = r.br_state;
> >  		__entry->bmap_state = state;
> >  		__entry->caller_ip = caller_ip;
> > -	),
> > -	TP_printk("dev %d:%d ino 0x%llx state %s cur 0x%p/%d "
> > +		if (ifp == XFS_IFORK_PTR(ip, XFS_DATA_FORK))
> > +			__entry->whichfork = XFS_DATA_FORK;
> > +		else if (ifp == XFS_IFORK_PTR(ip, XFS_ATTR_FORK))
> > +			__entry->whichfork = XFS_ATTR_FORK;
> > +		else if (ifp == XFS_IFORK_PTR(ip, XFS_COW_FORK))
> > +			__entry->whichfork = XFS_COW_FORK;
> > +		else
> > +			__entry->whichfork = -1;
> > +	),
> > +	TP_printk("dev %d:%d ino 0x%llx fork %d state %s cur 0x%p/%d "
> >  		  "offset %lld block %lld count %lld flag %d caller %ps",
> >  		  MAJOR(__entry->dev), MINOR(__entry->dev),
> > -		  __entry->ino,
> > +		  __entry->ino, __entry->whichfork,
> >  		  __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
> 
> Doesn't ->bmap_state include this information? Looks like attr/cow
> strings are included in the EXT_FLAGS list as well.

Aha, that's why it wasn't printing DATA for data fork updates.  Silly me.
Sorry for the noise. :/

--D

> Brian
> 
> >  		  __entry->leaf,
> >  		  __entry->pos,
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-11 17:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-10 21:50 [PATCH] xfs: record whichfork in iext tracepoints Darrick J. Wong
2018-01-11 12:04 ` Brian Foster
2018-01-11 17:07   ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox