Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tools: Move branch structs to branch.h

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>

+26 -23
+24 -3
tools/perf/util/branch.h
··· 1 1 #ifndef _PERF_BRANCH_H 2 2 #define _PERF_BRANCH_H 1 3 3 4 + #include <stdio.h> 4 5 #include <stdint.h> 5 - #include "../perf.h" 6 + #include <linux/perf_event.h> 7 + #include <linux/types.h> 8 + 9 + struct branch_flags { 10 + u64 mispred:1; 11 + u64 predicted:1; 12 + u64 in_tx:1; 13 + u64 abort:1; 14 + u64 cycles:16; 15 + u64 type:4; 16 + u64 reserved:40; 17 + }; 18 + 19 + struct branch_entry { 20 + u64 from; 21 + u64 to; 22 + struct branch_flags flags; 23 + }; 24 + 25 + struct branch_stack { 26 + u64 nr; 27 + struct branch_entry entries[0]; 28 + }; 6 29 7 30 struct branch_type_stat { 8 31 bool branch_to; ··· 35 12 u64 cross_4k; 36 13 u64 cross_2m; 37 14 }; 38 - 39 - struct branch_flags; 40 15 41 16 void branch_type_count(struct branch_type_stat *st, struct branch_flags *flags, 42 17 u64 from, u64 to);
+1 -20
tools/perf/util/event.h
··· 161 161 u64 ips[0]; 162 162 }; 163 163 164 - struct branch_flags { 165 - u64 mispred:1; 166 - u64 predicted:1; 167 - u64 in_tx:1; 168 - u64 abort:1; 169 - u64 cycles:16; 170 - u64 type:4; 171 - u64 reserved:40; 172 - }; 173 - 174 - struct branch_entry { 175 - u64 from; 176 - u64 to; 177 - struct branch_flags flags; 178 - }; 179 - 180 - struct branch_stack { 181 - u64 nr; 182 - struct branch_entry entries[0]; 183 - }; 164 + struct branch_stack; 184 165 185 166 enum { 186 167 PERF_IP_FLAG_BRANCH = 1ULL << 0,
+1
tools/perf/util/symbol.h
··· 12 12 #include <stdio.h> 13 13 #include <byteswap.h> 14 14 #include <libgen.h> 15 + #include "branch.h" 15 16 #include "build-id.h" 16 17 #include "event.h" 17 18 #include "path.h"