[PATCH v12 00/19] perf: Use e_machine and lazily compute symbols

Ian Rogers posted 19 patches 5 days, 11 hours ago
tools/perf/arch/common.c                      |  92 +++--
tools/perf/builtin-c2c.c                      |  40 +-
tools/perf/builtin-inject.c                   |  10 +-
tools/perf/builtin-kwork.c                    |   2 +-
tools/perf/builtin-report.c                   |   2 +-
tools/perf/builtin-sched.c                    |   4 +-
tools/perf/builtin-top.c                      |   7 +-
tools/perf/builtin-trace.c                    |   7 +-
tools/perf/tests/symbols.c                    |   2 +-
tools/perf/tests/topology.c                   |   8 +-
tools/perf/tests/vmlinux-kallsyms.c           |   2 +-
tools/perf/trace/beauty/Build                 |   1 +
tools/perf/trace/beauty/arch_errno_names.sh   |  53 ++-
tools/perf/ui/browsers/annotate.c             |   2 +-
tools/perf/ui/browsers/map.c                  |   4 +-
tools/perf/util/annotate.c                    |   5 +-
tools/perf/util/auxtrace.c                    |   6 +-
tools/perf/util/callchain.c                   |   4 +-
tools/perf/util/capstone.c                    | 132 ++++--
tools/perf/util/data-convert-bt.c             |   2 +-
tools/perf/util/data-convert-json.c           |   6 +-
tools/perf/util/dlfilter.c                    |   2 +-
tools/perf/util/dso.c                         |  19 +-
tools/perf/util/dso.h                         |  14 +-
tools/perf/util/env.c                         | 376 ++++++++++++++----
tools/perf/util/env.h                         |  14 +-
tools/perf/util/evsel_fprintf.c               |   6 +-
tools/perf/util/header.c                      |  55 ++-
tools/perf/util/intel-pt.c                    |   2 +-
tools/perf/util/libdw.c                       |   2 +-
tools/perf/util/lock-contention.c             |   6 +-
tools/perf/util/machine.c                     |  37 +-
tools/perf/util/machine.h                     |   2 -
tools/perf/util/print_insn.c                  |  23 +-
tools/perf/util/print_insn.h                  |   2 +
tools/perf/util/probe-event.c                 |   4 +-
tools/perf/util/sample-raw.c                  |  21 +-
tools/perf/util/sample-raw.h                  |   6 +-
.../util/scripting-engines/trace-event-perl.c |   2 +-
.../scripting-engines/trace-event-python.c    |   4 +-
tools/perf/util/session.c                     |  26 +-
tools/perf/util/sort.c                        |  66 +--
tools/perf/util/srcline.c                     |  10 +-
tools/perf/util/symbol-elf.c                  |   5 +-
tools/perf/util/symbol.c                      | 238 ++++++++---
tools/perf/util/symbol.h                      |  80 +++-
tools/perf/util/symbol_fprintf.c              |   4 +-
tools/perf/util/thread.c                      |  58 ++-
tools/perf/util/thread.h                      |  23 +-
49 files changed, 1078 insertions(+), 420 deletions(-)
[PATCH v12 00/19] perf: Use e_machine and lazily compute symbols
Posted by Ian Rogers 5 days, 11 hours ago
Add a helper to perf_env to compute the e_machine if it is EM_NONE.
Derive the value from the arch string if available. Similarly derive
the arch string from the ELF machine if available, for consistency.
This means perf's arch (machine type) is no longer determined by uname
but set to match that of the perf ELF executable.

Migrate code away from strcmp on env->arch to using the e_machine
comparisons that are more accurate and not prone to uname and other
naming differences. While cleaning this up, also clean up the
capstone initialization code to cover more architectures and to set
the big endian flag based on ELF header information.

Refactor perf_env__arch_strerrno to take an e_machine instead of an
architecture string, removing the HAVE_LIBTRACEEVENT dependency
entirely and making it unconditionally available. The generated errno
table includes fallback definitions for newer ELF machine constants to
ensure compatibility with older host glibc versions.

Introduce a mutex in perf_env to safely protect lazy metadata setup,
such as os_release or e_machine resolution, preventing concurrent
initialization data races and memory leaks during multi-threaded
profiling or symbol loading. Properly initialize stack-allocated
perf_env instances to ensure safe mutex destruction.

Switch the idle computation to the point of use and lazily compute it,
rather than computing it for every symbol. The current only user is
`perf top`. At the point of use the perf_env is available and this can
be used to make sure the idle function computation correctly accounts
for architecture-specific and kernel-version-specific patterns.
To prevent concurrent updates to shared symbol bitfield flags, migrate
bitfield variables in struct symbol to C11 atomic flags.

Ian Rogers (19):
  perf env: Add perf_env__e_machine helper and use in perf_env__arch
  perf tests topology: Switch env->arch use to env->e_machine
  perf env, dso, thread: Add _endian variants for e_machine helpers
  perf capstone: Determine architecture from e_machine
  perf print_insn: Use e_machine for fallback IP length check
  perf symbol: Avoid use of machine__is
  perf machine: Use perf_env e_machine rather than arch
  perf sample-raw: Use perf_env e_machine rather than arch
  perf sort: Use perf_env e_machine rather than arch
  perf arch common: Use perf_env e_machine rather than arch
  perf header: In print_pmu_caps use perf_env e_machine
  perf c2c: Use perf_env e_machine rather than arch
  perf lock-contention: Use perf_env e_machine rather than arch
  perf env: Refactor perf_env__arch_strerrno
  perf env: Remove unused perf_env__raw_arch
  perf env: Add mutex to protect lazy environment initialization
  perf env: Add helper to lazily compute the os_release
  perf symbol: Add setters for bitfields sharing a byte to avoid
    concurrent update issues
  perf symbol: Lazily compute idle

 tools/perf/arch/common.c                      |  92 +++--
 tools/perf/builtin-c2c.c                      |  40 +-
 tools/perf/builtin-inject.c                   |  10 +-
 tools/perf/builtin-kwork.c                    |   2 +-
 tools/perf/builtin-report.c                   |   2 +-
 tools/perf/builtin-sched.c                    |   4 +-
 tools/perf/builtin-top.c                      |   7 +-
 tools/perf/builtin-trace.c                    |   7 +-
 tools/perf/tests/symbols.c                    |   2 +-
 tools/perf/tests/topology.c                   |   8 +-
 tools/perf/tests/vmlinux-kallsyms.c           |   2 +-
 tools/perf/trace/beauty/Build                 |   1 +
 tools/perf/trace/beauty/arch_errno_names.sh   |  53 ++-
 tools/perf/ui/browsers/annotate.c             |   2 +-
 tools/perf/ui/browsers/map.c                  |   4 +-
 tools/perf/util/annotate.c                    |   5 +-
 tools/perf/util/auxtrace.c                    |   6 +-
 tools/perf/util/callchain.c                   |   4 +-
 tools/perf/util/capstone.c                    | 132 ++++--
 tools/perf/util/data-convert-bt.c             |   2 +-
 tools/perf/util/data-convert-json.c           |   6 +-
 tools/perf/util/dlfilter.c                    |   2 +-
 tools/perf/util/dso.c                         |  19 +-
 tools/perf/util/dso.h                         |  14 +-
 tools/perf/util/env.c                         | 376 ++++++++++++++----
 tools/perf/util/env.h                         |  14 +-
 tools/perf/util/evsel_fprintf.c               |   6 +-
 tools/perf/util/header.c                      |  55 ++-
 tools/perf/util/intel-pt.c                    |   2 +-
 tools/perf/util/libdw.c                       |   2 +-
 tools/perf/util/lock-contention.c             |   6 +-
 tools/perf/util/machine.c                     |  37 +-
 tools/perf/util/machine.h                     |   2 -
 tools/perf/util/print_insn.c                  |  23 +-
 tools/perf/util/print_insn.h                  |   2 +
 tools/perf/util/probe-event.c                 |   4 +-
 tools/perf/util/sample-raw.c                  |  21 +-
 tools/perf/util/sample-raw.h                  |   6 +-
 .../util/scripting-engines/trace-event-perl.c |   2 +-
 .../scripting-engines/trace-event-python.c    |   4 +-
 tools/perf/util/session.c                     |  26 +-
 tools/perf/util/sort.c                        |  66 +--
 tools/perf/util/srcline.c                     |  10 +-
 tools/perf/util/symbol-elf.c                  |   5 +-
 tools/perf/util/symbol.c                      | 238 ++++++++---
 tools/perf/util/symbol.h                      |  80 +++-
 tools/perf/util/symbol_fprintf.c              |   4 +-
 tools/perf/util/thread.c                      |  58 ++-
 tools/perf/util/thread.h                      |  23 +-
 49 files changed, 1078 insertions(+), 420 deletions(-)

