]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - tools/perf/ui/browsers/annotate.c
Merge branch 'perf/core'
[karo-tx-linux.git] / tools / perf / ui / browsers / annotate.c
index 08545ae46992cd5b284e279bf5ac131cf9c84e62..f0697a3aede04cb19f91d459cab62a6c08c5326f 100644 (file)
@@ -442,35 +442,37 @@ static bool annotate_browser__callq(struct annotate_browser *browser,
 {
        struct map_symbol *ms = browser->b.priv;
        struct disasm_line *dl = browser->selection;
-       struct symbol *sym = ms->sym;
        struct annotation *notes;
-       struct symbol *target;
-       u64 ip;
+       struct addr_map_symbol target = {
+               .map = ms->map,
+               .addr = map__objdump_2mem(ms->map, dl->ops.target.addr),
+       };
        char title[SYM_TITLE_MAX_SIZE];
 
        if (!ins__is_call(dl->ins))
                return false;
 
-       ip = ms->map->map_ip(ms->map, dl->ops.target.addr);
-       target = map__find_symbol(ms->map, ip, NULL);
-       if (target == NULL) {
+       if (map_groups__find_ams(&target, NULL) ||
+           map__rip_2objdump(target.map, target.map->map_ip(target.map,
+                                                            target.addr)) !=
+           dl->ops.target.addr) {
                ui_helpline__puts("The called function was not found.");
                return true;
        }
 
-       notes = symbol__annotation(target);
+       notes = symbol__annotation(target.sym);
        pthread_mutex_lock(&notes->lock);
 
-       if (notes->src == NULL && symbol__alloc_hist(target) < 0) {
+       if (notes->src == NULL && symbol__alloc_hist(target.sym) < 0) {
                pthread_mutex_unlock(&notes->lock);
                ui__warning("Not enough memory for annotating '%s' symbol!\n",
-                           target->name);
+                           target.sym->name);
                return true;
        }
 
        pthread_mutex_unlock(&notes->lock);
-       symbol__tui_annotate(target, ms->map, evsel, hbt);
-       sym_title(sym, ms->map, title, sizeof(title));
+       symbol__tui_annotate(target.sym, target.map, evsel, hbt);
+       sym_title(ms->sym, ms->map, title, sizeof(title));
        ui_browser__show_title(&browser->b, title);
        return true;
 }