diff options
Diffstat (limited to 'tools/perf/util/annotate.h')
-rw-r--r-- | tools/perf/util/annotate.h | 51 |
1 files changed, 31 insertions, 20 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index c422440fe611..af755156d278 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h | |||
@@ -50,6 +50,8 @@ bool ins__is_jump(const struct ins *ins); | |||
50 | bool ins__is_call(const struct ins *ins); | 50 | bool ins__is_call(const struct ins *ins); |
51 | int ins__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops); | 51 | int ins__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops); |
52 | 52 | ||
53 | struct annotation; | ||
54 | |||
53 | struct disasm_line { | 55 | struct disasm_line { |
54 | struct list_head node; | 56 | struct list_head node; |
55 | s64 offset; | 57 | s64 offset; |
@@ -68,17 +70,24 @@ void disasm_line__free(struct disasm_line *dl); | |||
68 | struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos); | 70 | struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos); |
69 | int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw); | 71 | int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw); |
70 | size_t disasm__fprintf(struct list_head *head, FILE *fp); | 72 | size_t disasm__fprintf(struct list_head *head, FILE *fp); |
73 | double disasm__calc_percent(struct annotation *notes, int evidx, s64 offset, | ||
74 | s64 end, const char **path); | ||
71 | 75 | ||
72 | struct sym_hist { | 76 | struct sym_hist { |
73 | u64 sum; | 77 | u64 sum; |
74 | u64 addr[0]; | 78 | u64 addr[0]; |
75 | }; | 79 | }; |
76 | 80 | ||
77 | struct source_line { | 81 | struct source_line_percent { |
78 | struct rb_node node; | ||
79 | double percent; | 82 | double percent; |
80 | double percent_sum; | 83 | double percent_sum; |
84 | }; | ||
85 | |||
86 | struct source_line { | ||
87 | struct rb_node node; | ||
81 | char *path; | 88 | char *path; |
89 | int nr_pcnt; | ||
90 | struct source_line_percent p[1]; | ||
82 | }; | 91 | }; |
83 | 92 | ||
84 | /** struct annotated_source - symbols with hits have this attached as in sannotation | 93 | /** struct annotated_source - symbols with hits have this attached as in sannotation |
@@ -130,47 +139,49 @@ void symbol__annotate_zero_histograms(struct symbol *sym); | |||
130 | 139 | ||
131 | int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize); | 140 | int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize); |
132 | int symbol__annotate_init(struct map *map __maybe_unused, struct symbol *sym); | 141 | int symbol__annotate_init(struct map *map __maybe_unused, struct symbol *sym); |
133 | int symbol__annotate_printf(struct symbol *sym, struct map *map, int evidx, | 142 | int symbol__annotate_printf(struct symbol *sym, struct map *map, |
134 | bool full_paths, int min_pcnt, int max_lines, | 143 | struct perf_evsel *evsel, bool full_paths, |
135 | int context); | 144 | int min_pcnt, int max_lines, int context); |
136 | void symbol__annotate_zero_histogram(struct symbol *sym, int evidx); | 145 | void symbol__annotate_zero_histogram(struct symbol *sym, int evidx); |
137 | void symbol__annotate_decay_histogram(struct symbol *sym, int evidx); | 146 | void symbol__annotate_decay_histogram(struct symbol *sym, int evidx); |
138 | void disasm__purge(struct list_head *head); | 147 | void disasm__purge(struct list_head *head); |
139 | 148 | ||
140 | int symbol__tty_annotate(struct symbol *sym, struct map *map, int evidx, | 149 | int symbol__tty_annotate(struct symbol *sym, struct map *map, |
141 | bool print_lines, bool full_paths, int min_pcnt, | 150 | struct perf_evsel *evsel, bool print_lines, |
142 | int max_lines); | 151 | bool full_paths, int min_pcnt, int max_lines); |
143 | 152 | ||
144 | #ifdef NEWT_SUPPORT | 153 | #ifdef SLANG_SUPPORT |
145 | int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx, | 154 | int symbol__tui_annotate(struct symbol *sym, struct map *map, |
155 | struct perf_evsel *evsel, | ||
146 | struct hist_browser_timer *hbt); | 156 | struct hist_browser_timer *hbt); |
147 | #else | 157 | #else |
148 | static inline int symbol__tui_annotate(struct symbol *sym __maybe_unused, | 158 | static inline int symbol__tui_annotate(struct symbol *sym __maybe_unused, |
149 | struct map *map __maybe_unused, | 159 | struct map *map __maybe_unused, |
150 | int evidx __maybe_unused, | 160 | struct perf_evsel *evsel __maybe_unused, |
151 | struct hist_browser_timer *hbt | 161 | struct hist_browser_timer *hbt |
152 | __maybe_unused) | 162 | __maybe_unused) |
153 | { | 163 | { |
154 | return 0; | 164 | return 0; |
155 | } | 165 | } |
156 | #endif | 166 | #endif |
157 | 167 | ||
158 | #ifdef GTK2_SUPPORT | 168 | #ifdef GTK2_SUPPORT |
159 | int symbol__gtk_annotate(struct symbol *sym, struct map *map, int evidx, | 169 | int symbol__gtk_annotate(struct symbol *sym, struct map *map, |
170 | struct perf_evsel *evsel, | ||
160 | struct hist_browser_timer *hbt); | 171 | struct hist_browser_timer *hbt); |
161 | 172 | ||
162 | static inline int hist_entry__gtk_annotate(struct hist_entry *he, int evidx, | 173 | static inline int hist_entry__gtk_annotate(struct hist_entry *he, |
174 | struct perf_evsel *evsel, | ||
163 | struct hist_browser_timer *hbt) | 175 | struct hist_browser_timer *hbt) |
164 | { | 176 | { |
165 | return symbol__gtk_annotate(he->ms.sym, he->ms.map, evidx, hbt); | 177 | return symbol__gtk_annotate(he->ms.sym, he->ms.map, evsel, hbt); |
166 | } | 178 | } |
167 | 179 | ||
168 | void perf_gtk__show_annotations(void); | 180 | void perf_gtk__show_annotations(void); |
169 | #else | 181 | #else |
170 | static inline int hist_entry__gtk_annotate(struct hist_entry *he __maybe_unused, | 182 | static inline int hist_entry__gtk_annotate(struct hist_entry *he __maybe_unused, |
171 | int evidx __maybe_unused, | 183 | struct perf_evsel *evsel __maybe_unused, |
172 | struct hist_browser_timer *hbt | 184 | struct hist_browser_timer *hbt __maybe_unused) |
173 | __maybe_unused) | ||
174 | { | 185 | { |
175 | return 0; | 186 | return 0; |
176 | } | 187 | } |