-- 
2.54.0.929.g9b7fa37559-goog
Re: [PATCH v12 00/19] perf: Use e_machine and lazily compute symbols
Posted by Ian Rogers 5 days, 10 hours ago
On Tue, Jun 2, 2026 at 8:25 AM Ian Rogers <irogers@google.com> wrote:
>
> Add a helper to perf_env to compute the e_machine if it is EM_NONE.
> Derive the value from the arch string if available. Similarly derive
> the arch string from the ELF machine if available, for consistency.
> This means perf's arch (machine type) is no longer determined by uname
> but set to match that of the perf ELF executable.
>
> Migrate code away from strcmp on env->arch to using the e_machine
> comparisons that are more accurate and not prone to uname and other
> naming differences. While cleaning this up, also clean up the
> capstone initialization code to cover more architectures and to set
> the big endian flag based on ELF header information.
>
> Refactor perf_env__arch_strerrno to take an e_machine instead of an
> architecture string, removing the HAVE_LIBTRACEEVENT dependency
> entirely and making it unconditionally available. The generated errno
> table includes fallback definitions for newer ELF machine constants to
> ensure compatibility with older host glibc versions.
>
> Introduce a mutex in perf_env to safely protect lazy metadata setup,
> such as os_release or e_machine resolution, preventing concurrent
> initialization data races and memory leaks during multi-threaded
> profiling or symbol loading. Properly initialize stack-allocated
> perf_env instances to ensure safe mutex destruction.
>
> Switch the idle computation to the point of use and lazily compute it,
> rather than computing it for every symbol. The current only user is
> `perf top`. At the point of use the perf_env is available and this can
> be used to make sure the idle function computation correctly accounts
> for architecture-specific and kernel-version-specific patterns.
> To prevent concurrent updates to shared symbol bitfield flags, migrate
> bitfield variables in struct symbol to C11 atomic flags.

So I think this series is at the point where Sashiko [1] is giving
warnings only for out-of-scope things and pre-existing conditions. I
will give a detailed explanation below, but I'd appreciate help moving
this forward with human review and submission. Thanks!

> Ian Rogers (19):
>   perf env: Add perf_env__e_machine helper and use in perf_env__arch

1 critical 2 high issues.
The issues relate to existing data races, the inaccurate arch string,
and normalizing the arch string stored in the data file. The existing
data races don't bite us currently due to the single threaded nature
of most of perf - multithreading is on the TODO list. The arch string
is inaccurate and the e_machine in newer perf.data files resolves
this. If we were using the arch string without the e_machine then the
concerns over its use are valid, but this series is trying to remove
the use of the arch string and strongly prefer the e_machine.

>   perf tests topology: Switch env->arch use to env->e_machine

No regressions.

>   perf env, dso, thread: Add _endian variants for e_machine helpers

1 high issue for a potential pre-existing SEGV if a thread lacks maps.
Let's hope that doesn't happen, the example given assumes a
multithreaded environment and multi-threading is on the TODO list.

>   perf capstone: Determine architecture from e_machine

1 low issue. A flag only present in capstone 4.0 is used. As capstone
4.0 was released in 2018, let's just assume the flag is there rather
than adding yet more complexity.

>   perf print_insn: Use e_machine for fallback IP length check

No regressions.

>   perf symbol: Avoid use of machine__is

1 high issue. Concerns over pre-existing cross-platform analysis
problems. Cross-platform analysis fully working is on the TODO list.

>   perf machine: Use perf_env e_machine rather than arch
>   perf sample-raw: Use perf_env e_machine rather than arch
>   perf sort: Use perf_env e_machine rather than arch
>   perf arch common: Use perf_env e_machine rather than arch
>   perf header: In print_pmu_caps use perf_env e_machine
>   perf c2c: Use perf_env e_machine rather than arch
>   perf lock-contention: Use perf_env e_machine rather than arch
>   perf env: Refactor perf_env__arch_strerrno
>   perf env: Remove unused perf_env__raw_arch

No regressions x9.

>   perf env: Add mutex to protect lazy environment initialization

1 medium issue requesting more locking on more bits of perf_env.
Multi-threading is on the TODO list and let's stop the feature creep
here.

>   perf env: Add helper to lazily compute the os_release

1 high issue. Concern over a perf data issue in pipe mode. Addressing
this would require a fairly major overhail of perf data, so let's add
fixing to the TODO list.

>   perf symbol: Add setters for bitfields sharing a byte to avoid
>     concurrent update issues
>   perf symbol: Lazily compute idle

No regressions x2.

Thanks,
Ian

[1] https://sashiko.dev/#/patchset/20260602152516.2831152-1-irogers%40google.com

>
>  tools/perf/arch/common.c                      |  92 +++--
>  tools/perf/builtin-c2c.c                      |  40 +-
>  tools/perf/builtin-inject.c                   |  10 +-
>  tools/perf/builtin-kwork.c                    |   2 +-
>  tools/perf/builtin-report.c                   |   2 +-
>  tools/perf/builtin-sched.c                    |   4 +-
>  tools/perf/builtin-top.c                      |   7 +-
>  tools/perf/builtin-trace.c                    |   7 +-
>  tools/perf/tests/symbols.c                    |   2 +-
>  tools/perf/tests/topology.c                   |   8 +-
>  tools/perf/tests/vmlinux-kallsyms.c           |   2 +-
>  tools/perf/trace/beauty/Build                 |   1 +
>  tools/perf/trace/beauty/arch_errno_names.sh   |  53 ++-
>  tools/perf/ui/browsers/annotate.c             |   2 +-
>  tools/perf/ui/browsers/map.c                  |   4 +-
>  tools/perf/util/annotate.c                    |   5 +-
>  tools/perf/util/auxtrace.c                    |   6 +-
>  tools/perf/util/callchain.c                   |   4 +-
>  tools/perf/util/capstone.c                    | 132 ++++--
>  tools/perf/util/data-convert-bt.c             |   2 +-
>  tools/perf/util/data-convert-json.c           |   6 +-
>  tools/perf/util/dlfilter.c                    |   2 +-
>  tools/perf/util/dso.c                         |  19 +-
>  tools/perf/util/dso.h                         |  14 +-
>  tools/perf/util/env.c                         | 376 ++++++++++++++----
>  tools/perf/util/env.h                         |  14 +-
>  tools/perf/util/evsel_fprintf.c               |   6 +-
>  tools/perf/util/header.c                      |  55 ++-
>  tools/perf/util/intel-pt.c                    |   2 +-
>  tools/perf/util/libdw.c                       |   2 +-
>  tools/perf/util/lock-contention.c             |   6 +-
>  tools/perf/util/machine.c                     |  37 +-
>  tools/perf/util/machine.h                     |   2 -
>  tools/perf/util/print_insn.c                  |  23 +-
>  tools/perf/util/print_insn.h                  |   2 +
>  tools/perf/util/probe-event.c                 |   4 +-
>  tools/perf/util/sample-raw.c                  |  21 +-
>  tools/perf/util/sample-raw.h                  |   6 +-
>  .../util/scripting-engines/trace-event-perl.c |   2 +-
>  .../scripting-engines/trace-event-python.c    |   4 +-
>  tools/perf/util/session.c                     |  26 +-
>  tools/perf/util/sort.c                        |  66 +--
>  tools/perf/util/srcline.c                     |  10 +-
>  tools/perf/util/symbol-elf.c                  |   5 +-
>  tools/perf/util/symbol.c                      | 238 ++++++++---
>  tools/perf/util/symbol.h                      |  80 +++-
>  tools/perf/util/symbol_fprintf.c              |   4 +-
>  tools/perf/util/thread.c                      |  58 ++-
>  tools/perf/util/thread.h                      |  23 +-
>  49 files changed, 1078 insertions(+), 420 deletions(-)
>
> --
> 2.54.0.929.g9b7fa37559-goog
>
Re: [PATCH v12 00/19] perf: Use e_machine and lazily compute symbols
Posted by Namhyung Kim 4 days, 21 hours ago
Hi Ian,

