summaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/browsers/annotate.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/ui/browsers/annotate.c')
-rw-r--r--tools/perf/ui/browsers/annotate.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 4790c73559..ea98643024 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -49,7 +49,7 @@ static int ui_browser__jumps_percent_color(struct ui_browser *browser, int nr, b
if (current && (!browser->use_navkeypressed || browser->navkeypressed))
return HE_COLORSET_SELECTED;
- if (nr == notes->max_jump_sources)
+ if (nr == notes->src->max_jump_sources)
return HE_COLORSET_TOP;
if (nr > 1)
return HE_COLORSET_MEDIUM;
@@ -186,7 +186,7 @@ static void annotate_browser__draw_current_jump(struct ui_browser *browser)
* name right after the '<' token and probably treating this like a
* 'call' instruction.
*/
- target = notes->src->offsets[cursor->ops.target.offset];
+ target = annotated_source__get_line(notes->src, cursor->ops.target.offset);
if (target == NULL) {
ui_helpline__printf("WARN: jump target inconsistency, press 'o', notes->offsets[%#x] = NULL\n",
cursor->ops.target.offset);
@@ -205,13 +205,13 @@ static void annotate_browser__draw_current_jump(struct ui_browser *browser)
ui_browser__set_color(browser, HE_COLORSET_JUMP_ARROWS);
__ui_browser__line_arrow(browser,
- pcnt_width + 2 + notes->widths.addr + width,
+ pcnt_width + 2 + notes->src->widths.addr + width,
from, to);
diff = is_fused(ab, cursor);
if (diff > 0) {
ui_browser__mark_fused(browser,
- pcnt_width + 3 + notes->widths.addr + width,
+ pcnt_width + 3 + notes->src->widths.addr + width,
from - diff, diff, to > from);
}
}
@@ -438,7 +438,7 @@ static int sym_title(struct symbol *sym, struct map *map, char *title,
size_t sz, int percent_type)
{
return snprintf(title, sz, "%s %s [Percent: %s]", sym->name,
- map__dso(map)->long_name,
+ dso__long_name(map__dso(map)),
percent_type_str(percent_type));
}
@@ -967,23 +967,23 @@ int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
return -1;
dso = map__dso(ms->map);
- if (dso->annotate_warned)
+ if (dso__annotate_warned(dso))
return -1;
if (not_annotated || !sym->annotate2) {
err = symbol__annotate2(ms, evsel, &browser.arch);
if (err) {
char msg[BUFSIZ];
- dso->annotate_warned = true;
+ dso__set_annotate_warned(dso);
symbol__strerror_disassemble(ms, err, msg, sizeof(msg));
ui__error("Couldn't annotate %s:\n%s", sym->name, msg);
- goto out_free_offsets;
+ return -1;
}
}
ui_helpline__push("Press ESC to exit");
- browser.b.width = notes->src->max_line_len;
+ browser.b.width = notes->src->widths.max_line_len;
browser.b.nr_entries = notes->src->nr_entries;
browser.b.entries = &notes->src->source,
browser.b.width += 18; /* Percentage */
@@ -996,8 +996,5 @@ int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
if(not_annotated)
annotated_source__purge(notes->src);
-out_free_offsets:
- if(not_annotated)
- zfree(&notes->src->offsets);
return ret;
}