# define FUNCTION_GRAPH_DEFAULT_FLAGS  0UL
 #endif
 
+#ifdef CONFIG_BRANCH_TRACER
+# define BRANCH_FLAGS                                  \
+               C(BRANCH,               "branch"),
+#else
+# define BRANCH_FLAGS
+#endif
+
 /*
  * trace_iterator_flags is an enumeration that defines bit
  * positions into trace_flags that controls the output.
                C(BLOCK,                "block"),               \
                C(STACKTRACE,           "stacktrace"),          \
                C(PRINTK,               "trace_printk"),        \
-               C(BRANCH,               "branch"),              \
                C(ANNOTATE,             "annotate"),            \
                C(USERSTACKTRACE,       "userstacktrace"),      \
                C(SYM_USEROBJ,          "sym-userobj"),         \
                C(IRQ_INFO,             "irq-info"),            \
                C(MARKERS,              "markers"),             \
                C(FUNCTION,             "function-trace"),      \
-               FGRAPH_FLAGS
+               FGRAPH_FLAGS                                    \
+               BRANCH_FLAGS
 
 /*
  * By defining C, we can make TRACE_FLAGS a list of bit names