On Tue, Jun 02, 2026 at 09:53:59AM -0700, Ian Rogers wrote:
> On Tue, Jun 2, 2026 at 8:25 AM Ian Rogers <irogers@google.com> wrote:
> >
> > Add a helper to perf_env to compute the e_machine if it is EM_NONE.
> > Derive the value from the arch string if available. Similarly derive
> > the arch string from the ELF machine if available, for consistency.
> > This means perf's arch (machine type) is no longer determined by uname
> > but set to match that of the perf ELF executable.
> >
> > Migrate code away from strcmp on env->arch to using the e_machine
> > comparisons that are more accurate and not prone to uname and other
> > naming differences. While cleaning this up, also clean up the
> > capstone initialization code to cover more architectures and to set
> > the big endian flag based on ELF header information.
> >
> > Refactor perf_env__arch_strerrno to take an e_machine instead of an
> > architecture string, removing the HAVE_LIBTRACEEVENT dependency
> > entirely and making it unconditionally available. The generated errno
> > table includes fallback definitions for newer ELF machine constants to
> > ensure compatibility with older host glibc versions.
> >
> > Introduce a mutex in perf_env to safely protect lazy metadata setup,
> > such as os_release or e_machine resolution, preventing concurrent
> > initialization data races and memory leaks during multi-threaded
> > profiling or symbol loading. Properly initialize stack-allocated
> > perf_env instances to ensure safe mutex destruction.
> >
> > Switch the idle computation to the point of use and lazily compute it,
> > rather than computing it for every symbol. The current only user is
> > `perf top`. At the point of use the perf_env is available and this can
> > be used to make sure the idle function computation correctly accounts
> > for architecture-specific and kernel-version-specific patterns.
> > To prevent concurrent updates to shared symbol bitfield flags, migrate
> > bitfield variables in struct symbol to C11 atomic flags.
> 
> So I think this series is at the point where Sashiko [1] is giving
> warnings only for out-of-scope things and pre-existing conditions. I
> will give a detailed explanation below, but I'd appreciate help moving
> this forward with human review and submission. Thanks!
> 
> > Ian Rogers (19):
> >   perf env: Add perf_env__e_machine helper and use in perf_env__arch
> 
> 1 critical 2 high issues.
> The issues relate to existing data races, the inaccurate arch string,
> and normalizing the arch string stored in the data file. The existing
> data races don't bite us currently due to the single threaded nature
> of most of perf - multithreading is on the TODO list. The arch string
> is inaccurate and the e_machine in newer perf.data files resolves
> this. If we were using the arch string without the e_machine then the
> concerns over its use are valid, but this series is trying to remove
> the use of the arch string and strongly prefer the e_machine.
> 
> >   perf tests topology: Switch env->arch use to env->e_machine
> 
> No regressions.
> 
> >   perf env, dso, thread: Add _endian variants for e_machine helpers
> 
> 1 high issue for a potential pre-existing SEGV if a thread lacks maps.
> Let's hope that doesn't happen, the example given assumes a
> multithreaded environment and multi-threading is on the TODO list.
> 
> >   perf capstone: Determine architecture from e_machine
> 
> 1 low issue. A flag only present in capstone 4.0 is used. As capstone
> 4.0 was released in 2018, let's just assume the flag is there rather
> than adding yet more complexity.
> 
> >   perf print_insn: Use e_machine for fallback IP length check
> 
> No regressions.
> 
> >   perf symbol: Avoid use of machine__is
> 
> 1 high issue. Concerns over pre-existing cross-platform analysis
> problems. Cross-platform analysis fully working is on the TODO list.
> 
> >   perf machine: Use perf_env e_machine rather than arch
> >   perf sample-raw: Use perf_env e_machine rather than arch
> >   perf sort: Use perf_env e_machine rather than arch
> >   perf arch common: Use perf_env e_machine rather than arch
> >   perf header: In print_pmu_caps use perf_env e_machine
> >   perf c2c: Use perf_env e_machine rather than arch
> >   perf lock-contention: Use perf_env e_machine rather than arch
> >   perf env: Refactor perf_env__arch_strerrno
> >   perf env: Remove unused perf_env__raw_arch
> 
> No regressions x9.
> 
> >   perf env: Add mutex to protect lazy environment initialization
> 
> 1 medium issue requesting more locking on more bits of perf_env.
> Multi-threading is on the TODO list and let's stop the feature creep
> here.
> 
> >   perf env: Add helper to lazily compute the os_release
> 
> 1 high issue. Concern over a perf data issue in pipe mode. Addressing
> this would require a fairly major overhail of perf data, so let's add
> fixing to the TODO list.
> 
> >   perf symbol: Add setters for bitfields sharing a byte to avoid
> >     concurrent update issues
> >   perf symbol: Lazily compute idle
> 
> No regressions x2.

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

