perf symbols: Move mem_info and branch_info out of symbol.h
[linux-2.6-block.git] / tools / perf / util / branch.h
CommitLineData
992c7e92
JY
1#ifndef _PERF_BRANCH_H
2#define _PERF_BRANCH_H 1
3
f1a397f3 4#include <stdio.h>
992c7e92 5#include <stdint.h>
f1a397f3
ACM
6#include <linux/perf_event.h>
7#include <linux/types.h>
8
9struct 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
d3300a3c
ACM
19struct branch_info {
20 struct addr_map_symbol from;
21 struct addr_map_symbol to;
22 struct branch_flags flags;
23 char *srcline_from;
24 char *srcline_to;
25};
26
f1a397f3
ACM
27struct branch_entry {
28 u64 from;
29 u64 to;
30 struct branch_flags flags;
31};
32
33struct branch_stack {
34 u64 nr;
35 struct branch_entry entries[0];
36};
992c7e92
JY
37
38struct branch_type_stat {
a1a8bed3
JY
39 bool branch_to;
40 u64 counts[PERF_BR_MAX];
41 u64 cond_fwd;
42 u64 cond_bwd;
43 u64 cross_4k;
44 u64 cross_2m;
992c7e92
JY
45};
46
992c7e92
JY
47void branch_type_count(struct branch_type_stat *st, struct branch_flags *flags,
48 u64 from, u64 to);
49
50const char *branch_type_name(int type);
51void branch_type_stat_display(FILE *fp, struct branch_type_stat *st);
52int branch_type_str(struct branch_type_stat *st, char *bf, int bfsize);
53
54#endif /* _PERF_BRANCH_H */