[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e42ada3c-f215-d5a5-f766-7f8aa1580667@gmx.net>
Date: Thu, 15 Jun 2023 16:02:37 +0200
From: Georg Müller <georgmueller@....net>
To: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Steven Rostedt <rostedt@...dmis.org>,
regressions@...ts.linux.dev
Subject: Re: [PATCH v2 3/3] tools/perf: Fix to get declared file name from
clang DWARF5
Hi all,
I have found a solution for this bug and will post a patch later today.
Am 09.06.23 um 14:21 schrieb Georg Müller:
>
> Am 01.11.22 um 14:48 schrieb Masami Hiramatsu (Google):
>> From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
>>
>> Fix to get the declared file name even if it uses file index 0
>> in DWARF5, using custom die_get_decl_file() function.
>>
>
> this patch breaks perf probe on fedora 38.
>
The problem is that die_get_file_name() uses the wrong cu_die.
I was pointed to the solution by reading elfutils commit e1db5cdc9:
dwarf_decl_file uses dwarf_attr_integrate to get the DW_AT_decl_file
attribute. This means the attribute might come from a different DIE
in a different CU. If so, we need to use the CU associated with the
attribute, not the original DIE, to resolve the file name.
The correct cu_die has to be obtained via
dwarf_attr_integrate(dw_die, DW_AT_decl_file, &attr_mem)
and then cu_die from the cu from attr_mem (dwarf_cu_die(attr_mem.cu, &cu_die, ...)
to obtain it) has to be used.
Best regards,
Georg
Powered by blists - more mailing lists