diff mbox series

[3/6] btrfs: tracepoints: Move FLUSH_ACTIONS define

Message ID 20200619122451.31162-4-nborisov@suse.com
State New, archived
Headers show
Series Fix enum values print in tracepoints | expand

Commit Message

Nikolay Borisov June 19, 2020, 12:24 p.m. UTC
Since all enums used in btrfs' tracepoints are going to be redefined
to allow proper parsing of their values by userspace tools let's
rearrange when they are defined. This will allow to use only a single
set of #define EM/#undef EM sequence. No functional changes.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 include/trace/events/btrfs.h | 26 +++++++-------------------
 1 file changed, 7 insertions(+), 19 deletions(-)
diff mbox series

Patch

diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index 937519399f30..e13c25598057 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -67,6 +67,12 @@  TRACE_DEFINE_ENUM(COMMIT_TRANS);
 	      (obj >= BTRFS_ROOT_TREE_OBJECTID &&			\
 	       obj <= BTRFS_QUOTA_TREE_OBJECTID)) ? __show_root_type(obj) : "-"
 
+#define FLUSH_ACTIONS								\
+	EM (BTRFS_RESERVE_NO_FLUSH,		"BTRFS_RESERVE_NO_FLUSH")	\
+	EM (BTRFS_RESERVE_FLUSH_LIMIT,		"BTRFS_RESERVE_FLUSH_LIMIT")	\
+	EM (BTRFS_RESERVE_FLUSH_ALL,		"BTRFS_RESERVE_FLUSH_ALL")	\
+	EMe (BTRFS_RESERVE_FLUSH_ALL_STEAL,	"BTRFS_RESERVE_FLUSH_ALL_STEAL")
+
 #define FI_TYPES							\
 	EM (BTRFS_FILE_EXTENT_INLINE,		"INLINE")	\
 	EM (BTRFS_FILE_EXTENT_REG,		"REG")		\
@@ -77,6 +83,7 @@  TRACE_DEFINE_ENUM(COMMIT_TRANS);
 #define EM(a, b) TRACE_DEFINE_ENUM(a);
 #define EMe(a, b) TRACE_DEFINE_ENUM(a);
 
+FLUSH_ACTIONS
 FI_TYPES
 
 #undef EM
@@ -1055,25 +1062,6 @@  TRACE_EVENT(btrfs_space_reservation,
 			__entry->bytes)
 );
 
-#define FLUSH_ACTIONS								\
-	EM (BTRFS_RESERVE_NO_FLUSH,		"BTRFS_RESERVE_NO_FLUSH")	\
-	EM (BTRFS_RESERVE_FLUSH_LIMIT,		"BTRFS_RESERVE_FLUSH_LIMIT")	\
-	EM (BTRFS_RESERVE_FLUSH_ALL,		"BTRFS_RESERVE_FLUSH_ALL")	\
-	EMe (BTRFS_RESERVE_FLUSH_ALL_STEAL,	"BTRFS_RESERVE_FLUSH_ALL_STEAL")
-
-#undef EM
-#undef EMe
-#define EM(a, b) TRACE_DEFINE_ENUM(a);
-#define EMe(a, b) TRACE_DEFINE_ENUM(a);
-
-FLUSH_ACTIONS
-
-#undef EM
-#undef EMe
-
-#define EM(a, b)        {a, b},
-#define EMe(a, b)       {a, b}
-
 TRACE_EVENT(btrfs_trigger_flush,
 
 	TP_PROTO(const struct btrfs_fs_info *fs_info, u64 flags, u64 bytes,