aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/ui/browsers/annotate.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 08545ae46992..57d3a8659fc0 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -442,35 +442,34 @@ 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 = 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 if (target == NULL) {
457 ui_helpline__puts("The called function was not found."); 456 ui_helpline__puts("The called function was not found.");
458 return true; 457 return true;
459 } 458 }
460 459
461 notes = symbol__annotation(target); 460 notes = symbol__annotation(target.sym);
462 pthread_mutex_lock(&notes->lock); 461 pthread_mutex_lock(&notes->lock);
463 462
464 if (notes->src == NULL && symbol__alloc_hist(target) < 0) { 463 if (notes->src == NULL && symbol__alloc_hist(target.sym) < 0) {
465 pthread_mutex_unlock(&notes->lock); 464 pthread_mutex_unlock(&notes->lock);
466 ui__warning("Not enough memory for annotating '%s' symbol!\n", 465 ui__warning("Not enough memory for annotating '%s' symbol!\n",
467 target->name); 466 target.sym->name);
468 return true; 467 return true;
469 } 468 }
470 469
471 pthread_mutex_unlock(&notes->lock); 470 pthread_mutex_unlock(&notes->lock);
472 symbol__tui_annotate(target, ms->map, evsel, hbt); 471 symbol__tui_annotate(target.sym, target.map, evsel, hbt);
473 sym_title(sym, ms->map, title, sizeof(title)); 472 sym_title(ms->sym, ms->map, title, sizeof(title));
474 ui_browser__show_title(&browser->b, title); 473 ui_browser__show_title(&browser->b, title);
475 return true; 474 return true;
476} 475}