All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] xfs: ftrace cleanups
@ 2018-12-18 20:39 Darrick J. Wong
  2018-12-18 20:39 ` [PATCH 1/6] xfs: fix function pointer type in ftrace format Darrick J. Wong
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Darrick J. Wong @ 2018-12-18 20:39 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, sandeen

Hi all,

This series fixes symbolic decoding in ftrace tracepoints in xfs, and
introduces decoding of xfs_btnum_t and scrub types.

The first four patches fix some problems with the current ftrace usage
so that symbolic decoding of enum -> string mappings works again, and
fixes function pointer printing.

The two patches after that add symbolic decoding to btree cursor types
and scrub types.

If you're going to start using this mess, you probably ought to just
pull from my git trees.  The kernel patches[1] should apply against
4.20-rc6.  There's little change since the last version except for
improving comments about TRACE_DEFINE_ENUM.

Comments and questions are, as always, welcome.

--D

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

* [PATCH 1/6] xfs: fix function pointer type in ftrace format
  2018-12-18 20:39 [PATCH v2 0/6] xfs: ftrace cleanups Darrick J. Wong
@ 2018-12-18 20:39 ` Darrick J. Wong
  2018-12-18 20:39 ` [PATCH 2/6] xfs: fix symbolic enum printing in ftrace output Darrick J. Wong
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Darrick J. Wong @ 2018-12-18 20:39 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, Eric Sandeen, sandeen

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

Use %pS instead of %pF in ftrace strings so that we record the actual
function address instead of the function descriptor.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
---
 fs/xfs/scrub/trace.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
index f1c144c6dcc5..d67e915cf91a 100644
--- a/fs/xfs/scrub/trace.h
+++ b/fs/xfs/scrub/trace.h
@@ -473,7 +473,7 @@ TRACE_EVENT(xchk_xref_error,
 		__entry->error = error;
 		__entry->ret_ip = ret_ip;
 	),
-	TP_printk("dev %d:%d type %u xref error %d ret_ip %pF",
+	TP_printk("dev %d:%d type %u xref error %d ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->type,
 		  __entry->error,

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

* [PATCH 2/6] xfs: fix symbolic enum printing in ftrace output
  2018-12-18 20:39 [PATCH v2 0/6] xfs: ftrace cleanups Darrick J. Wong
  2018-12-18 20:39 ` [PATCH 1/6] xfs: fix function pointer type in ftrace format Darrick J. Wong
@ 2018-12-18 20:39 ` Darrick J. Wong
  2018-12-18 20:39 ` [PATCH 3/6] xfs: move XFS_AG_BTREE_CMP_FORMAT_STR mappings to libxfs Darrick J. Wong
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Darrick J. Wong @ 2018-12-18 20:39 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, Eric Sandeen, sandeen

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

ftrace's __print_symbolic() has a (very poorly documented) requirement
that any enum values used in the symbol to string translation table be
wrapped in a TRACE_DEFINE_ENUM so that the enum value can be encoded in
the ftrace ring buffer.  Fix this unsatisfied requirement.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
---
 fs/xfs/libxfs/xfs_types.h |    4 ++++
 fs/xfs/xfs_aops.h         |    3 +++
 fs/xfs/xfs_trace.h        |   19 +++++++++++++++++++
 3 files changed, 26 insertions(+)


diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h
index 05e8fa558f3e..e03508a650c4 100644
--- a/fs/xfs/libxfs/xfs_types.h
+++ b/fs/xfs/libxfs/xfs_types.h
@@ -100,6 +100,10 @@ typedef void *		xfs_failaddr_t;
  */
 #define MAXNAMELEN	256
 
+/*
+ * This enum is used in string mapping in xfs_trace.h; please keep the
+ * TRACE_DEFINE_ENUMs for it up to date.
+ */
 typedef enum {
 	XFS_LOOKUP_EQi, XFS_LOOKUP_LEi, XFS_LOOKUP_GEi
 } xfs_lookup_t;
diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h
index 494b4338446e..e5c23948a8ab 100644
--- a/fs/xfs/xfs_aops.h
+++ b/fs/xfs/xfs_aops.h
@@ -10,6 +10,9 @@ extern struct bio_set xfs_ioend_bioset;
 
 /*
  * Types of I/O for bmap clustering and I/O completion tracking.
+ *
+ * This enum is used in string mapping in xfs_trace.h; please keep the
+ * TRACE_DEFINE_ENUMs for it up to date.
  */
 enum {
 	XFS_IO_HOLE,		/* covers region without any block allocation */
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index cabe5c8010b0..deac0b3e64c2 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -640,6 +640,16 @@ DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
 DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
 DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
 
+/*
+ * ftrace's __print_symbolic requires that all enum values be wrapped in the
+ * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
+ * ring buffer.  Somehow this was only worth mentioning in the ftrace sample
+ * code.
+ */
+TRACE_DEFINE_ENUM(PE_SIZE_PTE);
+TRACE_DEFINE_ENUM(PE_SIZE_PMD);
+TRACE_DEFINE_ENUM(PE_SIZE_PUD);
+
 TRACE_EVENT(xfs_filemap_fault,
 	TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size,
 		 bool write_fault),
@@ -1208,6 +1218,12 @@ DEFINE_EVENT(xfs_readpage_class, name,	\
 DEFINE_READPAGE_EVENT(xfs_vm_readpage);
 DEFINE_READPAGE_EVENT(xfs_vm_readpages);
 
+TRACE_DEFINE_ENUM(XFS_IO_HOLE);
+TRACE_DEFINE_ENUM(XFS_IO_DELALLOC);
+TRACE_DEFINE_ENUM(XFS_IO_UNWRITTEN);
+TRACE_DEFINE_ENUM(XFS_IO_OVERWRITE);
+TRACE_DEFINE_ENUM(XFS_IO_COW);
+
 DECLARE_EVENT_CLASS(xfs_imap_class,
 	TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
 		 int type, struct xfs_bmbt_irec *irec),
@@ -2610,6 +2626,9 @@ DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
 #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
 
 /* ag btree lookup tracepoint class */
+TRACE_DEFINE_ENUM(XFS_LOOKUP_EQi);
+TRACE_DEFINE_ENUM(XFS_LOOKUP_LEi);
+TRACE_DEFINE_ENUM(XFS_LOOKUP_GEi);
 #define XFS_AG_BTREE_CMP_FORMAT_STR \
 	{ XFS_LOOKUP_EQ,	"eq" }, \
 	{ XFS_LOOKUP_LE,	"le" }, \

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

* [PATCH 3/6] xfs: move XFS_AG_BTREE_CMP_FORMAT_STR mappings to libxfs
  2018-12-18 20:39 [PATCH v2 0/6] xfs: ftrace cleanups Darrick J. Wong
  2018-12-18 20:39 ` [PATCH 1/6] xfs: fix function pointer type in ftrace format Darrick J. Wong
  2018-12-18 20:39 ` [PATCH 2/6] xfs: fix symbolic enum printing in ftrace output Darrick J. Wong
@ 2018-12-18 20:39 ` Darrick J. Wong
  2018-12-18 20:39 ` [PATCH 4/6] xfs: move XFS_INODE_FORMAT_STR " Darrick J. Wong
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Darrick J. Wong @ 2018-12-18 20:39 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, Eric Sandeen, sandeen

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

Move XFS_AG_BTREE_CMP_FORMAT_STR to libxfs so that we don't forget to
keep it updated, and TRACE_DEFINE_ENUM the values while we're at it.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
---
 fs/xfs/libxfs/xfs_types.h |    5 +++++
 fs/xfs/xfs_trace.h        |    4 ----
 2 files changed, 5 insertions(+), 4 deletions(-)


diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h
index e03508a650c4..2b48ff397355 100644
--- a/fs/xfs/libxfs/xfs_types.h
+++ b/fs/xfs/libxfs/xfs_types.h
@@ -108,6 +108,11 @@ typedef enum {
 	XFS_LOOKUP_EQi, XFS_LOOKUP_LEi, XFS_LOOKUP_GEi
 } xfs_lookup_t;
 
+#define XFS_AG_BTREE_CMP_FORMAT_STR \
+	{ XFS_LOOKUP_EQi,	"eq" }, \
+	{ XFS_LOOKUP_LEi,	"le" }, \
+	{ XFS_LOOKUP_GEi,	"ge" }
+
 typedef enum {
 	XFS_BTNUM_BNOi, XFS_BTNUM_CNTi, XFS_BTNUM_RMAPi, XFS_BTNUM_BMAPi,
 	XFS_BTNUM_INOi, XFS_BTNUM_FINOi, XFS_BTNUM_REFCi, XFS_BTNUM_MAX
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index deac0b3e64c2..3f57002ca660 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -2629,10 +2629,6 @@ DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
 TRACE_DEFINE_ENUM(XFS_LOOKUP_EQi);
 TRACE_DEFINE_ENUM(XFS_LOOKUP_LEi);
 TRACE_DEFINE_ENUM(XFS_LOOKUP_GEi);
-#define XFS_AG_BTREE_CMP_FORMAT_STR \
-	{ XFS_LOOKUP_EQ,	"eq" }, \
-	{ XFS_LOOKUP_LE,	"le" }, \
-	{ XFS_LOOKUP_GE,	"ge" }
 DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
 		 xfs_agblock_t agbno, xfs_lookup_t dir),

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

* [PATCH 4/6] xfs: move XFS_INODE_FORMAT_STR mappings to libxfs
  2018-12-18 20:39 [PATCH v2 0/6] xfs: ftrace cleanups Darrick J. Wong
                   ` (2 preceding siblings ...)
  2018-12-18 20:39 ` [PATCH 3/6] xfs: move XFS_AG_BTREE_CMP_FORMAT_STR mappings to libxfs Darrick J. Wong
@ 2018-12-18 20:39 ` Darrick J. Wong
  2018-12-18 20:39 ` [PATCH 5/6] xfs: stringify btree cursor types in ftrace output Darrick J. Wong
  2018-12-18 20:40 ` [PATCH 6/6] xfs: stringify scrub " Darrick J. Wong
  5 siblings, 0 replies; 13+ messages in thread
From: Darrick J. Wong @ 2018-12-18 20:39 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, Eric Sandeen, sandeen

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

Move XFS_INODE_FORMAT_STR to libxfs so that we don't forget to keep it
updated, and add necessary TRACE_DEFINE_ENUM.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
---
 fs/xfs/libxfs/xfs_format.h |   10 ++++++++++
 fs/xfs/xfs_trace.h         |   10 +++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)


diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
index b15412e4c535..9bb3c48843ec 100644
--- a/fs/xfs/libxfs/xfs_format.h
+++ b/fs/xfs/libxfs/xfs_format.h
@@ -916,6 +916,9 @@ static inline uint xfs_dinode_size(int version)
 
 /*
  * Values for di_format
+ *
+ * This enum is used in string mapping in xfs_trace.h; please keep the
+ * TRACE_DEFINE_ENUMs for it up to date.
  */
 typedef enum xfs_dinode_fmt {
 	XFS_DINODE_FMT_DEV,		/* xfs_dev_t */
@@ -925,6 +928,13 @@ typedef enum xfs_dinode_fmt {
 	XFS_DINODE_FMT_UUID		/* added long ago, but never used */
 } xfs_dinode_fmt_t;
 
+#define XFS_INODE_FORMAT_STR \
+	{ XFS_DINODE_FMT_DEV,		"dev" }, \
+	{ XFS_DINODE_FMT_LOCAL,		"local" }, \
+	{ XFS_DINODE_FMT_EXTENTS,	"extent" }, \
+	{ XFS_DINODE_FMT_BTREE,		"btree" }, \
+	{ XFS_DINODE_FMT_UUID,		"uuid" }
+
 /*
  * Inode minimum and maximum sizes.
  */
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 3f57002ca660..94e289aca220 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -1901,11 +1901,11 @@ TRACE_EVENT(xfs_dir2_leafn_moveents,
 	{ 0,	"target" }, \
 	{ 1,	"temp" }
 
-#define XFS_INODE_FORMAT_STR \
-	{ 0,	"invalid" }, \
-	{ 1,	"local" }, \
-	{ 2,	"extent" }, \
-	{ 3,	"btree" }
+TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV);
+TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL);
+TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS);
+TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE);
+TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID);
 
 DECLARE_EVENT_CLASS(xfs_swap_extent_class,
 	TP_PROTO(struct xfs_inode *ip, int which),

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

* [PATCH 5/6] xfs: stringify btree cursor types in ftrace output
  2018-12-18 20:39 [PATCH v2 0/6] xfs: ftrace cleanups Darrick J. Wong
                   ` (3 preceding siblings ...)
  2018-12-18 20:39 ` [PATCH 4/6] xfs: move XFS_INODE_FORMAT_STR " Darrick J. Wong
@ 2018-12-18 20:39 ` Darrick J. Wong
  2018-12-18 20:40 ` [PATCH 6/6] xfs: stringify scrub " Darrick J. Wong
  5 siblings, 0 replies; 13+ messages in thread
From: Darrick J. Wong @ 2018-12-18 20:39 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, Eric Sandeen, sandeen

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

Use __print_symbolic to print the btree type in ftrace output.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
---
 fs/xfs/libxfs/xfs_types.h |   13 +++++++++++++
 fs/xfs/scrub/trace.h      |   38 ++++++++++++++++++++++++++------------
 fs/xfs/xfs_trace.h        |   12 ++++++++++--
 3 files changed, 49 insertions(+), 14 deletions(-)


diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h
index 2b48ff397355..c8dda22e739c 100644
--- a/fs/xfs/libxfs/xfs_types.h
+++ b/fs/xfs/libxfs/xfs_types.h
@@ -113,11 +113,24 @@ typedef enum {
 	{ XFS_LOOKUP_LEi,	"le" }, \
 	{ XFS_LOOKUP_GEi,	"ge" }
 
+/*
+ * This enum is used in string mapping in xfs_trace.h; please keep the
+ * TRACE_DEFINE_ENUMs for it up to date.
+ */
 typedef enum {
 	XFS_BTNUM_BNOi, XFS_BTNUM_CNTi, XFS_BTNUM_RMAPi, XFS_BTNUM_BMAPi,
 	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" }
+
 struct xfs_name {
 	const unsigned char	*name;
 	int			len;
diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
index d67e915cf91a..0141eb1ac091 100644
--- a/fs/xfs/scrub/trace.h
+++ b/fs/xfs/scrub/trace.h
@@ -12,6 +12,20 @@
 #include <linux/tracepoint.h>
 #include "xfs_bit.h"
 
+/*
+ * ftrace's __print_symbolic requires that all enum values be wrapped in the
+ * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
+ * ring buffer.  Somehow this was only worth mentioning in the ftrace sample
+ * code.
+ */
+TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
+TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
+TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
+TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
+TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
+TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
+TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
+
 DECLARE_EVENT_CLASS(xchk_class,
 	TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm,
 		 int error),
@@ -278,10 +292,10 @@ TRACE_EVENT(xchk_btree_op_error,
 		__entry->error = error;
 		__entry->ret_ip = ret_ip;
 	),
-	TP_printk("dev %d:%d type %u btnum %d level %d ptr %d agno %u agbno %u error %d ret_ip %pS",
+	TP_printk("dev %d:%d type %u btree %s level %d ptr %d agno %u agbno %u error %d ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->type,
-		  __entry->btnum,
+		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
 		  __entry->level,
 		  __entry->ptr,
 		  __entry->agno,
@@ -321,12 +335,12 @@ 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 %u btnum %d level %d ptr %d agno %u agbno %u error %d ret_ip %pS",
+	TP_printk("dev %d:%d ino 0x%llx fork %d type %u btree %s level %d ptr %d agno %u agbno %u error %d ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->ino,
 		  __entry->whichfork,
 		  __entry->type,
-		  __entry->btnum,
+		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
 		  __entry->level,
 		  __entry->ptr,
 		  __entry->agno,
@@ -360,10 +374,10 @@ TRACE_EVENT(xchk_btree_error,
 		__entry->ptr = cur->bc_ptrs[level];
 		__entry->ret_ip = ret_ip;
 	),
-	TP_printk("dev %d:%d type %u btnum %d level %d ptr %d agno %u agbno %u ret_ip %pS",
+	TP_printk("dev %d:%d type %u btree %s level %d ptr %d agno %u agbno %u ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->type,
-		  __entry->btnum,
+		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
 		  __entry->level,
 		  __entry->ptr,
 		  __entry->agno,
@@ -400,12 +414,12 @@ 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 %u btnum %d level %d ptr %d agno %u agbno %u ret_ip %pS",
+	TP_printk("dev %d:%d ino 0x%llx fork %d type %u btree %s level %d ptr %d agno %u agbno %u ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->ino,
 		  __entry->whichfork,
 		  __entry->type,
-		  __entry->btnum,
+		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
 		  __entry->level,
 		  __entry->ptr,
 		  __entry->agno,
@@ -439,10 +453,10 @@ DECLARE_EVENT_CLASS(xchk_sbtree_class,
 		__entry->nlevels = cur->bc_nlevels;
 		__entry->ptr = cur->bc_ptrs[level];
 	),
-	TP_printk("dev %d:%d type %u btnum %d agno %u agbno %u level %d nlevels %d ptr %d",
+	TP_printk("dev %d:%d type %u btree %s agno %u agbno %u level %d nlevels %d ptr %d",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->type,
-		  __entry->btnum,
+		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
 		  __entry->agno,
 		  __entry->bno,
 		  __entry->level,
@@ -643,11 +657,11 @@ TRACE_EVENT(xrep_init_btblock,
 		__entry->agbno = agbno;
 		__entry->btnum = btnum;
 	),
-	TP_printk("dev %d:%d agno %u agbno %u btnum %d",
+	TP_printk("dev %d:%d agno %u agbno %u btree %s",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->agno,
 		  __entry->agbno,
-		  __entry->btnum)
+		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS))
 )
 TRACE_EVENT(xrep_findroot_block,
 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 94e289aca220..6fcc893dfc91 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -2194,6 +2194,14 @@ DEFINE_DISCARD_EVENT(xfs_discard_exclude);
 DEFINE_DISCARD_EVENT(xfs_discard_busy);
 
 /* btree cursor events */
+TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
+TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
+TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
+TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
+TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
+TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
+TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
+
 DECLARE_EVENT_CLASS(xfs_btree_cur_class,
 	TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
 	TP_ARGS(cur, level, bp),
@@ -2213,9 +2221,9 @@ DECLARE_EVENT_CLASS(xfs_btree_cur_class,
 		__entry->ptr = cur->bc_ptrs[level];
 		__entry->daddr = bp ? bp->b_bn : -1;
 	),
-	TP_printk("dev %d:%d btnum %d level %d/%d ptr %d daddr 0x%llx",
+	TP_printk("dev %d:%d btree %s level %d/%d ptr %d daddr 0x%llx",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
-		  __entry->btnum,
+		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
 		  __entry->level,
 		  __entry->nlevels,
 		  __entry->ptr,

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

* [PATCH 6/6] xfs: stringify scrub types in ftrace output
  2018-12-18 20:39 [PATCH v2 0/6] xfs: ftrace cleanups Darrick J. Wong
                   ` (4 preceding siblings ...)
  2018-12-18 20:39 ` [PATCH 5/6] xfs: stringify btree cursor types in ftrace output Darrick J. Wong
@ 2018-12-18 20:40 ` Darrick J. Wong
  2018-12-18 20:44   ` Eric Sandeen
  5 siblings, 1 reply; 13+ messages in thread
From: Darrick J. Wong @ 2018-12-18 20:40 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, sandeen

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

Use __print_symbolic to print the scrub type in ftrace output.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_types.h |    4 +-
 fs/xfs/scrub/trace.h      |  103 ++++++++++++++++++++++++++++++++++-----------
 2 files changed, 79 insertions(+), 28 deletions(-)


diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h
index c8dda22e739c..704b4f308780 100644
--- a/fs/xfs/libxfs/xfs_types.h
+++ b/fs/xfs/libxfs/xfs_types.h
@@ -114,8 +114,8 @@ typedef enum {
 	{ XFS_LOOKUP_GEi,	"ge" }
 
 /*
- * This enum is used in string mapping in xfs_trace.h; please keep the
- * TRACE_DEFINE_ENUMs for it up to date.
+ * This enum is used in string mapping in xfs_trace.h and scrub/trace.h;
+ * please keep the TRACE_DEFINE_ENUMs for it up to date.
  */
 typedef enum {
 	XFS_BTNUM_BNOi, XFS_BTNUM_CNTi, XFS_BTNUM_RMAPi, XFS_BTNUM_BMAPi,
diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
index 0141eb1ac091..3c83e8b3b39c 100644
--- a/fs/xfs/scrub/trace.h
+++ b/fs/xfs/scrub/trace.h
@@ -26,6 +26,57 @@ TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
 TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
 TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
 
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PROBE);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_SB);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGF);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGFL);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGI);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BNOBT);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_CNTBT);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_INOBT);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_FINOBT);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RMAPBT);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_REFCNTBT);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_INODE);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTD);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTA);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTC);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_DIR);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_XATTR);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_SYMLINK);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PARENT);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RTBITMAP);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RTSUM);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_UQUOTA);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_GQUOTA);
+TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PQUOTA);
+
+#define XFS_SCRUB_TYPE_STRINGS \
+	{ XFS_SCRUB_TYPE_PROBE,		"probe" }, \
+	{ XFS_SCRUB_TYPE_SB,		"sb" }, \
+	{ XFS_SCRUB_TYPE_AGF,		"agf" }, \
+	{ XFS_SCRUB_TYPE_AGFL,		"agfl" }, \
+	{ XFS_SCRUB_TYPE_AGI,		"agi" }, \
+	{ XFS_SCRUB_TYPE_BNOBT,		"bnobt" }, \
+	{ XFS_SCRUB_TYPE_CNTBT,		"cntbt" }, \
+	{ XFS_SCRUB_TYPE_INOBT,		"inobt" }, \
+	{ XFS_SCRUB_TYPE_FINOBT,	"finobt" }, \
+	{ XFS_SCRUB_TYPE_RMAPBT,	"rmapbt" }, \
+	{ XFS_SCRUB_TYPE_REFCNTBT,	"refcountbt" }, \
+	{ XFS_SCRUB_TYPE_INODE,		"inode" }, \
+	{ XFS_SCRUB_TYPE_BMBTD,		"bmapbtd" }, \
+	{ XFS_SCRUB_TYPE_BMBTA,		"bmapbta" }, \
+	{ XFS_SCRUB_TYPE_BMBTC,		"bmapbtc" }, \
+	{ XFS_SCRUB_TYPE_DIR,		"directory" }, \
+	{ XFS_SCRUB_TYPE_XATTR,		"xattr" }, \
+	{ XFS_SCRUB_TYPE_SYMLINK,	"symlink" }, \
+	{ XFS_SCRUB_TYPE_PARENT,	"parent" }, \
+	{ XFS_SCRUB_TYPE_RTBITMAP,	"rtbitmap" }, \
+	{ XFS_SCRUB_TYPE_RTSUM,		"rtsummary" }, \
+	{ XFS_SCRUB_TYPE_UQUOTA,	"usrquota" }, \
+	{ XFS_SCRUB_TYPE_GQUOTA,	"grpquota" }, \
+	{ XFS_SCRUB_TYPE_PQUOTA,	"prjquota" }
+
 DECLARE_EVENT_CLASS(xchk_class,
 	TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm,
 		 int error),
@@ -50,10 +101,10 @@ DECLARE_EVENT_CLASS(xchk_class,
 		__entry->flags = sm->sm_flags;
 		__entry->error = error;
 	),
-	TP_printk("dev %d:%d ino 0x%llx type %u agno %u inum %llu gen %u flags 0x%x error %d",
+	TP_printk("dev %d:%d ino 0x%llx type %s agno %u inum %llu gen %u flags 0x%x error %d",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->ino,
-		  __entry->type,
+		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __entry->agno,
 		  __entry->inum,
 		  __entry->gen,
@@ -92,9 +143,9 @@ TRACE_EVENT(xchk_op_error,
 		__entry->error = error;
 		__entry->ret_ip = ret_ip;
 	),
-	TP_printk("dev %d:%d type %u agno %u agbno %u error %d ret_ip %pS",
+	TP_printk("dev %d:%d type %s agno %u agbno %u error %d ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
-		  __entry->type,
+		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __entry->agno,
 		  __entry->bno,
 		  __entry->error,
@@ -123,11 +174,11 @@ 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 %u offset %llu error %d ret_ip %pS",
+	TP_printk("dev %d:%d ino 0x%llx fork %d type %s offset %llu error %d ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->ino,
 		  __entry->whichfork,
-		  __entry->type,
+		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __entry->offset,
 		  __entry->error,
 		  __entry->ret_ip)
@@ -158,9 +209,9 @@ DECLARE_EVENT_CLASS(xchk_block_error_class,
 		__entry->bno = bno;
 		__entry->ret_ip = ret_ip;
 	),
-	TP_printk("dev %d:%d type %u agno %u agbno %u ret_ip %pS",
+	TP_printk("dev %d:%d type %s agno %u agbno %u ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
-		  __entry->type,
+		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __entry->agno,
 		  __entry->bno,
 		  __entry->ret_ip)
@@ -190,10 +241,10 @@ DECLARE_EVENT_CLASS(xchk_ino_error_class,
 		__entry->type = sc->sm->sm_type;
 		__entry->ret_ip = ret_ip;
 	),
-	TP_printk("dev %d:%d ino 0x%llx type %u ret_ip %pS",
+	TP_printk("dev %d:%d ino 0x%llx type %s ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->ino,
-		  __entry->type,
+		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __entry->ret_ip)
 )
 
@@ -227,11 +278,11 @@ 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 %u offset %llu ret_ip %pS",
+	TP_printk("dev %d:%d ino 0x%llx fork %d type %s offset %llu ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->ino,
 		  __entry->whichfork,
-		  __entry->type,
+		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __entry->offset,
 		  __entry->ret_ip)
 );
@@ -258,9 +309,9 @@ TRACE_EVENT(xchk_incomplete,
 		__entry->type = sc->sm->sm_type;
 		__entry->ret_ip = ret_ip;
 	),
-	TP_printk("dev %d:%d type %u ret_ip %pS",
+	TP_printk("dev %d:%d type %s ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
-		  __entry->type,
+		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __entry->ret_ip)
 );
 
@@ -292,9 +343,9 @@ TRACE_EVENT(xchk_btree_op_error,
 		__entry->error = error;
 		__entry->ret_ip = ret_ip;
 	),
-	TP_printk("dev %d:%d type %u btree %s level %d ptr %d agno %u agbno %u error %d ret_ip %pS",
+	TP_printk("dev %d:%d type %s btree %s level %d ptr %d agno %u agbno %u error %d ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
-		  __entry->type,
+		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
 		  __entry->level,
 		  __entry->ptr,
@@ -335,11 +386,11 @@ 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 %u btree %s level %d ptr %d agno %u agbno %u error %d ret_ip %pS",
+	TP_printk("dev %d:%d ino 0x%llx fork %d type %s btree %s level %d ptr %d agno %u agbno %u error %d ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->ino,
 		  __entry->whichfork,
-		  __entry->type,
+		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
 		  __entry->level,
 		  __entry->ptr,
@@ -374,9 +425,9 @@ TRACE_EVENT(xchk_btree_error,
 		__entry->ptr = cur->bc_ptrs[level];
 		__entry->ret_ip = ret_ip;
 	),
-	TP_printk("dev %d:%d type %u btree %s level %d ptr %d agno %u agbno %u ret_ip %pS",
+	TP_printk("dev %d:%d type %s btree %s level %d ptr %d agno %u agbno %u ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
-		  __entry->type,
+		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
 		  __entry->level,
 		  __entry->ptr,
@@ -414,11 +465,11 @@ 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 %u btree %s level %d ptr %d agno %u agbno %u ret_ip %pS",
+	TP_printk("dev %d:%d ino 0x%llx fork %d type %s btree %s level %d ptr %d agno %u agbno %u ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->ino,
 		  __entry->whichfork,
-		  __entry->type,
+		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
 		  __entry->level,
 		  __entry->ptr,
@@ -453,9 +504,9 @@ DECLARE_EVENT_CLASS(xchk_sbtree_class,
 		__entry->nlevels = cur->bc_nlevels;
 		__entry->ptr = cur->bc_ptrs[level];
 	),
-	TP_printk("dev %d:%d type %u btree %s agno %u agbno %u level %d nlevels %d ptr %d",
+	TP_printk("dev %d:%d type %s btree %s agno %u agbno %u level %d nlevels %d ptr %d",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
-		  __entry->type,
+		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
 		  __entry->agno,
 		  __entry->bno,
@@ -487,9 +538,9 @@ TRACE_EVENT(xchk_xref_error,
 		__entry->error = error;
 		__entry->ret_ip = ret_ip;
 	),
-	TP_printk("dev %d:%d type %u xref error %d ret_ip %pS",
+	TP_printk("dev %d:%d type %s xref error %d ret_ip %pS",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
-		  __entry->type,
+		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
 		  __entry->error,
 		  __entry->ret_ip)
 );

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

* Re: [PATCH 6/6] xfs: stringify scrub types in ftrace output
  2018-12-18 20:40 ` [PATCH 6/6] xfs: stringify scrub " Darrick J. Wong
@ 2018-12-18 20:44   ` Eric Sandeen
  0 siblings, 0 replies; 13+ messages in thread
From: Eric Sandeen @ 2018-12-18 20:44 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs

On 12/18/18 2:40 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Use __print_symbolic to print the scrub type in ftrace output.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  fs/xfs/libxfs/xfs_types.h |    4 +-
>  fs/xfs/scrub/trace.h      |  103 ++++++++++++++++++++++++++++++++++-----------
>  2 files changed, 79 insertions(+), 28 deletions(-)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h
> index c8dda22e739c..704b4f308780 100644
> --- a/fs/xfs/libxfs/xfs_types.h
> +++ b/fs/xfs/libxfs/xfs_types.h
> @@ -114,8 +114,8 @@ typedef enum {
>  	{ XFS_LOOKUP_GEi,	"ge" }
>  
>  /*
> - * This enum is used in string mapping in xfs_trace.h; please keep the
> - * TRACE_DEFINE_ENUMs for it up to date.
> + * This enum is used in string mapping in xfs_trace.h and scrub/trace.h;
> + * please keep the TRACE_DEFINE_ENUMs for it up to date.
>   */
>  typedef enum {
>  	XFS_BTNUM_BNOi, XFS_BTNUM_CNTi, XFS_BTNUM_RMAPi, XFS_BTNUM_BMAPi,
> diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
> index 0141eb1ac091..3c83e8b3b39c 100644
> --- a/fs/xfs/scrub/trace.h
> +++ b/fs/xfs/scrub/trace.h
> @@ -26,6 +26,57 @@ TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
>  TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
>  TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
>  
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PROBE);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_SB);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGF);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGFL);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGI);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BNOBT);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_CNTBT);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_INOBT);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_FINOBT);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RMAPBT);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_REFCNTBT);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_INODE);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTD);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTA);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTC);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_DIR);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_XATTR);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_SYMLINK);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PARENT);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RTBITMAP);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RTSUM);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_UQUOTA);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_GQUOTA);
> +TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PQUOTA);
> +
> +#define XFS_SCRUB_TYPE_STRINGS \
> +	{ XFS_SCRUB_TYPE_PROBE,		"probe" }, \
> +	{ XFS_SCRUB_TYPE_SB,		"sb" }, \
> +	{ XFS_SCRUB_TYPE_AGF,		"agf" }, \
> +	{ XFS_SCRUB_TYPE_AGFL,		"agfl" }, \
> +	{ XFS_SCRUB_TYPE_AGI,		"agi" }, \
> +	{ XFS_SCRUB_TYPE_BNOBT,		"bnobt" }, \
> +	{ XFS_SCRUB_TYPE_CNTBT,		"cntbt" }, \
> +	{ XFS_SCRUB_TYPE_INOBT,		"inobt" }, \
> +	{ XFS_SCRUB_TYPE_FINOBT,	"finobt" }, \
> +	{ XFS_SCRUB_TYPE_RMAPBT,	"rmapbt" }, \
> +	{ XFS_SCRUB_TYPE_REFCNTBT,	"refcountbt" }, \
> +	{ XFS_SCRUB_TYPE_INODE,		"inode" }, \
> +	{ XFS_SCRUB_TYPE_BMBTD,		"bmapbtd" }, \
> +	{ XFS_SCRUB_TYPE_BMBTA,		"bmapbta" }, \
> +	{ XFS_SCRUB_TYPE_BMBTC,		"bmapbtc" }, \
> +	{ XFS_SCRUB_TYPE_DIR,		"directory" }, \
> +	{ XFS_SCRUB_TYPE_XATTR,		"xattr" }, \
> +	{ XFS_SCRUB_TYPE_SYMLINK,	"symlink" }, \
> +	{ XFS_SCRUB_TYPE_PARENT,	"parent" }, \
> +	{ XFS_SCRUB_TYPE_RTBITMAP,	"rtbitmap" }, \
> +	{ XFS_SCRUB_TYPE_RTSUM,		"rtsummary" }, \
> +	{ XFS_SCRUB_TYPE_UQUOTA,	"usrquota" }, \
> +	{ XFS_SCRUB_TYPE_GQUOTA,	"grpquota" }, \
> +	{ XFS_SCRUB_TYPE_PQUOTA,	"prjquota" }
> +
>  DECLARE_EVENT_CLASS(xchk_class,
>  	TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm,
>  		 int error),
> @@ -50,10 +101,10 @@ DECLARE_EVENT_CLASS(xchk_class,
>  		__entry->flags = sm->sm_flags;
>  		__entry->error = error;
>  	),
> -	TP_printk("dev %d:%d ino 0x%llx type %u agno %u inum %llu gen %u flags 0x%x error %d",
> +	TP_printk("dev %d:%d ino 0x%llx type %s agno %u inum %llu gen %u flags 0x%x error %d",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
>  		  __entry->ino,
> -		  __entry->type,
> +		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
>  		  __entry->agno,
>  		  __entry->inum,
>  		  __entry->gen,
> @@ -92,9 +143,9 @@ TRACE_EVENT(xchk_op_error,
>  		__entry->error = error;
>  		__entry->ret_ip = ret_ip;
>  	),
> -	TP_printk("dev %d:%d type %u agno %u agbno %u error %d ret_ip %pS",
> +	TP_printk("dev %d:%d type %s agno %u agbno %u error %d ret_ip %pS",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
> -		  __entry->type,
> +		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
>  		  __entry->agno,
>  		  __entry->bno,
>  		  __entry->error,
> @@ -123,11 +174,11 @@ 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 %u offset %llu error %d ret_ip %pS",
> +	TP_printk("dev %d:%d ino 0x%llx fork %d type %s offset %llu error %d ret_ip %pS",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
>  		  __entry->ino,
>  		  __entry->whichfork,
> -		  __entry->type,
> +		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
>  		  __entry->offset,
>  		  __entry->error,
>  		  __entry->ret_ip)
> @@ -158,9 +209,9 @@ DECLARE_EVENT_CLASS(xchk_block_error_class,
>  		__entry->bno = bno;
>  		__entry->ret_ip = ret_ip;
>  	),
> -	TP_printk("dev %d:%d type %u agno %u agbno %u ret_ip %pS",
> +	TP_printk("dev %d:%d type %s agno %u agbno %u ret_ip %pS",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
> -		  __entry->type,
> +		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
>  		  __entry->agno,
>  		  __entry->bno,
>  		  __entry->ret_ip)
> @@ -190,10 +241,10 @@ DECLARE_EVENT_CLASS(xchk_ino_error_class,
>  		__entry->type = sc->sm->sm_type;
>  		__entry->ret_ip = ret_ip;
>  	),
> -	TP_printk("dev %d:%d ino 0x%llx type %u ret_ip %pS",
> +	TP_printk("dev %d:%d ino 0x%llx type %s ret_ip %pS",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
>  		  __entry->ino,
> -		  __entry->type,
> +		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
>  		  __entry->ret_ip)
>  )
>  
> @@ -227,11 +278,11 @@ 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 %u offset %llu ret_ip %pS",
> +	TP_printk("dev %d:%d ino 0x%llx fork %d type %s offset %llu ret_ip %pS",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
>  		  __entry->ino,
>  		  __entry->whichfork,
> -		  __entry->type,
> +		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
>  		  __entry->offset,
>  		  __entry->ret_ip)
>  );
> @@ -258,9 +309,9 @@ TRACE_EVENT(xchk_incomplete,
>  		__entry->type = sc->sm->sm_type;
>  		__entry->ret_ip = ret_ip;
>  	),
> -	TP_printk("dev %d:%d type %u ret_ip %pS",
> +	TP_printk("dev %d:%d type %s ret_ip %pS",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
> -		  __entry->type,
> +		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
>  		  __entry->ret_ip)
>  );
>  
> @@ -292,9 +343,9 @@ TRACE_EVENT(xchk_btree_op_error,
>  		__entry->error = error;
>  		__entry->ret_ip = ret_ip;
>  	),
> -	TP_printk("dev %d:%d type %u btree %s level %d ptr %d agno %u agbno %u error %d ret_ip %pS",
> +	TP_printk("dev %d:%d type %s btree %s level %d ptr %d agno %u agbno %u error %d ret_ip %pS",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
> -		  __entry->type,
> +		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
>  		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
>  		  __entry->level,
>  		  __entry->ptr,
> @@ -335,11 +386,11 @@ 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 %u btree %s level %d ptr %d agno %u agbno %u error %d ret_ip %pS",
> +	TP_printk("dev %d:%d ino 0x%llx fork %d type %s btree %s level %d ptr %d agno %u agbno %u error %d ret_ip %pS",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
>  		  __entry->ino,
>  		  __entry->whichfork,
> -		  __entry->type,
> +		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
>  		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
>  		  __entry->level,
>  		  __entry->ptr,
> @@ -374,9 +425,9 @@ TRACE_EVENT(xchk_btree_error,
>  		__entry->ptr = cur->bc_ptrs[level];
>  		__entry->ret_ip = ret_ip;
>  	),
> -	TP_printk("dev %d:%d type %u btree %s level %d ptr %d agno %u agbno %u ret_ip %pS",
> +	TP_printk("dev %d:%d type %s btree %s level %d ptr %d agno %u agbno %u ret_ip %pS",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
> -		  __entry->type,
> +		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
>  		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
>  		  __entry->level,
>  		  __entry->ptr,
> @@ -414,11 +465,11 @@ 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 %u btree %s level %d ptr %d agno %u agbno %u ret_ip %pS",
> +	TP_printk("dev %d:%d ino 0x%llx fork %d type %s btree %s level %d ptr %d agno %u agbno %u ret_ip %pS",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
>  		  __entry->ino,
>  		  __entry->whichfork,
> -		  __entry->type,
> +		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
>  		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
>  		  __entry->level,
>  		  __entry->ptr,
> @@ -453,9 +504,9 @@ DECLARE_EVENT_CLASS(xchk_sbtree_class,
>  		__entry->nlevels = cur->bc_nlevels;
>  		__entry->ptr = cur->bc_ptrs[level];
>  	),
> -	TP_printk("dev %d:%d type %u btree %s agno %u agbno %u level %d nlevels %d ptr %d",
> +	TP_printk("dev %d:%d type %s btree %s agno %u agbno %u level %d nlevels %d ptr %d",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
> -		  __entry->type,
> +		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
>  		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
>  		  __entry->agno,
>  		  __entry->bno,
> @@ -487,9 +538,9 @@ TRACE_EVENT(xchk_xref_error,
>  		__entry->error = error;
>  		__entry->ret_ip = ret_ip;
>  	),
> -	TP_printk("dev %d:%d type %u xref error %d ret_ip %pS",
> +	TP_printk("dev %d:%d type %s xref error %d ret_ip %pS",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
> -		  __entry->type,
> +		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
>  		  __entry->error,
>  		  __entry->ret_ip)
>  );
> 

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

* Re: [PATCH 4/6] xfs: move XFS_INODE_FORMAT_STR mappings to libxfs
  2018-12-18 17:25   ` Eric Sandeen
@ 2018-12-18 18:35     ` Darrick J. Wong
  0 siblings, 0 replies; 13+ messages in thread
From: Darrick J. Wong @ 2018-12-18 18:35 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

On Tue, Dec 18, 2018 at 11:25:41AM -0600, Eric Sandeen wrote:
> On 11/28/18 5:29 PM, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > Move XFS_INODE_FORMAT_STR to libxfs so that we don't forget to keep it
> > updated, and add necessary TRACE_DEFINE_ENUM.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> 
> ...
> 
> > diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
> > index 3f57002ca660..94e289aca220 100644
> > --- a/fs/xfs/xfs_trace.h
> > +++ b/fs/xfs/xfs_trace.h
> > @@ -1901,11 +1901,11 @@ TRACE_EVENT(xfs_dir2_leafn_moveents,
> >  	{ 0,	"target" }, \
> >  	{ 1,	"temp" }
> 
> ^^^^ that context makes me wonder if we shouldn't move that #define
> as well, and give 0 & 1 some meaningful macro names.  Patch 7/6? :)

Or just combine them into a single tracepoint that emits both inodes.

--D

> -Eric

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

* Re: [PATCH 4/6] xfs: move XFS_INODE_FORMAT_STR mappings to libxfs
  2018-12-18 17:24   ` Eric Sandeen
@ 2018-12-18 18:30     ` Darrick J. Wong
  0 siblings, 0 replies; 13+ messages in thread
From: Darrick J. Wong @ 2018-12-18 18:30 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

On Tue, Dec 18, 2018 at 11:24:45AM -0600, Eric Sandeen wrote:
> On 11/28/18 5:29 PM, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > Move XFS_INODE_FORMAT_STR to libxfs so that we don't forget to keep it
> > updated, and add necessary TRACE_DEFINE_ENUM.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Now that I think of it, just adding a /* for ftrace */ above the #define
> might be nice here and for the others, if you think it's appropriate, but:

Will do, and hopefully nobody else will trip over this silly ftrace bomb.

--D

> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> 
> > ---
> >  fs/xfs/libxfs/xfs_format.h |    7 +++++++
> >  fs/xfs/xfs_trace.h         |   10 +++++-----
> >  2 files changed, 12 insertions(+), 5 deletions(-)
> > 
> > 
> > diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
> > index b15412e4c535..d8902114786d 100644
> > --- a/fs/xfs/libxfs/xfs_format.h
> > +++ b/fs/xfs/libxfs/xfs_format.h
> > @@ -925,6 +925,13 @@ typedef enum xfs_dinode_fmt {
> >  	XFS_DINODE_FMT_UUID		/* added long ago, but never used */
> >  } xfs_dinode_fmt_t;
> >  
> > +#define XFS_INODE_FORMAT_STR \
> > +	{ XFS_DINODE_FMT_DEV,		"dev" }, \
> > +	{ XFS_DINODE_FMT_LOCAL,		"local" }, \
> > +	{ XFS_DINODE_FMT_EXTENTS,	"extent" }, \
> > +	{ XFS_DINODE_FMT_BTREE,		"btree" }, \
> > +	{ XFS_DINODE_FMT_UUID,		"uuid" }
> > +
> >  /*
> >   * Inode minimum and maximum sizes.
> >   */
> > diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
> > index 3f57002ca660..94e289aca220 100644
> > --- a/fs/xfs/xfs_trace.h
> > +++ b/fs/xfs/xfs_trace.h
> > @@ -1901,11 +1901,11 @@ TRACE_EVENT(xfs_dir2_leafn_moveents,
> >  	{ 0,	"target" }, \
> >  	{ 1,	"temp" }
> >  
> > -#define XFS_INODE_FORMAT_STR \
> > -	{ 0,	"invalid" }, \
> > -	{ 1,	"local" }, \
> > -	{ 2,	"extent" }, \
> > -	{ 3,	"btree" }
> > +TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV);
> > +TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL);
> > +TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS);
> > +TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE);
> > +TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID);
> >  
> >  DECLARE_EVENT_CLASS(xfs_swap_extent_class,
> >  	TP_PROTO(struct xfs_inode *ip, int which),
> > 

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

* Re: [PATCH 4/6] xfs: move XFS_INODE_FORMAT_STR mappings to libxfs
  2018-11-28 23:29 ` [PATCH 4/6] xfs: move XFS_INODE_FORMAT_STR mappings to libxfs Darrick J. Wong
  2018-12-18 17:24   ` Eric Sandeen
@ 2018-12-18 17:25   ` Eric Sandeen
  2018-12-18 18:35     ` Darrick J. Wong
  1 sibling, 1 reply; 13+ messages in thread
From: Eric Sandeen @ 2018-12-18 17:25 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs

On 11/28/18 5:29 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Move XFS_INODE_FORMAT_STR to libxfs so that we don't forget to keep it
> updated, and add necessary TRACE_DEFINE_ENUM.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

...

> diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
> index 3f57002ca660..94e289aca220 100644
> --- a/fs/xfs/xfs_trace.h
> +++ b/fs/xfs/xfs_trace.h
> @@ -1901,11 +1901,11 @@ TRACE_EVENT(xfs_dir2_leafn_moveents,
>  	{ 0,	"target" }, \
>  	{ 1,	"temp" }

^^^^ that context makes me wonder if we shouldn't move that #define
as well, and give 0 & 1 some meaningful macro names.  Patch 7/6? :)

-Eric

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

* Re: [PATCH 4/6] xfs: move XFS_INODE_FORMAT_STR mappings to libxfs
  2018-11-28 23:29 ` [PATCH 4/6] xfs: move XFS_INODE_FORMAT_STR mappings to libxfs Darrick J. Wong
@ 2018-12-18 17:24   ` Eric Sandeen
  2018-12-18 18:30     ` Darrick J. Wong
  2018-12-18 17:25   ` Eric Sandeen
  1 sibling, 1 reply; 13+ messages in thread
From: Eric Sandeen @ 2018-12-18 17:24 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs

On 11/28/18 5:29 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Move XFS_INODE_FORMAT_STR to libxfs so that we don't forget to keep it
> updated, and add necessary TRACE_DEFINE_ENUM.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Now that I think of it, just adding a /* for ftrace */ above the #define
might be nice here and for the others, if you think it's appropriate, but:

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  fs/xfs/libxfs/xfs_format.h |    7 +++++++
>  fs/xfs/xfs_trace.h         |   10 +++++-----
>  2 files changed, 12 insertions(+), 5 deletions(-)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
> index b15412e4c535..d8902114786d 100644
> --- a/fs/xfs/libxfs/xfs_format.h
> +++ b/fs/xfs/libxfs/xfs_format.h
> @@ -925,6 +925,13 @@ typedef enum xfs_dinode_fmt {
>  	XFS_DINODE_FMT_UUID		/* added long ago, but never used */
>  } xfs_dinode_fmt_t;
>  
> +#define XFS_INODE_FORMAT_STR \
> +	{ XFS_DINODE_FMT_DEV,		"dev" }, \
> +	{ XFS_DINODE_FMT_LOCAL,		"local" }, \
> +	{ XFS_DINODE_FMT_EXTENTS,	"extent" }, \
> +	{ XFS_DINODE_FMT_BTREE,		"btree" }, \
> +	{ XFS_DINODE_FMT_UUID,		"uuid" }
> +
>  /*
>   * Inode minimum and maximum sizes.
>   */
> diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
> index 3f57002ca660..94e289aca220 100644
> --- a/fs/xfs/xfs_trace.h
> +++ b/fs/xfs/xfs_trace.h
> @@ -1901,11 +1901,11 @@ TRACE_EVENT(xfs_dir2_leafn_moveents,
>  	{ 0,	"target" }, \
>  	{ 1,	"temp" }
>  
> -#define XFS_INODE_FORMAT_STR \
> -	{ 0,	"invalid" }, \
> -	{ 1,	"local" }, \
> -	{ 2,	"extent" }, \
> -	{ 3,	"btree" }
> +TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV);
> +TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL);
> +TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS);
> +TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE);
> +TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID);
>  
>  DECLARE_EVENT_CLASS(xfs_swap_extent_class,
>  	TP_PROTO(struct xfs_inode *ip, int which),
> 

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

* [PATCH 4/6] xfs: move XFS_INODE_FORMAT_STR mappings to libxfs
  2018-11-28 23:28 [PATCH 0/6] xfs-5.0: ftrace cleanups Darrick J. Wong
@ 2018-11-28 23:29 ` Darrick J. Wong
  2018-12-18 17:24   ` Eric Sandeen
  2018-12-18 17:25   ` Eric Sandeen
  0 siblings, 2 replies; 13+ messages in thread
From: Darrick J. Wong @ 2018-11-28 23:29 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs

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

Move XFS_INODE_FORMAT_STR to libxfs so that we don't forget to keep it
updated, and add necessary TRACE_DEFINE_ENUM.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_format.h |    7 +++++++
 fs/xfs/xfs_trace.h         |   10 +++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)


diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
index b15412e4c535..d8902114786d 100644
--- a/fs/xfs/libxfs/xfs_format.h
+++ b/fs/xfs/libxfs/xfs_format.h
@@ -925,6 +925,13 @@ typedef enum xfs_dinode_fmt {
 	XFS_DINODE_FMT_UUID		/* added long ago, but never used */
 } xfs_dinode_fmt_t;
 
+#define XFS_INODE_FORMAT_STR \
+	{ XFS_DINODE_FMT_DEV,		"dev" }, \
+	{ XFS_DINODE_FMT_LOCAL,		"local" }, \
+	{ XFS_DINODE_FMT_EXTENTS,	"extent" }, \
+	{ XFS_DINODE_FMT_BTREE,		"btree" }, \
+	{ XFS_DINODE_FMT_UUID,		"uuid" }
+
 /*
  * Inode minimum and maximum sizes.
  */
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 3f57002ca660..94e289aca220 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -1901,11 +1901,11 @@ TRACE_EVENT(xfs_dir2_leafn_moveents,
 	{ 0,	"target" }, \
 	{ 1,	"temp" }
 
-#define XFS_INODE_FORMAT_STR \
-	{ 0,	"invalid" }, \
-	{ 1,	"local" }, \
-	{ 2,	"extent" }, \
-	{ 3,	"btree" }
+TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV);
+TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL);
+TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS);
+TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE);
+TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID);
 
 DECLARE_EVENT_CLASS(xfs_swap_extent_class,
 	TP_PROTO(struct xfs_inode *ip, int which),

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

end of thread, other threads:[~2018-12-18 20:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-18 20:39 [PATCH v2 0/6] xfs: ftrace cleanups Darrick J. Wong
2018-12-18 20:39 ` [PATCH 1/6] xfs: fix function pointer type in ftrace format Darrick J. Wong
2018-12-18 20:39 ` [PATCH 2/6] xfs: fix symbolic enum printing in ftrace output Darrick J. Wong
2018-12-18 20:39 ` [PATCH 3/6] xfs: move XFS_AG_BTREE_CMP_FORMAT_STR mappings to libxfs Darrick J. Wong
2018-12-18 20:39 ` [PATCH 4/6] xfs: move XFS_INODE_FORMAT_STR " Darrick J. Wong
2018-12-18 20:39 ` [PATCH 5/6] xfs: stringify btree cursor types in ftrace output Darrick J. Wong
2018-12-18 20:40 ` [PATCH 6/6] xfs: stringify scrub " Darrick J. Wong
2018-12-18 20:44   ` Eric Sandeen
  -- strict thread matches above, loose matches on Subject: below --
2018-11-28 23:28 [PATCH 0/6] xfs-5.0: ftrace cleanups Darrick J. Wong
2018-11-28 23:29 ` [PATCH 4/6] xfs: move XFS_INODE_FORMAT_STR mappings to libxfs Darrick J. Wong
2018-12-18 17:24   ` Eric Sandeen
2018-12-18 18:30     ` Darrick J. Wong
2018-12-18 17:25   ` Eric Sandeen
2018-12-18 18:35     ` Darrick J. Wong

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.