Re: [PATCH v12 00/19] perf: Use e_machine and lazily compute symbols
Posted by Arnaldo Carvalho de Melo 4 days, 7 hours ago
On Tue, Jun 02, 2026 at 10:39:49PM -0700, Namhyung Kim wrote:
> On Tue, Jun 02, 2026 at 09:53:59AM -0700, Ian Rogers wrote:
> > On Tue, Jun 2, 2026 at 8:25 AM Ian Rogers <irogers@google.com> wrote:
> > >
> > > Add a helper to perf_env to compute the e_machine if it is EM_NONE.
> > > Derive the value from the arch string if available. Similarly derive
> > > the arch string from the ELF machine if available, for consistency.
> > > This means perf's arch (machine type) is no longer determined by uname
> > > but set to match that of the perf ELF executable.
> > >
> > > Migrate code away from strcmp on env->arch to using the e_machine
> > > comparisons that are more accurate and not prone to uname and other
> > > naming differences. While cleaning this up, also clean up the
> > > capstone initialization code to cover more architectures and to set
> > > the big endian flag based on ELF header information.
> > >
> > > Refactor perf_env__arch_strerrno to take an e_machine instead of an
> > > architecture string, removing the HAVE_LIBTRACEEVENT dependency
> > > entirely and making it unconditionally available. The generated errno
> > > table includes fallback definitions for newer ELF machine constants to
> > > ensure compatibility with older host glibc versions.
> > >
> > > Introduce a mutex in perf_env to safely protect lazy metadata setup,
> > > such as os_release or e_machine resolution, preventing concurrent
> > > initialization data races and memory leaks during multi-threaded
> > > profiling or symbol loading. Properly initialize stack-allocated
> > > perf_env instances to ensure safe mutex destruction.
> > >
> > > Switch the idle computation to the point of use and lazily compute it,
> > > rather than computing it for every symbol. The current only user is
> > > `perf top`. At the point of use the perf_env is available and this can
> > > be used to make sure the idle function computation correctly accounts
> > > for architecture-specific and kernel-version-specific patterns.
> > > To prevent concurrent updates to shared symbol bitfield flags, migrate
> > > bitfield variables in struct symbol to C11 atomic flags.
> > 
> > So I think this series is at the point where Sashiko [1] is giving
> > warnings only for out-of-scope things and pre-existing conditions. I
> > will give a detailed explanation below, but I'd appreciate help moving
> > this forward with human review and submission. Thanks!
> > 
> > > Ian Rogers (19):
> > >   perf env: Add perf_env__e_machine helper and use in perf_env__arch
> > 
> > 1 critical 2 high issues.
> > The issues relate to existing data races, the inaccurate arch string,
> > and normalizing the arch string stored in the data file. The existing
> > data races don't bite us currently due to the single threaded nature
> > of most of perf - multithreading is on the TODO list. The arch string
> > is inaccurate and the e_machine in newer perf.data files resolves
> > this. If we were using the arch string without the e_machine then the
> > concerns over its use are valid, but this series is trying to remove
> > the use of the arch string and strongly prefer the e_machine.
> > 
> > >   perf tests topology: Switch env->arch use to env->e_machine
> > 
> > No regressions.
> > 
> > >   perf env, dso, thread: Add _endian variants for e_machine helpers
> > 
> > 1 high issue for a potential pre-existing SEGV if a thread lacks maps.
> > Let's hope that doesn't happen, the example given assumes a
> > multithreaded environment and multi-threading is on the TODO list.
> > 
> > >   perf capstone: Determine architecture from e_machine
> > 
> > 1 low issue. A flag only present in capstone 4.0 is used. As capstone
> > 4.0 was released in 2018, let's just assume the flag is there rather
> > than adding yet more complexity.
> > 
> > >   perf print_insn: Use e_machine for fallback IP length check
> > 
> > No regressions.
> > 
> > >   perf symbol: Avoid use of machine__is
> > 
> > 1 high issue. Concerns over pre-existing cross-platform analysis
> > problems. Cross-platform analysis fully working is on the TODO list.
> > 
> > >   perf machine: Use perf_env e_machine rather than arch
> > >   perf sample-raw: Use perf_env e_machine rather than arch
> > >   perf sort: Use perf_env e_machine rather than arch
> > >   perf arch common: Use perf_env e_machine rather than arch
> > >   perf header: In print_pmu_caps use perf_env e_machine
> > >   perf c2c: Use perf_env e_machine rather than arch
> > >   perf lock-contention: Use perf_env e_machine rather than arch
> > >   perf env: Refactor perf_env__arch_strerrno
> > >   perf env: Remove unused perf_env__raw_arch
> > 
> > No regressions x9.
> > 
> > >   perf env: Add mutex to protect lazy environment initialization
> > 
> > 1 medium issue requesting more locking on more bits of perf_env.
> > Multi-threading is on the TODO list and let's stop the feature creep
> > here.
> > 
> > >   perf env: Add helper to lazily compute the os_release
> > 
> > 1 high issue. Concern over a perf data issue in pipe mode. Addressing
> > this would require a fairly major overhail of perf data, so let's add
> > fixing to the TODO list.
> > 
> > >   perf symbol: Add setters for bitfields sharing a byte to avoid
> > >     concurrent update issues
> > >   perf symbol: Lazily compute idle
> > 
> > No regressions x2.
> 
> Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks, applied to perf-tools-next, for v7.2.

- Arnaldo
Re: [PATCH v12 00/19] perf: Use e_machine and lazily compute symbols
Posted by Arnaldo Carvalho de Melo 4 days, 5 hours ago
On Wed, Jun 03, 2026 at 04:47:52PM -0300, Arnaldo Carvalho de Melo wrote:
> On Tue, Jun 02, 2026 at 10:39:49PM -0700, Namhyung Kim wrote:
> > On Tue, Jun 02, 2026 at 09:53:59AM -0700, Ian Rogers wrote:
> > > On Tue, Jun 2, 2026 at 8:25 AM Ian Rogers <irogers@google.com> wrote:
> > > 1 high issue. Concern over a perf data issue in pipe mode. Addressing
> > > this would require a fairly major overhail of perf data, so let's add
> > > fixing to the TODO list.

> > > >   perf symbol: Add setters for bitfields sharing a byte to avoid
> > > >     concurrent update issues
> > > >   perf symbol: Lazily compute idle

> > > No regressions x2.

> > Acked-by: Namhyung Kim <namhyung@kernel.org>

> Thanks, applied to perf-tools-next, for v7.2.

Now trying to fix this, all old distros, but if the fix is cheap
enough, lets not drop support for them:

