From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Ian Rogers <irogers@google.com>,
Kan Liang <kan.liang@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-perf-users@vger.kernel.org,
Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCH] perf tools: Use symfs when opening debuginfo by path
Date: Thu, 13 Feb 2025 09:26:01 +0900 [thread overview]
Message-ID: <20250213092601.186507efa09e71bac9b898b6@kernel.org> (raw)
In-Reply-To: <20250212221445.437481-1-namhyung@kernel.org>
On Wed, 12 Feb 2025 14:14:45 -0800
Namhyung Kim <namhyung@kernel.org> wrote:
> I found that it failed to load a binary using --symfs option. Say I
> have a binary in /home/user/prog/xxx and a perf data file with it. If I
> move them to a different machine and use --symfs, it tries to find the
> binary in some locations under symfs using dso__read_binary_type_filename(),
> but not the last one.
>
> ${symfs}/usr/lib/debug/home/user/prog/xxx.debug
> ${symfs}/usr/lib/debug/home/user/prog/xxx
> ${symfs}/home/user/prog/.debug/xxx
> /home/user/prog/xxx
>
> It should check ${symfs}/home/usr/prog/xxx. Let's fix it.
>
> Cc: Masami Hiramatsu <mhiramat@kernel.org>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Good catch! This looks good to me.
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Thanks!
> ---
> tools/perf/util/debuginfo.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/debuginfo.c b/tools/perf/util/debuginfo.c
> index 19acf4775d3587a4..b5deea7cbdf24620 100644
> --- a/tools/perf/util/debuginfo.c
> +++ b/tools/perf/util/debuginfo.c
> @@ -125,8 +125,12 @@ struct debuginfo *debuginfo__new(const char *path)
> dso__put(dso);
>
> out:
> + if (dinfo)
> + return dinfo;
> +
> /* if failed to open all distro debuginfo, open given binary */
> - return dinfo ? : __debuginfo__new(path);
> + symbol__join_symfs(buf, path);
> + return __debuginfo__new(buf);
> }
>
> void debuginfo__delete(struct debuginfo *dbg)
> --
> 2.48.1.502.g6dc24dfdaf-goog
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next prev parent reply other threads:[~2025-02-13 0:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 22:14 [PATCH] perf tools: Use symfs when opening debuginfo by path Namhyung Kim
2025-02-12 22:25 ` Ian Rogers
2025-02-13 0:26 ` Masami Hiramatsu [this message]
2025-02-13 17:21 ` Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250213092601.186507efa09e71bac9b898b6@kernel.org \
--to=mhiramat@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox