Re: [PATCH 14/18] perf tools: Make vmlinux short name more like kallsyms short name

From: Namhyung Kim
Date: Mon Nov 10 2014 - 01:14:00 EST


Hi Jiri,

On Sun, 9 Nov 2014 08:51:26 +0100, Jiri Olsa wrote:
> On Thu, Nov 06, 2014 at 06:04:35PM -0300, Arnaldo Carvalho de Melo wrote:
>> From: Namhyung Kim <namhyung@xxxxxxxxxx>
>>
>> The previous patch changed kernel dso name from '[kernel.kallsyms]' to
>> vmlinux. However it might add confusion to old users accustomed to the
>> old name. So change the short name to '[kernel.vmlinux]' to reduce such
>> confusion.
>>
>
> SNIP
>
>> Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
>> ---
>> tools/perf/util/machine.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
>> index 53f90e9c65fe..52e94902afb1 100644
>> --- a/tools/perf/util/machine.c
>> +++ b/tools/perf/util/machine.c
>> @@ -1106,6 +1106,9 @@ static int machine__process_kernel_mmap_event(struct machine *machine,
>> if (__machine__create_kernel_maps(machine, kernel) < 0)
>> goto out_problem;
>>
>> + if (strstr(dso->long_name, "vmlinux"))
>> + dso__set_short_name(dso, "[kernel.vmlinux]", false);
>> +
>
> heya,
> I've got attached segfault in perf script because of this,
> if I revert it's ok..

Oops, sorry. It seems somehow to fail to find a matching kernel dso
from the build-id table.. anyway we need to access 'kernel' instead of
'dso' since it might be invalid at this time.

Could you please check below patch?