]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: tracepoints: move FLUSH_ACTIONS define
authorNikolay Borisov <nborisov@suse.com>
Fri, 19 Jun 2020 12:24:48 +0000 (15:24 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:29 +0000 (12:55 +0200)
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>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
include/trace/events/btrfs.h

index 71401d4c3cccc431b715e76b55546fba92305d10..c214622957c4a685327b3b39c7292455476c2f2c 100644 (file)
@@ -67,18 +67,35 @@ 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")                  \
        EMe(BTRFS_FILE_EXTENT_PREALLOC,         "PREALLOC")
 
+/*
+ * First define the enums in the above macros to be exported to userspace via
+ * TRACE_DEFINE_ENUM().
+ */
+
 #undef EM
 #undef EMe
 #define EM(a, b)       TRACE_DEFINE_ENUM(a);
 #define EMe(a, b)      TRACE_DEFINE_ENUM(a);
 
+FLUSH_ACTIONS
 FI_TYPES
 
+/*
+ * Now redefine the EM and EMe macros to map the enums to the strings that will
+ * be printed in the output
+ */
+
 #undef EM
 #undef EMe
 #define EM(a, b)        {a, b},
@@ -1053,34 +1070,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")
-
-/*
- * First define the enums in the above macros to be exported to userspace via
- * TRACE_DEFINE_ENUM().
- */
-
-#undef EM
-#undef EMe
-#define EM(a, b)       TRACE_DEFINE_ENUM(a);
-#define EMe(a, b)      TRACE_DEFINE_ENUM(a);
-
-FLUSH_ACTIONS
-
-/*
- * Now redefine the EM and EMe macros to map the enums to the strings that will
- * be printed in the output
- */
-
-#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,