perf tools: Move branch structs to branch.h
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 22 Jan 2019 12:58:22 +0000 (10:58 -0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 25 Jan 2019 14:12:08 +0000 (15:12 +0100)
We already have it, move those there from events.h so that we untangle
the header dependencies a bit more.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-pnbkqo8jxbi49d4f3yd3b5w3@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/branch.h
tools/perf/util/event.h
tools/perf/util/symbol.h

index 1e3c7c5cdc6346387a64af433390964e2df493d9..64f96b79f1d71e969ff5909ab3f926b2d2189d2c 100644 (file)
@@ -1,8 +1,31 @@
 #ifndef _PERF_BRANCH_H
 #define _PERF_BRANCH_H 1
 
+#include <stdio.h>
 #include <stdint.h>
-#include "../perf.h"
+#include <linux/perf_event.h>
+#include <linux/types.h>
+
+struct branch_flags {
+       u64 mispred:1;
+       u64 predicted:1;
+       u64 in_tx:1;
+       u64 abort:1;
+       u64 cycles:16;
+       u64 type:4;
+       u64 reserved:40;
+};
+
+struct branch_entry {
+       u64                     from;
+       u64                     to;
+       struct branch_flags     flags;
+};
+
+struct branch_stack {
+       u64                     nr;
+       struct branch_entry     entries[0];
+};
 
 struct branch_type_stat {
        bool    branch_to;
@@ -13,8 +36,6 @@ struct branch_type_stat {
        u64     cross_2m;
 };
 
-struct branch_flags;
-
 void branch_type_count(struct branch_type_stat *st, struct branch_flags *flags,
                       u64 from, u64 to);
 
index dad32b81fe71678e28b0b8160053b74cd1c037dd..feba1aa819b4f7bd742814587b94faaa54e3cd4f 100644 (file)
@@ -161,26 +161,7 @@ struct ip_callchain {
        u64 ips[0];
 };
 
-struct branch_flags {
-       u64 mispred:1;
-       u64 predicted:1;
-       u64 in_tx:1;
-       u64 abort:1;
-       u64 cycles:16;
-       u64 type:4;
-       u64 reserved:40;
-};
-
-struct branch_entry {
-       u64                     from;
-       u64                     to;
-       struct branch_flags     flags;
-};
-
-struct branch_stack {
-       u64                     nr;
-       struct branch_entry     entries[0];
-};
+struct branch_stack;
 
 enum {
        PERF_IP_FLAG_BRANCH             = 1ULL << 0,
index 277841e3dbd15c3d763996543b0cd462278f0dde..956d9916e36474cbf7e1185a55ac84cb1ee98a26 100644 (file)
@@ -12,6 +12,7 @@
 #include <stdio.h>
 #include <byteswap.h>
 #include <libgen.h>
+#include "branch.h"
 #include "build-id.h"
 #include "event.h"
 #include "path.h"