toolsbuilder@five:~$ cat dm.log/summary
Subject: tools build test for http://192.168.86.5/perf/perf-7.1.0-rc5.tar.xz

   1   127.96 almalinux:8                   : Ok   gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-28) , clang version 21.1.8 ( 21.1.8-1.module_el8.10.0+4172+b6b13d75) flex 2.6.1
   2    12.44 almalinux:9                   : FAIL gcc version 11.5.0 20240719 (Red Hat 11.5.0-14) (GCC)
    util/capstone.c: In function 'e_machine_to_capstone':
    util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
      186 |                 *arch = CS_ARCH_RISCV;
          |                         ^~~~~~~~~~~~~
          |                         CS_ARCH_SYSZ
    util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
    util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                  ^~~~~~~~~~~~~~~
          |                                  CS_MODE_MIPS64
    util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                    ^~~~~~~~~~~~~~~
          |                                                    CS_MODE_MIPS32
    util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                                       ^~~~~~~~~~~~~~
          |                                                                       CS_MODE_MICRO
   3    17.54 almalinux:9-i386              : FAIL gcc version 11.4.1 20231218 (Red Hat 11.4.1-3) (GCC)
    util/capstone.c: In function ‘e_machine_to_capstone’:
    util/capstone.c:186:25: error: ‘CS_ARCH_RISCV’ undeclared (first use in this function); did you mean ‘CS_ARCH_SYSZ’?
      186 |                 *arch = CS_ARCH_RISCV;
          |                         ^~~~~~~~~~~~~
          |                         CS_ARCH_SYSZ
    util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
    util/capstone.c:187:34: error: ‘CS_MODE_RISCV64’ undeclared (first use in this function); did you mean ‘CS_MODE_MIPS64’?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                  ^~~~~~~~~~~~~~~
          |                                  CS_MODE_MIPS64
    util/capstone.c:187:52: error: ‘CS_MODE_RISCV32’ undeclared (first use in this function); did you mean ‘CS_MODE_MIPS32’?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                    ^~~~~~~~~~~~~~~
          |                                                    CS_MODE_MIPS32
    util/capstone.c:187:71: error: ‘CS_MODE_RISCVC’ undeclared (first use in this function); did you mean ‘CS_MODE_MICRO’?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                                       ^~~~~~~~~~~~~~
          |                                                                       CS_MODE_MICRO
   4   101.24 almalinux:10                  : Ok   gcc (GCC) 14.3.1 20251022 (Red Hat 14.3.1-4) , clang version 21.1.8 (AlmaLinux OS Foundation 21.1.8-1.el10.alma.1) flex 2.6.4
   5    21.66 alpine:3.16                   : FAIL gcc version 11.2.1 20220219 (Alpine 11.2.1_git20220219)
    util/capstone.c: In function 'e_machine_to_capstone':
    util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
      186 |                 *arch = CS_ARCH_RISCV;
          |                         ^~~~~~~~~~~~~
          |                         CS_ARCH_SYSZ
    util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
    util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                  ^~~~~~~~~~~~~~~
          |                                  CS_MODE_MIPS64
    util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                    ^~~~~~~~~~~~~~~
          |                                                    CS_MODE_MIPS32
    util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                                       ^~~~~~~~~~~~~~
          |                                                                       CS_MODE_MICRO
    make[3]: *** [/git/perf-7.1.0-rc5/tools/build/Makefile.build:158: util] Error 2
   6    14.57 alpine:3.17                   : FAIL gcc version 12.2.1 20220924 (Alpine 12.2.1_git20220924-r4)
    util/capstone.c: In function 'e_machine_to_capstone':
    util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
      186 |                 *arch = CS_ARCH_RISCV;
          |                         ^~~~~~~~~~~~~
          |                         CS_ARCH_SYSZ
    util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
    util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                  ^~~~~~~~~~~~~~~
          |                                  CS_MODE_MIPS64
    util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                    ^~~~~~~~~~~~~~~
          |                                                    CS_MODE_MIPS32
    util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                                       ^~~~~~~~~~~~~~
          |                                                                       CS_MODE_MICRO
    make[3]: *** [/git/perf-7.1.0-rc5/tools/build/Makefile.build:158: util] Error 2
   7    13.58 alpine:3.18                   : FAIL gcc version 12.2.1 20220924 (Alpine 12.2.1_git20220924-r10)
    util/capstone.c: In function 'e_machine_to_capstone':
    util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
      186 |                 *arch = CS_ARCH_RISCV;
          |                         ^~~~~~~~~~~~~
          |                         CS_ARCH_SYSZ
    util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
    util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                  ^~~~~~~~~~~~~~~
          |                                  CS_MODE_MIPS64
    util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                    ^~~~~~~~~~~~~~~
          |                                                    CS_MODE_MIPS32
    util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                                       ^~~~~~~~~~~~~~
          |                                                                       CS_MODE_MICRO
   8   127.15 alpine:3.19                   : Ok   gcc (Alpine 13.2.1_git20231014) 13.2.1 20231014 , Alpine clang version 17.0.5 flex 2.6.4
   9   124.98 alpine:3.20                   : Ok   gcc (Alpine 13.2.1_git20240309) 13.2.1 20240309 , Alpine clang version 17.0.6 flex 2.6.4
  10   134.36 alpine:3.22                   : Ok   gcc (Alpine 14.2.0) 14.2.0 , Alpine clang version 20.1.8 flex 2.6.4
  11   128.47 alpine:3.23                   : Ok   gcc (Alpine 15.2.0) 15.2.0 , Alpine clang version 21.1.2 flex 2.6.4
  12   134.59 alpine:edge                   : Ok   gcc (Alpine 14.2.0) 14.2.0 , Alpine clang version 19.1.4 flex 2.6.4
  13    13.41 amazonlinux:2023              : FAIL gcc version 11.5.0 20240719 (Red Hat 11.5.0-5) (GCC)
    util/capstone.c: In function 'e_machine_to_capstone':
    util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
      186 |                 *arch = CS_ARCH_RISCV;
          |                         ^~~~~~~~~~~~~
          |                         CS_ARCH_SYSZ
    util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
    util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                  ^~~~~~~~~~~~~~~
          |                                  CS_MODE_MIPS64
    util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                    ^~~~~~~~~~~~~~~
          |                                                    CS_MODE_MIPS32
    util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                                       ^~~~~~~~~~~~~~
          |                                                                       CS_MODE_MICRO
    make[3]: *** [/git/perf-7.1.0-rc5/tools/build/Makefile.build:158: util] Error 2
  14    14.14 amazonlinux:devel             : FAIL gcc version 11.3.1 20221121 (Red Hat 11.3.1-4) (GCC)
    util/capstone.c: In function 'e_machine_to_capstone':
    util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
      186 |                 *arch = CS_ARCH_RISCV;
          |                         ^~~~~~~~~~~~~
          |                         CS_ARCH_SYSZ
    util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
    util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                  ^~~~~~~~~~~~~~~
          |                                  CS_MODE_MIPS64
    util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                    ^~~~~~~~~~~~~~~
          |                                                    CS_MODE_MIPS32
    util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                                       ^~~~~~~~~~~~~~
          |                                                                       CS_MODE_MICRO
    make[3]: *** [/git/perf-7.1.0-rc5/tools/build/Makefile.build:158: util] Error 2
  15   116.53 archlinux:base                : Ok   gcc (GCC) 15.2.1 20250813 , clang version 20.1.8 flex 2.6.4
  16   130.36 centos:stream                 : Ok   gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-21) , clang version 17.0.6 (Red Hat 17.0.6-1.module_el8+767+9fa966b8) flex 2.6.1
  17   123.85 clearlinux:latest             : Ok   gcc (Clear Linux OS for Intel Architecture) 15.1.1 20250602 releases/gcc-15.1.0-174-gc096341a08 , clang version 20.1.0 flex 2.6.4
  18    12.15 debian:10                     : FAIL gcc version 8.3.0 (Debian 8.3.0-6)
    util/capstone.c: In function 'e_machine_to_capstone':
    util/capstone.c:186:11: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
       *arch = CS_ARCH_RISCV;
               ^~~~~~~~~~~~~
               CS_ARCH_SYSZ
    util/capstone.c:186:11: note: each undeclared identifier is reported only once for each function it appears in
    util/capstone.c:187:20: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
       *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
                        ^~~~~~~~~~~~~~~
                        CS_MODE_MIPS64
    util/capstone.c:187:38: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
       *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
                                          ^~~~~~~~~~~~~~~
                                          CS_MODE_MIPS32
    util/capstone.c:187:57: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
       *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
                                                             ^~~~~~~~~~~~~~
                                                             CS_MODE_MICRO
  19    12.08 debian:11                     : FAIL gcc version 10.2.1 20210110 (Debian 10.2.1-6)
    util/capstone.c: In function 'e_machine_to_capstone':
    util/capstone.c:186:11: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
      186 |   *arch = CS_ARCH_RISCV;
          |           ^~~~~~~~~~~~~
          |           CS_ARCH_SYSZ
    util/capstone.c:186:11: note: each undeclared identifier is reported only once for each function it appears in
    util/capstone.c:187:20: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
      187 |   *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                    ^~~~~~~~~~~~~~~
          |                    CS_MODE_MIPS64
    util/capstone.c:187:38: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
      187 |   *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                      ^~~~~~~~~~~~~~~
          |                                      CS_MODE_MIPS32
    util/capstone.c:187:57: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
      187 |   *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                         ^~~~~~~~~~~~~~
          |                                                         CS_MODE_MICRO
  20    12.30 debian:12                     : FAIL gcc version 12.2.0 (Debian 12.2.0-14+deb12u1)
    util/capstone.c: In function 'e_machine_to_capstone':
    util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
      186 |                 *arch = CS_ARCH_RISCV;
          |                         ^~~~~~~~~~~~~
          |                         CS_ARCH_SYSZ
    util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
    util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                  ^~~~~~~~~~~~~~~
          |                                  CS_MODE_MIPS64
    util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                    ^~~~~~~~~~~~~~~
          |                                                    CS_MODE_MIPS32
    util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                                       ^~~~~~~~~~~~~~
          |                                                                       CS_MODE_MICRO
  21    94.47 debian:13                     : Ok   gcc (Debian 14.2.0-19) 14.2.0 , Debian clang version 19.1.7 (3+b1) flex 2.6.4
  22   104.26 debian:experimental           : Ok   gcc (Debian 15.2.0-17) 15.2.0 , Debian clang version 21.1.8 (7+b1) flex 2.6.4
  23    26.18 debian:experimental-x-arm64   : Ok   aarch64-linux-gnu-gcc (Debian 15.2.0-17) 15.2.0  flex 2.6.4
  24    19.18 debian:experimental-x-mips    : Ok   mips-linux-gnu-gcc (Debian 14.2.0-13) 14.2.0  flex 2.6.4
  25    19.94 debian:experimental-x-mips64  : Ok   mips64-linux-gnuabi64-gcc (Debian 14.2.0-13) 14.2.0  flex 2.6.4
  26    19.03 debian:experimental-x-mipsel  : Ok   mipsel-linux-gnu-gcc (Debian 14.2.0-13) 14.2.0  flex 2.6.4
  27    14.16 fedora:35                     : FAIL gcc version 11.3.1 20220421 (Red Hat 11.3.1-3) (GCC)
    util/capstone.c: In function 'e_machine_to_capstone':
    util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
      186 |                 *arch = CS_ARCH_RISCV;
          |                         ^~~~~~~~~~~~~
          |                         CS_ARCH_SYSZ
    util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
    util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                  ^~~~~~~~~~~~~~~
          |                                  CS_MODE_MIPS64
    util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                    ^~~~~~~~~~~~~~~
          |                                                    CS_MODE_MIPS32
    util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                                       ^~~~~~~~~~~~~~
          |                                                                       CS_MODE_MICRO
  28    13.01 fedora:36                     : FAIL gcc version 12.2.1 20221121 (Red Hat 12.2.1-4) (GCC)
    util/capstone.c: In function 'e_machine_to_capstone':
    util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
      186 |                 *arch = CS_ARCH_RISCV;
          |                         ^~~~~~~~~~~~~
          |                         CS_ARCH_SYSZ
    util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
    util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                  ^~~~~~~~~~~~~~~
          |                                  CS_MODE_MIPS64
    util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                    ^~~~~~~~~~~~~~~
          |                                                    CS_MODE_MIPS32
    util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                                       ^~~~~~~~~~~~~~
          |                                                                       CS_MODE_MICRO
  29    11.56 fedora:37                     : FAIL gcc version 12.3.1 20230508 (Red Hat 12.3.1-1) (GCC)
    util/capstone.c: In function 'e_machine_to_capstone':
    util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
      186 |                 *arch = CS_ARCH_RISCV;
          |                         ^~~~~~~~~~~~~
          |                         CS_ARCH_SYSZ
    util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
    util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                  ^~~~~~~~~~~~~~~
          |                                  CS_MODE_MIPS64
    util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                    ^~~~~~~~~~~~~~~
          |                                                    CS_MODE_MIPS32
    util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                                       ^~~~~~~~~~~~~~
          |                                                                       CS_MODE_MICRO
  30    11.70 fedora:38                     : FAIL gcc version 13.2.1 20231011 (Red Hat 13.2.1-4) (GCC)
    util/capstone.c: In function 'e_machine_to_capstone':
    util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
      186 |                 *arch = CS_ARCH_RISCV;
          |                         ^~~~~~~~~~~~~
          |                         CS_ARCH_SYSZ
    util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
    util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                  ^~~~~~~~~~~~~~~
          |                                  CS_MODE_MIPS64
    util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                    ^~~~~~~~~~~~~~~
          |                                                    CS_MODE_MIPS32
    util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                                       ^~~~~~~~~~~~~~
          |                                                                       CS_MODE_MICRO
  31    12.18 fedora:39                     : FAIL gcc version 13.3.1 20240913 (Red Hat 13.3.1-3) (GCC)
    util/capstone.c: In function 'e_machine_to_capstone':
    util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
      186 |                 *arch = CS_ARCH_RISCV;
          |                         ^~~~~~~~~~~~~
          |                         CS_ARCH_SYSZ
    util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
    util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                  ^~~~~~~~~~~~~~~
          |                                  CS_MODE_MIPS64
    util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                    ^~~~~~~~~~~~~~~
          |                                                    CS_MODE_MIPS32
    util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
      187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
          |                                                                       ^~~~~~~~~~~~~~
          |                                                                       CS_MODE_MICRO
  32   111.06 fedora:40                     : Ok   gcc (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3) , clang version 18.1.8 (Fedora 18.1.8-2.fc40) flex 2.6.4
  33   107.16 fedora:41                     : Ok   gcc (GCC) 14.3.1 20251022 (Red Hat 14.3.1-4) , clang version 19.1.7 (Fedora 19.1.7-5.fc41) flex 2.6.4
  34   106.95 fedora:42                     : Ok   gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7) , clang version 20.1.8 (Fedora 20.1.8-4.fc42) flex 2.6.4
  35   103.93 fedora:43                     : Ok   gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7) , clang version 21.1.8 (Fedora 21.1.8-4.fc43) flex 2.6.4
  36   108.14 fedora:44                     : Ok   gcc (GCC) 16.1.1 20260515 (Red Hat 16.1.1-2) , clang version 22.1.6 (Fedora 22.1.6-1.fc44) flex 2.6.4
  37   109.25 fedora:45                     : Ok   gcc (GCC) 16.1.1 20260515 (Red Hat 16.1.1-2) , clang version 22.1.6 (Fedora 22.1.6-1.fc45) flex 2.6.4
  38   106.11 fedora:rawhide                : Ok   gcc (GCC) 16.1.1 20260515 (Red Hat 16.1.1-2) , clang version 22.1.6 (Fedora 22.1.6-1.fc45) flex 2.6.4
  39    43.21 gentoo:stage3                 : Ok   gcc (Gentoo 13.3.1_p20240614 p17) 13.3.1 20240614  flex 2.6.4
