lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250213092601.186507efa09e71bac9b898b6@kernel.org>
Date: Thu, 13 Feb 2025 09:26:01 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>, Ian Rogers
 <irogers@...gle.com>, Kan Liang <kan.liang@...ux.intel.com>, Jiri Olsa
 <jolsa@...nel.org>, Adrian Hunter <adrian.hunter@...el.com>, Peter Zijlstra
 <peterz@...radead.org>, Ingo Molnar <mingo@...nel.org>, LKML
 <linux-kernel@...r.kernel.org>, linux-perf-users@...r.kernel.org, Masami
 Hiramatsu <mhiramat@...nel.org>
Subject: Re: [PATCH] perf tools: Use symfs when opening debuginfo by path

On Wed, 12 Feb 2025 14:14:45 -0800
Namhyung Kim <namhyung@...nel.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@...nel.org>
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>

Good catch! This looks good to me.

Acked-by: Masami Hiramatsu (Google) <mhiramat@...nel.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@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