diff options
Diffstat (limited to 'tools/perf/util/annotate.h')
-rw-r--r-- | tools/perf/util/annotate.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h new file mode 100644 index 000000000000..6e2fbc205299 --- /dev/null +++ b/tools/perf/util/annotate.h | |||
@@ -0,0 +1,65 @@ | |||
1 | #ifndef __PERF_ANNOTATE_H | ||
2 | #define __PERF_ANNOTATE_H | ||
3 | |||
4 | #include <stdbool.h> | ||
5 | #include "types.h" | ||
6 | #include "symbol.h" | ||
7 | #include <linux/list.h> | ||
8 | #include <linux/rbtree.h> | ||
9 | |||
10 | struct objdump_line { | ||
11 | struct list_head node; | ||
12 | s64 offset; | ||
13 | char *line; | ||
14 | }; | ||
15 | |||
16 | void objdump_line__free(struct objdump_line *self); | ||
17 | struct objdump_line *objdump__get_next_ip_line(struct list_head *head, | ||
18 | struct objdump_line *pos); | ||
19 | |||
20 | struct sym_hist { | ||
21 | u64 sum; | ||
22 | u64 addr[0]; | ||
23 | }; | ||
24 | |||
25 | struct source_line { | ||
26 | struct rb_node node; | ||
27 | double percent; | ||
28 | char *path; | ||
29 | }; | ||
30 | |||
31 | struct annotation { | ||
32 | struct sym_hist *histogram; | ||
33 | struct source_line *src_line; | ||
34 | }; | ||
35 | |||
36 | struct sannotation { | ||
37 | struct annotation annotation; | ||
38 | struct symbol symbol; | ||
39 | }; | ||
40 | |||
41 | static inline struct annotation *symbol__annotation(struct symbol *sym) | ||
42 | { | ||
43 | struct sannotation *a = container_of(sym, struct sannotation, symbol); | ||
44 | return &a->annotation; | ||
45 | } | ||
46 | |||
47 | int symbol__inc_addr_samples(struct symbol *sym, struct map *map, u64 addr); | ||
48 | |||
49 | int symbol__annotate(struct symbol *sym, struct map *map, | ||
50 | struct list_head *head, size_t privsize); | ||
51 | |||
52 | int symbol__tty_annotate(struct symbol *sym, struct map *map, | ||
53 | bool print_lines, bool full_paths); | ||
54 | |||
55 | #ifdef NO_NEWT_SUPPORT | ||
56 | static inline int symbol__tui_annotate(symbol *sym __used, | ||
57 | struct map *map __used) | ||
58 | { | ||
59 | return 0; | ||
60 | } | ||
61 | #else | ||
62 | int symbol__tui_annotate(struct symbol *sym, struct map *map); | ||
63 | #endif | ||
64 | |||
65 | #endif /* __PERF_ANNOTATE_H */ | ||