linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: djwong@kernel.org, david@fromorbit.com, sandeen@sandeen.net
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 12/15] xfs: resolve fork names in trace output
Date: Tue, 17 Aug 2021 16:43:18 -0700	[thread overview]
Message-ID: <162924379815.761813.4507794744090240998.stgit@magnolia> (raw)
In-Reply-To: <162924373176.761813.10896002154570305865.stgit@magnolia>

From: Darrick J. Wong <djwong@kernel.org>

Emit whichfork values as text strings in the ftrace output.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 fs/xfs/libxfs/xfs_types.h |    5 +++++
 fs/xfs/scrub/trace.h      |   16 ++++++++--------
 fs/xfs/xfs_trace.h        |    6 +++---
 3 files changed, 16 insertions(+), 11 deletions(-)


diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h
index 0870ef6f933d..b6da06b40989 100644
--- a/fs/xfs/libxfs/xfs_types.h
+++ b/fs/xfs/libxfs/xfs_types.h
@@ -87,6 +87,11 @@ typedef void *		xfs_failaddr_t;
 #define	XFS_ATTR_FORK	1
 #define	XFS_COW_FORK	2
 
+#define XFS_WHICHFORK_STRINGS \
+	{ XFS_DATA_FORK, 	"data" }, \
+	{ XFS_ATTR_FORK,	"attr" }, \
+	{ XFS_COW_FORK,		"cow" }
+
 /*
  * Min numbers of data/attr fork btree root pointers.
  */
diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
index cb5a74028b63..36f86b1497f4 100644
--- a/fs/xfs/scrub/trace.h
+++ b/fs/xfs/scrub/trace.h
@@ -176,10 +176,10 @@ TRACE_EVENT(xchk_file_op_error,
 		__entry->error = error;
 		__entry->ret_ip = ret_ip;
 	),