toolsbuilder@five:~$


Re: [PATCH v12 00/19] perf: Use e_machine and lazily compute symbols
Posted by Arnaldo Carvalho de Melo 4 days, 5 hours ago
On Wed, Jun 03, 2026 at 06:41:27PM -0300, Arnaldo Carvalho de Melo wrote:
> On Wed, Jun 03, 2026 at 04:47:52PM -0300, Arnaldo Carvalho de Melo wrote:
> > On Tue, Jun 02, 2026 at 10:39:49PM -0700, Namhyung Kim wrote:
> > > On Tue, Jun 02, 2026 at 09:53:59AM -0700, Ian Rogers wrote:
> > > > On Tue, Jun 2, 2026 at 8:25 AM Ian Rogers <irogers@google.com> wrote:
> > > > 1 high issue. Concern over a perf data issue in pipe mode. Addressing
> > > > this would require a fairly major overhail of perf data, so let's add
> > > > fixing to the TODO list.
> 
> > > > >   perf symbol: Add setters for bitfields sharing a byte to avoid
> > > > >     concurrent update issues
> > > > >   perf symbol: Lazily compute idle
> 
> > > > No regressions x2.
> 
> > > Acked-by: Namhyung Kim <namhyung@kernel.org>
> 
> > Thanks, applied to perf-tools-next, for v7.2.
> 
> Now trying to fix this, all old distros, but if the fix is cheap
> enough, lets not drop support for them:

It is an enum, so too much work to cope with that, I'll disable capstone
build in these systems.

- Arnaldo
 
