Re: [PATCH 03/10] perf, tools: Use al.addr to set up call chain

From: Andi Kleen
Date: Thu Dec 11 2014 - 17:27:10 EST


> this patch also changed the output of callchain entries
> with 'map' but with no symbol, like in following diff:

Was unintentional. Patch looks good. thanks.

-Andi
>
> ---
> ---get_next_seq
> |
> - |--70.16%-- 0x40e1cf
> + |--70.16%-- 0xe1cf
> | 0x841f0f
> |
> - |--25.83%-- 0x40e153
> + |--25.83%-- 0xe153
> | 0x841f0f
> |
> - --4.00%-- 0x40e27f
> + --4.00%-- 0xe27f
> --
>
> I'm guessing this change was unintentional..? in case we have a map
> but no symbol seeing full address is more clear than relative at
> least for binary, not sure about DSOs..
>
> thoughts?
>
> thanks,
> jirka
>
>
> ---
> diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
> index 64b377e591e4..a4fb25fb26f5 100644
> --- a/tools/perf/util/callchain.c
> +++ b/tools/perf/util/callchain.c
> @@ -816,22 +816,30 @@ out:
> char *callchain_list__sym_name(struct callchain_list *cl,
> char *bf, size_t bfsize, bool show_dso)
> {
> + struct map *map = cl->ms.map;
> int printed;
>
> if (cl->ms.sym) {
> if (callchain_param.key == CCKEY_ADDRESS &&
> - cl->ms.map && !cl->srcline)
> - cl->srcline = get_srcline(cl->ms.map->dso,
> - map__rip_2objdump(cl->ms.map,
> - cl->ip),
> + map && !cl->srcline) {
> + cl->srcline = get_srcline(map->dso,
> + map__rip_2objdump(map, cl->ip),
> cl->ms.sym, false);
> + }
> if (cl->srcline)
> printed = scnprintf(bf, bfsize, "%s %s",
> cl->ms.sym->name, cl->srcline);
> else
> printed = scnprintf(bf, bfsize, "%s", cl->ms.sym->name);
> - } else
> - printed = scnprintf(bf, bfsize, "%#" PRIx64, cl->ip);
> + } else {
> + /*
> + * The cl->ip value is unbased ip (applied map->map_ip).
> + * Display the unmap ip in case we have no symbol.
> + */
> + u64 addr = map ? map->unmap_ip(map, cl->ip) : cl->ip;
> +
> + printed = scnprintf(bf, bfsize, "%#" PRIx64, addr);
> + }
>
> if (show_dso)
> scnprintf(bf + printed, bfsize - printed, " %s",
>

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/