diff options
Diffstat (limited to 'tools/perf/ui/browsers/annotate.c')
-rw-r--r-- | tools/perf/ui/browsers/annotate.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index 08545ae46992..f0697a3aede0 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c | |||
@@ -442,35 +442,37 @@ static bool annotate_browser__callq(struct annotate_browser *browser, | |||
442 | { | 442 | { |
443 | struct map_symbol *ms = browser->b.priv; | 443 | struct map_symbol *ms = browser->b.priv; |
444 | struct disasm_line *dl = browser->selection; | 444 | struct disasm_line *dl = browser->selection; |
445 | struct symbol *sym = ms->sym; | ||
446 | struct annotation *notes; | 445 | struct annotation *notes; |
447 | struct symbol *target; | 446 | struct addr_map_symbol target = { |
448 | u64 ip; | 447 | .map = ms->map, |
448 | .addr = map__objdump_2mem(ms->map, dl->ops.target.addr), | ||
449 | }; | ||
449 | char title[SYM_TITLE_MAX_SIZE]; | 450 | char title[SYM_TITLE_MAX_SIZE]; |
450 | 451 | ||
451 | if (!ins__is_call(dl->ins)) | 452 | if (!ins__is_call(dl->ins)) |
452 | return false; | 453 | return false; |
453 | 454 | ||
454 | ip = ms->map->map_ip(ms->map, dl->ops.target.addr); | 455 | if (map_groups__find_ams(&target, NULL) || |
455 | target = map__find_symbol(ms->map, ip, NULL); | 456 | map__rip_2objdump(target.map, target.map->map_ip(target.map, |
456 | if (target == NULL) { | 457 | target.addr)) != |
458 | dl->ops.target.addr) { | ||
457 | ui_helpline__puts("The called function was not found."); | 459 | ui_helpline__puts("The called function was not found."); |
458 | return true; | 460 | return true; |
459 | } | 461 | } |
460 | 462 | ||
461 | notes = symbol__annotation(target); | 463 | notes = symbol__annotation(target.sym); |
462 | pthread_mutex_lock(¬es->lock); | 464 | pthread_mutex_lock(¬es->lock); |
463 | 465 | ||
464 | if (notes->src == NULL && symbol__alloc_hist(target) < 0) { | 466 | if (notes->src == NULL && symbol__alloc_hist(target.sym) < 0) { |
465 | pthread_mutex_unlock(¬es->lock); | 467 | pthread_mutex_unlock(¬es->lock); |
466 | ui__warning("Not enough memory for annotating '%s' symbol!\n", | 468 | ui__warning("Not enough memory for annotating '%s' symbol!\n", |
467 | target->name); | 469 | target.sym->name); |
468 | return true; | 470 | return true; |
469 | } | 471 | } |
470 | 472 | ||
471 | pthread_mutex_unlock(¬es->lock); | 473 | pthread_mutex_unlock(¬es->lock); |
472 | symbol__tui_annotate(target, ms->map, evsel, hbt); | 474 | symbol__tui_annotate(target.sym, target.map, evsel, hbt); |
473 | sym_title(sym, ms->map, title, sizeof(title)); | 475 | sym_title(ms->sym, ms->map, title, sizeof(title)); |
474 | ui_browser__show_title(&browser->b, title); | 476 | ui_browser__show_title(&browser->b, title); |
475 | return true; | 477 | return true; |
476 | } | 478 | } |