> toolsbuilder@five:~$ cat dm.log/summary
> Subject: tools build test for http://192.168.86.5/perf/perf-7.1.0-rc5.tar.xz
> 
>    1   127.96 almalinux:8                   : Ok   gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-28) , clang version 21.1.8 ( 21.1.8-1.module_el8.10.0+4172+b6b13d75) flex 2.6.1
>    2    12.44 almalinux:9                   : FAIL gcc version 11.5.0 20240719 (Red Hat 11.5.0-14) (GCC)
>     util/capstone.c: In function 'e_machine_to_capstone':
>     util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
>       186 |                 *arch = CS_ARCH_RISCV;
>           |                         ^~~~~~~~~~~~~
>           |                         CS_ARCH_SYSZ
>     util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
>     util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                  ^~~~~~~~~~~~~~~
>           |                                  CS_MODE_MIPS64
>     util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                    ^~~~~~~~~~~~~~~
>           |                                                    CS_MODE_MIPS32
>     util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                                       ^~~~~~~~~~~~~~
>           |                                                                       CS_MODE_MICRO
>    3    17.54 almalinux:9-i386              : FAIL gcc version 11.4.1 20231218 (Red Hat 11.4.1-3) (GCC)
>     util/capstone.c: In function ‘e_machine_to_capstone’:
>     util/capstone.c:186:25: error: ‘CS_ARCH_RISCV’ undeclared (first use in this function); did you mean ‘CS_ARCH_SYSZ’?
>       186 |                 *arch = CS_ARCH_RISCV;
>           |                         ^~~~~~~~~~~~~
>           |                         CS_ARCH_SYSZ
>     util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
>     util/capstone.c:187:34: error: ‘CS_MODE_RISCV64’ undeclared (first use in this function); did you mean ‘CS_MODE_MIPS64’?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                  ^~~~~~~~~~~~~~~
>           |                                  CS_MODE_MIPS64
>     util/capstone.c:187:52: error: ‘CS_MODE_RISCV32’ undeclared (first use in this function); did you mean ‘CS_MODE_MIPS32’?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                    ^~~~~~~~~~~~~~~
>           |                                                    CS_MODE_MIPS32
>     util/capstone.c:187:71: error: ‘CS_MODE_RISCVC’ undeclared (first use in this function); did you mean ‘CS_MODE_MICRO’?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                                       ^~~~~~~~~~~~~~
>           |                                                                       CS_MODE_MICRO
>    4   101.24 almalinux:10                  : Ok   gcc (GCC) 14.3.1 20251022 (Red Hat 14.3.1-4) , clang version 21.1.8 (AlmaLinux OS Foundation 21.1.8-1.el10.alma.1) flex 2.6.4
>    5    21.66 alpine:3.16                   : FAIL gcc version 11.2.1 20220219 (Alpine 11.2.1_git20220219)
>     util/capstone.c: In function 'e_machine_to_capstone':
>     util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
>       186 |                 *arch = CS_ARCH_RISCV;
>           |                         ^~~~~~~~~~~~~
>           |                         CS_ARCH_SYSZ
>     util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
>     util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                  ^~~~~~~~~~~~~~~
>           |                                  CS_MODE_MIPS64
>     util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                    ^~~~~~~~~~~~~~~
>           |                                                    CS_MODE_MIPS32
>     util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                                       ^~~~~~~~~~~~~~
>           |                                                                       CS_MODE_MICRO
>     make[3]: *** [/git/perf-7.1.0-rc5/tools/build/Makefile.build:158: util] Error 2
>    6    14.57 alpine:3.17                   : FAIL gcc version 12.2.1 20220924 (Alpine 12.2.1_git20220924-r4)
>     util/capstone.c: In function 'e_machine_to_capstone':
>     util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
>       186 |                 *arch = CS_ARCH_RISCV;
>           |                         ^~~~~~~~~~~~~
>           |                         CS_ARCH_SYSZ
>     util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
>     util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                  ^~~~~~~~~~~~~~~
>           |                                  CS_MODE_MIPS64
>     util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                    ^~~~~~~~~~~~~~~
>           |                                                    CS_MODE_MIPS32
>     util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                                       ^~~~~~~~~~~~~~
>           |                                                                       CS_MODE_MICRO
>     make[3]: *** [/git/perf-7.1.0-rc5/tools/build/Makefile.build:158: util] Error 2
>    7    13.58 alpine:3.18                   : FAIL gcc version 12.2.1 20220924 (Alpine 12.2.1_git20220924-r10)
>     util/capstone.c: In function 'e_machine_to_capstone':
>     util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
>       186 |                 *arch = CS_ARCH_RISCV;
>           |                         ^~~~~~~~~~~~~
>           |                         CS_ARCH_SYSZ
>     util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
>     util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                  ^~~~~~~~~~~~~~~
>           |                                  CS_MODE_MIPS64
>     util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                    ^~~~~~~~~~~~~~~
>           |                                                    CS_MODE_MIPS32
>     util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                                       ^~~~~~~~~~~~~~
>           |                                                                       CS_MODE_MICRO
>    8   127.15 alpine:3.19                   : Ok   gcc (Alpine 13.2.1_git20231014) 13.2.1 20231014 , Alpine clang version 17.0.5 flex 2.6.4
>    9   124.98 alpine:3.20                   : Ok   gcc (Alpine 13.2.1_git20240309) 13.2.1 20240309 , Alpine clang version 17.0.6 flex 2.6.4
>   10   134.36 alpine:3.22                   : Ok   gcc (Alpine 14.2.0) 14.2.0 , Alpine clang version 20.1.8 flex 2.6.4
>   11   128.47 alpine:3.23                   : Ok   gcc (Alpine 15.2.0) 15.2.0 , Alpine clang version 21.1.2 flex 2.6.4
>   12   134.59 alpine:edge                   : Ok   gcc (Alpine 14.2.0) 14.2.0 , Alpine clang version 19.1.4 flex 2.6.4
>   13    13.41 amazonlinux:2023              : FAIL gcc version 11.5.0 20240719 (Red Hat 11.5.0-5) (GCC)
>     util/capstone.c: In function 'e_machine_to_capstone':
>     util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
>       186 |                 *arch = CS_ARCH_RISCV;
>           |                         ^~~~~~~~~~~~~
>           |                         CS_ARCH_SYSZ
>     util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
>     util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                  ^~~~~~~~~~~~~~~
>           |                                  CS_MODE_MIPS64
>     util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                    ^~~~~~~~~~~~~~~
>           |                                                    CS_MODE_MIPS32
>     util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                                       ^~~~~~~~~~~~~~
>           |                                                                       CS_MODE_MICRO
>     make[3]: *** [/git/perf-7.1.0-rc5/tools/build/Makefile.build:158: util] Error 2
>   14    14.14 amazonlinux:devel             : FAIL gcc version 11.3.1 20221121 (Red Hat 11.3.1-4) (GCC)
>     util/capstone.c: In function 'e_machine_to_capstone':
>     util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
>       186 |                 *arch = CS_ARCH_RISCV;
>           |                         ^~~~~~~~~~~~~
>           |                         CS_ARCH_SYSZ
>     util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
>     util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                  ^~~~~~~~~~~~~~~
>           |                                  CS_MODE_MIPS64
>     util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                    ^~~~~~~~~~~~~~~
>           |                                                    CS_MODE_MIPS32
>     util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                                       ^~~~~~~~~~~~~~
>           |                                                                       CS_MODE_MICRO
>     make[3]: *** [/git/perf-7.1.0-rc5/tools/build/Makefile.build:158: util] Error 2
>   15   116.53 archlinux:base                : Ok   gcc (GCC) 15.2.1 20250813 , clang version 20.1.8 flex 2.6.4
>   16   130.36 centos:stream                 : Ok   gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-21) , clang version 17.0.6 (Red Hat 17.0.6-1.module_el8+767+9fa966b8) flex 2.6.1
>   17   123.85 clearlinux:latest             : Ok   gcc (Clear Linux OS for Intel Architecture) 15.1.1 20250602 releases/gcc-15.1.0-174-gc096341a08 , clang version 20.1.0 flex 2.6.4
>   18    12.15 debian:10                     : FAIL gcc version 8.3.0 (Debian 8.3.0-6)
>     util/capstone.c: In function 'e_machine_to_capstone':
>     util/capstone.c:186:11: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
>        *arch = CS_ARCH_RISCV;
>                ^~~~~~~~~~~~~
>                CS_ARCH_SYSZ
>     util/capstone.c:186:11: note: each undeclared identifier is reported only once for each function it appears in
>     util/capstone.c:187:20: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
>        *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>                         ^~~~~~~~~~~~~~~
>                         CS_MODE_MIPS64
>     util/capstone.c:187:38: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
>        *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>                                           ^~~~~~~~~~~~~~~
>                                           CS_MODE_MIPS32
>     util/capstone.c:187:57: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
>        *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>                                                              ^~~~~~~~~~~~~~
>                                                              CS_MODE_MICRO
>   19    12.08 debian:11                     : FAIL gcc version 10.2.1 20210110 (Debian 10.2.1-6)
>     util/capstone.c: In function 'e_machine_to_capstone':
>     util/capstone.c:186:11: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
>       186 |   *arch = CS_ARCH_RISCV;
>           |           ^~~~~~~~~~~~~
>           |           CS_ARCH_SYSZ
>     util/capstone.c:186:11: note: each undeclared identifier is reported only once for each function it appears in
>     util/capstone.c:187:20: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
>       187 |   *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                    ^~~~~~~~~~~~~~~
>           |                    CS_MODE_MIPS64
>     util/capstone.c:187:38: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
>       187 |   *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                      ^~~~~~~~~~~~~~~
>           |                                      CS_MODE_MIPS32
>     util/capstone.c:187:57: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
>       187 |   *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                         ^~~~~~~~~~~~~~
>           |                                                         CS_MODE_MICRO
>   20    12.30 debian:12                     : FAIL gcc version 12.2.0 (Debian 12.2.0-14+deb12u1)
>     util/capstone.c: In function 'e_machine_to_capstone':
>     util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
>       186 |                 *arch = CS_ARCH_RISCV;
>           |                         ^~~~~~~~~~~~~
>           |                         CS_ARCH_SYSZ
>     util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
>     util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                  ^~~~~~~~~~~~~~~
>           |                                  CS_MODE_MIPS64
>     util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                    ^~~~~~~~~~~~~~~
>           |                                                    CS_MODE_MIPS32
>     util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                                       ^~~~~~~~~~~~~~
>           |                                                                       CS_MODE_MICRO
>   21    94.47 debian:13                     : Ok   gcc (Debian 14.2.0-19) 14.2.0 , Debian clang version 19.1.7 (3+b1) flex 2.6.4
>   22   104.26 debian:experimental           : Ok   gcc (Debian 15.2.0-17) 15.2.0 , Debian clang version 21.1.8 (7+b1) flex 2.6.4
>   23    26.18 debian:experimental-x-arm64   : Ok   aarch64-linux-gnu-gcc (Debian 15.2.0-17) 15.2.0  flex 2.6.4
>   24    19.18 debian:experimental-x-mips    : Ok   mips-linux-gnu-gcc (Debian 14.2.0-13) 14.2.0  flex 2.6.4
>   25    19.94 debian:experimental-x-mips64  : Ok   mips64-linux-gnuabi64-gcc (Debian 14.2.0-13) 14.2.0  flex 2.6.4
>   26    19.03 debian:experimental-x-mipsel  : Ok   mipsel-linux-gnu-gcc (Debian 14.2.0-13) 14.2.0  flex 2.6.4
>   27    14.16 fedora:35                     : FAIL gcc version 11.3.1 20220421 (Red Hat 11.3.1-3) (GCC)
>     util/capstone.c: In function 'e_machine_to_capstone':
>     util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
>       186 |                 *arch = CS_ARCH_RISCV;
>           |                         ^~~~~~~~~~~~~
>           |                         CS_ARCH_SYSZ
>     util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
>     util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                  ^~~~~~~~~~~~~~~
>           |                                  CS_MODE_MIPS64
>     util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                    ^~~~~~~~~~~~~~~
>           |                                                    CS_MODE_MIPS32
>     util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                                       ^~~~~~~~~~~~~~
>           |                                                                       CS_MODE_MICRO
>   28    13.01 fedora:36                     : FAIL gcc version 12.2.1 20221121 (Red Hat 12.2.1-4) (GCC)
>     util/capstone.c: In function 'e_machine_to_capstone':
>     util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
>       186 |                 *arch = CS_ARCH_RISCV;
>           |                         ^~~~~~~~~~~~~
>           |                         CS_ARCH_SYSZ
>     util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
>     util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                  ^~~~~~~~~~~~~~~
>           |                                  CS_MODE_MIPS64
>     util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                    ^~~~~~~~~~~~~~~
>           |                                                    CS_MODE_MIPS32
>     util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                                       ^~~~~~~~~~~~~~
>           |                                                                       CS_MODE_MICRO
>   29    11.56 fedora:37                     : FAIL gcc version 12.3.1 20230508 (Red Hat 12.3.1-1) (GCC)
>     util/capstone.c: In function 'e_machine_to_capstone':
>     util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
>       186 |                 *arch = CS_ARCH_RISCV;
>           |                         ^~~~~~~~~~~~~
>           |                         CS_ARCH_SYSZ
>     util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
>     util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                  ^~~~~~~~~~~~~~~
>           |                                  CS_MODE_MIPS64
>     util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                    ^~~~~~~~~~~~~~~
>           |                                                    CS_MODE_MIPS32
>     util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                                       ^~~~~~~~~~~~~~
>           |                                                                       CS_MODE_MICRO
>   30    11.70 fedora:38                     : FAIL gcc version 13.2.1 20231011 (Red Hat 13.2.1-4) (GCC)
>     util/capstone.c: In function 'e_machine_to_capstone':
>     util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
>       186 |                 *arch = CS_ARCH_RISCV;
>           |                         ^~~~~~~~~~~~~
>           |                         CS_ARCH_SYSZ
>     util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
>     util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                  ^~~~~~~~~~~~~~~
>           |                                  CS_MODE_MIPS64
>     util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                    ^~~~~~~~~~~~~~~
>           |                                                    CS_MODE_MIPS32
>     util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                                       ^~~~~~~~~~~~~~
>           |                                                                       CS_MODE_MICRO
>   31    12.18 fedora:39                     : FAIL gcc version 13.3.1 20240913 (Red Hat 13.3.1-3) (GCC)
>     util/capstone.c: In function 'e_machine_to_capstone':
>     util/capstone.c:186:25: error: 'CS_ARCH_RISCV' undeclared (first use in this function); did you mean 'CS_ARCH_SYSZ'?
>       186 |                 *arch = CS_ARCH_RISCV;
>           |                         ^~~~~~~~~~~~~
>           |                         CS_ARCH_SYSZ
>     util/capstone.c:186:25: note: each undeclared identifier is reported only once for each function it appears in
>     util/capstone.c:187:34: error: 'CS_MODE_RISCV64' undeclared (first use in this function); did you mean 'CS_MODE_MIPS64'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                  ^~~~~~~~~~~~~~~
>           |                                  CS_MODE_MIPS64
>     util/capstone.c:187:52: error: 'CS_MODE_RISCV32' undeclared (first use in this function); did you mean 'CS_MODE_MIPS32'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                    ^~~~~~~~~~~~~~~
>           |                                                    CS_MODE_MIPS32
>     util/capstone.c:187:71: error: 'CS_MODE_RISCVC' undeclared (first use in this function); did you mean 'CS_MODE_MICRO'?
>       187 |                 *mode |= (is64 ? CS_MODE_RISCV64 : CS_MODE_RISCV32) | CS_MODE_RISCVC;
>           |                                                                       ^~~~~~~~~~~~~~
>           |                                                                       CS_MODE_MICRO
>   32   111.06 fedora:40                     : Ok   gcc (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3) , clang version 18.1.8 (Fedora 18.1.8-2.fc40) flex 2.6.4
>   33   107.16 fedora:41                     : Ok   gcc (GCC) 14.3.1 20251022 (Red Hat 14.3.1-4) , clang version 19.1.7 (Fedora 19.1.7-5.fc41) flex 2.6.4
>   34   106.95 fedora:42                     : Ok   gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7) , clang version 20.1.8 (Fedora 20.1.8-4.fc42) flex 2.6.4
>   35   103.93 fedora:43                     : Ok   gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7) , clang version 21.1.8 (Fedora 21.1.8-4.fc43) flex 2.6.4
>   36   108.14 fedora:44                     : Ok   gcc (GCC) 16.1.1 20260515 (Red Hat 16.1.1-2) , clang version 22.1.6 (Fedora 22.1.6-1.fc44) flex 2.6.4
>   37   109.25 fedora:45                     : Ok   gcc (GCC) 16.1.1 20260515 (Red Hat 16.1.1-2) , clang version 22.1.6 (Fedora 22.1.6-1.fc45) flex 2.6.4
>   38   106.11 fedora:rawhide                : Ok   gcc (GCC) 16.1.1 20260515 (Red Hat 16.1.1-2) , clang version 22.1.6 (Fedora 22.1.6-1.fc45) flex 2.6.4
>   39    43.21 gentoo:stage3                 : Ok   gcc (Gentoo 13.3.1_p20240614 p17) 13.3.1 20240614  flex 2.6.4
> toolsbuilder@five:~$
> 
>