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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAP-5=fXUw=LLXX6Pzrab37TTrVrMdHJim1QOnvbP9gXsRQZFUg@mail.gmail.com>
Date: Tue, 20 Jan 2026 23:10:01 -0800
From: Ian Rogers <irogers@...gle.com>
To: "Mi, Dapeng" <dapeng1.mi@...ux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>, Peter Zijlstra <peterz@...radead.org>, 
	Ingo Molnar <mingo@...hat.com>, Namhyung Kim <namhyung@...nel.org>, Jiri Olsa <jolsa@...nel.org>, 
	Adrian Hunter <adrian.hunter@...el.com>, James Clark <james.clark@...aro.org>, 
	John Garry <john.g.garry@...cle.com>, Will Deacon <will@...nel.org>, Leo Yan <leo.yan@...ux.dev>, 
	Guo Ren <guoren@...nel.org>, Paul Walmsley <pjw@...nel.org>, Palmer Dabbelt <palmer@...belt.com>, 
	Albert Ou <aou@...s.berkeley.edu>, Alexandre Ghiti <alex@...ti.fr>, 
	Shimin Guo <shimin.guo@...dio.com>, Athira Rajeev <atrajeev@...ux.ibm.com>, 
	Stephen Brennan <stephen.s.brennan@...cle.com>, Howard Chu <howardchu95@...il.com>, 
	Thomas Falcon <thomas.falcon@...el.com>, Andi Kleen <ak@...ux.intel.com>, 
	"Dr. David Alan Gilbert" <linux@...blig.org>, Dmitry Vyukov <dvyukov@...gle.com>, 
	Krzysztof Łopatowski <krzysztof.m.lopatowski@...il.com>, 
	Chun-Tse Shao <ctshao@...gle.com>, Aditya Bodkhe <aditya.b1@...ux.ibm.com>, 
	Haibo Xu <haibo1.xu@...el.com>, Sergei Trofimovich <slyich@...il.com>, linux-kernel@...r.kernel.org, 
	linux-perf-users@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, 
	linux-csky@...r.kernel.org, linux-riscv@...ts.infradead.org, 
	Mark Wielaard <mark@...mp.org>
Subject: Re: [PATCH v1 08/23] perf perf_regs: Switch from arch string to int e_machine

On Tue, Jan 20, 2026 at 10:58 PM Mi, Dapeng <dapeng1.mi@...ux.intel.com> wrote:
>
>
> On 1/21/2026 2:49 AM, Arnaldo Carvalho de Melo wrote:
> > On Fri, Jan 16, 2026 at 09:28:34PM -0800, Ian Rogers wrote:
> >> The arch string requires multiple strcmp to identify things like the
> >> IP and SP. Switch to passing in an e_machine that in the bulk of cases
> >> is computed using a current thread load. The e_machine also allows
> >> identification of 32-bit vs 64-bit processes.
> >>
> >> Signed-off-by: Ian Rogers <irogers@...gle.com>
> >> ---
> >>  tools/perf/builtin-script.c                   |  17 ++-
> >>  tools/perf/util/evsel.c                       |  14 ++-
> >>  tools/perf/util/perf_regs.c                   | 105 +++++++++++-------
> > [ Include dwarf-regs.h to get conditional defines for EM_CSKY and EM_LOONGARCH, not available in old distros ]
> >
> > - Arnaldo
>
> Seems the change would introduce the below building error.
>
> util/perf_regs.c: In function ‘perf_reg_name’:
> util/perf_regs.c:48:14: error: ‘EM_LOONGARCH’ undeclared (first use in this
> function)
>    48 |         case EM_LOONGARCH:
>       |              ^~~~~~~~~~~~
> util/perf_regs.c:48:14: note: each undeclared identifier is reported only
> once for each function it appears in
> util/perf_regs.c: In function ‘perf_arch_reg_ip’:
> util/perf_regs.c:114:14: error: ‘EM_LOONGARCH’ undeclared (first use in
> this function)
>   114 |         case EM_LOONGARCH:
>       |              ^~~~~~~~~~~~
> util/perf_regs.c: In function ‘perf_arch_reg_sp’:
> util/perf_regs.c:143:14: error: ‘EM_LOONGARCH’ undeclared (first use in
> this function)
>   143 |         case EM_LOONGARCH:
>       |              ^~~~~~~~~~~~
>
> It looks EM_LOONGARCH is not defined in the <elf.h> header file, not sure
> which one is better, include  dwarf-regs.h suggested by Arnaldo or direct
> add the define,
>
> diff --git a/tools/perf/util/perf_regs.c b/tools/perf/util/perf_regs.c
> index b58d59b84fb1..ce839df19fa3 100644
> --- a/tools/perf/util/perf_regs.c
> +++ b/tools/perf/util/perf_regs.c
> @@ -6,6 +6,10 @@
>  #include "util/sample.h"
>  #include "debug.h"
>
> +#ifndef EM_LOONGARCH
> +#define EM_LOONGARCH           258
> +#endif

Or #include <dwarf-regs.h> which I think is the fix Arnaldo is
carrying at the moment.

Thanks,
Ian

> +
>  int __weak arch_sdt_arg_parse_op(char *old_op __maybe_unused,
>                                  char **new_op __maybe_unused)
>  {
>
>
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