-	TP_printk("dev %d:%d ino 0x%llx fork %d type %s fileoff 0x%llx error %d ret_ip %pS",
+	TP_printk("dev %d:%d ino 0x%llx fork %s type %s fileoff 0x%llx error %d ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->ino,
-		  __entry->whichfork,
+		  __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __entry->offset,
 		  __entry->error,
@@ -273,10 +273,10 @@ DECLARE_EVENT_CLASS(xchk_fblock_error_class,
 		__entry->offset = offset;
 		__entry->ret_ip = ret_ip;
 	),
-	TP_printk("dev %d:%d ino 0x%llx fork %d type %s fileoff 0x%llx ret_ip %pS",
+	TP_printk("dev %d:%d ino 0x%llx fork %s type %s fileoff 0x%llx ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->ino,
-		  __entry->whichfork,
+		  __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __entry->offset,
 		  __entry->ret_ip)
@@ -381,10 +381,10 @@ TRACE_EVENT(xchk_ifork_btree_op_error,
 		__entry->error = error;
 		__entry->ret_ip = ret_ip;
 	),
-	TP_printk("dev %d:%d ino 0x%llx fork %d type %s btree %s level %d ptr %d agno 0x%x agbno 0x%x error %d ret_ip %pS",
+	TP_printk("dev %d:%d ino 0x%llx fork %s type %s btree %s level %d ptr %d agno 0x%x agbno 0x%x error %d ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->ino,
-		  __entry->whichfork,
+		  __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
 		  __entry->level,
@@ -460,10 +460,10 @@ TRACE_EVENT(xchk_ifork_btree_error,
 		__entry->ptr = cur->bc_ptrs[level];
 		__entry->ret_ip = ret_ip;
 	),
-	TP_printk("dev %d:%d ino 0x%llx fork %d type %s btree %s level %d ptr %d agno 0x%x agbno 0x%x ret_ip %pS",
+	TP_printk("dev %d:%d ino 0x%llx fork %s type %s btree %s level %d ptr %d agno 0x%x agbno 0x%x ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->ino,
-		  __entry->whichfork,
+		  __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
 		  __entry->level,
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 29bf5fbfa71b..474fdaffdccf 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -1440,7 +1440,7 @@ DECLARE_EVENT_CLASS(xfs_imap_class,
 		  __entry->size,
 		  __entry->offset,
 		  __entry->count,
-		  __entry->whichfork == XFS_COW_FORK ? "cow" : "data",
+		  __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
 		  __entry->startoff,
 		  (int64_t)__entry->startblock,
 		  __entry->blockcount)
@@ -2604,7 +2604,7 @@ DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
 		  __entry->agno,
 		  __entry->agbno,
 		  __entry->ino,
-		  __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
+		  __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
 		  __entry->l_loff,
 		  __entry->l_len,
 		  __entry->l_state)
@@ -3851,7 +3851,7 @@ TRACE_EVENT(xfs_btree_commit_ifakeroot,
 		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
 		  __entry->agno,
 		  __entry->agino,
-		  __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
+		  __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
 		  __entry->levels,
 		  __entry->blocks)
 )


  parent reply	other threads:[~2021-08-17 23:43 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17 23:42 [PATCHSET 00/15] xfs: clean up ftrace field tags and formats Darrick J. Wong
2021-08-17 23:42 ` [PATCH 01/15] xfs: fix incorrect unit conversion in scrub tracepoint Darrick J. Wong
2021-08-19  2:29   ` Dave Chinner
2021-08-19  7:57   ` Carlos Maiolino
2021-08-17 23:42 ` [PATCH 02/15] xfs: standardize inode number formatting in ftrace output Darrick J. Wong
2021-08-19  2:34   ` Dave Chinner
2021-08-19  8:27   ` Carlos Maiolino
2021-08-17 23:42 ` [PATCH 03/15] xfs: standardize AG " Darrick J. Wong
2021-08-19  2:35   ` Dave Chinner
2021-08-19  8:45   ` Carlos Maiolino
2021-08-17 23:42 ` [PATCH 04/15] xfs: standardize AG block " Darrick J. Wong
2021-08-19  2:37   ` Dave Chinner
2021-08-19  9:06   ` Carlos Maiolino
2021-08-17 23:42 ` [PATCH 05/15] xfs: standardize rmap owner " Darrick J. Wong
2021-08-19  2:38   ` Dave Chinner
2021-08-19  9:57   ` Carlos Maiolino
2021-08-17 23:42 ` [PATCH 06/15] xfs: standardize daddr " Darrick J. Wong
2021-08-19  2:42   ` Dave Chinner
2021-08-19 11:02   ` Carlos Maiolino
2021-08-17 23:42 ` [PATCH 07/15] xfs: disambiguate units for ftrace fields tagged "blkno", "block", or "bno" Darrick J. Wong
2021-08-19  2:47   ` Dave Chinner
2021-08-19 11:12   ` Carlos Maiolino
2021-08-17 23:42 ` [PATCH 08/15] xfs: disambiguate units for ftrace fields tagged "offset" Darrick J. Wong
2021-08-19  2:51   ` Dave Chinner
2021-08-19 11:45     ` Carlos Maiolino
2021-08-19 11:42   ` Carlos Maiolino
2021-08-17 23:43 ` [PATCH 09/15] xfs: disambiguate units for ftrace fields tagged "len" Darrick J. Wong
2021-08-19  3:01   ` Dave Chinner
2021-08-19  3:06     ` Darrick J. Wong
2021-08-19  3:44   ` [PATCH v2 " Darrick J. Wong
2021-08-19 12:08     ` Carlos Maiolino
2021-08-17 23:43 ` [PATCH 10/15] xfs: disambiguate units for ftrace fields tagged "count" Darrick J. Wong
2021-08-19  3:11   ` Dave Chinner
2021-08-19  3:19     ` Darrick J. Wong
2021-08-19  3:45   ` [PATCH v2 " Darrick J. Wong
2021-08-19  5:38     ` Dave Chinner
2021-08-19 12:26     ` Carlos Maiolino
2021-08-17 23:43 ` [PATCH 11/15] xfs: rename i_disk_size fields in ftrace output Darrick J. Wong
2021-08-19  3:14   ` Dave Chinner
2021-08-19 12:32   ` Carlos Maiolino
2021-08-17 23:43 ` Darrick J. Wong [this message]
2021-08-19  3:16   ` [PATCH 12/15] xfs: resolve fork names in trace output Dave Chinner
2021-08-19 12:43   ` Carlos Maiolino
2021-08-17 23:43 ` [PATCH 13/15] xfs: standardize remaining xfs_buf length tracepoints Darrick J. Wong
2021-08-19  3:19   ` Dave Chinner
2021-08-19 12:48   ` Carlos Maiolino
2021-08-17 23:43 ` [PATCH 14/15] xfs: standardize inode generation formatting in ftrace output Darrick J. Wong
2021-08-19  3:19   ` Dave Chinner
2021-08-19 12:57   ` Carlos Maiolino
2021-08-17 23:43 ` [PATCH 15/15] xfs: decode scrub flags " Darrick J. Wong
2021-08-19  3:20   ` Dave Chinner
2021-08-19 13:04   ` Carlos Maiolino
2021-08-19  3:07 ` [PATCH 16/15] xfs: start documenting common units and tags used in tracepoints Darrick J. Wong
2021-08-19  3:24   ` Dave Chinner
2021-08-19  3:46   ` [PATCH v2 " Darrick J. Wong
2021-08-19  5:39     ` Dave Chinner
2021-08-19 13:27     ` Carlos Maiolino
2021-08-19 17:06       ` Darrick J. Wong
2021-08-19 17:10     ` [PATCH v3 " Darrick J. Wong

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=162924379815.761813.4507794744090240998.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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).