aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/annotate.h')
-rw-r--r--tools/perf/util/annotate.h51
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);
50bool ins__is_call(const struct ins *ins); 50bool ins__is_call(const struct ins *ins);
51int ins__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops); 51int ins__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops);
52 52
53struct annotation;
54
53struct disasm_line { 55struct 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);
68struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos); 70struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos);
69int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw); 71int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw);
70size_t disasm__fprintf(struct list_head *head, FILE *fp); 72size_t disasm__fprintf(struct list_head *head, FILE *fp);
73double disasm__calc_percent(struct annotation *notes, int evidx, s64 offset,
74 s64 end, const char **path);
71 75
72struct sym_hist { 76struct sym_hist {
73 u64 sum; 77 u64 sum;
74 u64 addr[0]; 78 u64 addr[0];
75}; 79};
76 80
77struct source_line { 81struct source_line_percent {
78 struct rb_node node;
79 double percent; 82 double percent;
80 double percent_sum; 83 double percent_sum;
84};
85
86struct 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
131int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize); 140int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize);
132int symbol__annotate_init(struct map *map __maybe_unused, struct symbol *sym); 141int symbol__annotate_init(struct map *map __maybe_unused, struct symbol *sym);
133int symbol__annotate_printf(struct symbol *sym, struct map *map, int evidx, 142int 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);
136void symbol__annotate_zero_histogram(struct symbol *sym, int evidx); 145void symbol__annotate_zero_histogram(struct symbol *sym, int evidx);
137void symbol__annotate_decay_histogram(struct symbol *sym, int evidx); 146void symbol__annotate_decay_histogram(struct symbol *sym, int evidx);
138void disasm__purge(struct list_head *head); 147void disasm__purge(struct list_head *head);
139 148
140int symbol__tty_annotate(struct symbol *sym, struct map *map, int evidx, 149int 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
145int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx, 154int 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
148static inline int symbol__tui_annotate(struct symbol *sym __maybe_unused, 158static 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
159int symbol__gtk_annotate(struct symbol *sym, struct map *map, int evidx, 169int 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
162static inline int hist_entry__gtk_annotate(struct hist_entry *he, int evidx, 173static 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
168void perf_gtk__show_annotations(void); 180void perf_gtk__show_annotations(void);
169#else 181#else
170static inline int hist_entry__gtk_annotate(struct hist_entry *he __maybe_unused, 182static 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}