[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9d7ciaMJuG-LgOGoT-u2qwXp8Tk=Zb3ZJPCzA1oQN9hk5ENA@mail.gmail.com>
Date: Fri, 30 Sep 2022 10:19:00 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Henry Castro <hcvcastro@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
linux-perf-users <linux-perf-users@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] perf: fix the probe finder location (.dwo files)
Hello,
On Thu, Sep 29, 2022 at 2:00 PM Henry Castro <hcvcastro@...il.com> wrote:
>
> If the file object is compiled using -gsplit-dwarf,
> the probe finder location will fail.
>
> Signed-off-by: Henry Castro <hcvcastro@...il.com>
> ---
> tools/perf/util/probe-finder.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
> index 50d861a80f57..6d7c5461251d 100644
> --- a/tools/perf/util/probe-finder.c
> +++ b/tools/perf/util/probe-finder.c
> @@ -1161,7 +1161,8 @@ static int debuginfo__find_probe_location(struct debuginfo *dbg,
> struct perf_probe_point *pp = &pf->pev->point;
> Dwarf_Off off, noff;
> size_t cuhl;
> - Dwarf_Die *diep;
> + Dwarf_Die *diep, cudie, subdie;
> + uint8_t unit_type;
> int ret = 0;
>
> off = 0;
> @@ -1200,6 +1201,14 @@ static int debuginfo__find_probe_location(struct debuginfo *dbg,
> continue;
> }
>
> + /* Check separate debug information file. */
> + if (dwarf_cu_info(pf->cu_die.cu, NULL, &unit_type, &cudie,
> + &subdie, NULL, NULL, NULL))
It seems dwarf_cu_info was introduced in elfutils 0.171 which
was released in June 2018. I hope all the test setups have
more recent versions.
> + continue;
> +
> + if (unit_type == DW_UT_skeleton)
> + pf->cu_die = subdie;
Is this DWARF5 thing? Will it handle the previous version well?
IOW wouldn't dwarf_cu_info() return fail?
Anyway I think it'd be safer to do
if (dwarf_cu_info() == 0 && unit_type == skeleton)
pf->cu_die = subdie;
Thanks,
Namhyung
> +
> /* Check if target file is included. */
> if (pp->file)
> pf->fname = cu_find_realpath(&pf->cu_die, pp->file);
> --
> 2.20.1
>
Powered by blists - more mailing lists