perf regs: Remove __weak attributive arch__xxx_reg_mask() functions
authorDapeng Mi <dapeng1.mi@linux.intel.com>
Tue, 3 Feb 2026 02:43:55 +0000 (10:43 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 6 Feb 2026 15:16:09 +0000 (12:16 -0300)
commit16dccbb84203196dab2e578b27c3c8f549ebff66
tree1608d43e47a08345406fa07d400a7ed7fb814077
parente716e69cf67bb45c49653b884f88d8e97f454f50
perf regs: Remove __weak attributive arch__xxx_reg_mask() functions

Currently, some architecture-specific perf-regs functions, such as
arch__intr_reg_mask() and arch__user_reg_mask(), are defined with the
__weak attribute.

This approach ensures that only functions matching the architecture of
the build/run host are compiled and executed, reducing build time and
binary size.

However, this __weak attribute restricts these functions to be called
only on the same architecture, preventing cross-architecture
functionality.

For example, a perf.data file captured on x86 cannot be parsed on an ARM
platform.

To address this limitation, this patch removes the __weak attribute from
these perf-regs functions.

The architecture-specific code is moved from the arch/ directory to the
util/perf-regs-arch/ directory.

The appropriate architectural functions are then called based on the
EM_HOST.

No functional changes are intended.

Suggested-by: Ian Rogers <irogers@google.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Guo Ren <guoren@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <pjw@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Falcon <thomas.falcon@intel.com>
Cc: Will Deacon <will@kernel.org>
Cc: Xudong Hao <xudong.hao@intel.com>
Cc: Zide Chen <zide.chen@intel.com>
[ Fixed up somme fuzz with s390 and riscv Build files wrt removing perf_regs.o ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
30 files changed:
tools/perf/arch/arm/util/Build
tools/perf/arch/arm/util/perf_regs.c [deleted file]
tools/perf/arch/arm64/util/perf_regs.c
tools/perf/arch/csky/Build [deleted file]
tools/perf/arch/csky/util/Build [deleted file]
tools/perf/arch/csky/util/perf_regs.c [deleted file]
tools/perf/arch/loongarch/util/Build
tools/perf/arch/loongarch/util/perf_regs.c [deleted file]
tools/perf/arch/mips/util/Build
tools/perf/arch/mips/util/perf_regs.c [deleted file]
tools/perf/arch/powerpc/util/perf_regs.c
tools/perf/arch/riscv/include/perf_regs.h
tools/perf/arch/riscv/util/Build
tools/perf/arch/riscv/util/perf_regs.c [deleted file]
tools/perf/arch/s390/util/Build
tools/perf/arch/s390/util/perf_regs.c [deleted file]
tools/perf/arch/x86/util/perf_regs.c
tools/perf/util/evsel.c
tools/perf/util/parse-regs-options.c
tools/perf/util/perf-regs-arch/perf_regs_aarch64.c
tools/perf/util/perf-regs-arch/perf_regs_arm.c
tools/perf/util/perf-regs-arch/perf_regs_csky.c
tools/perf/util/perf-regs-arch/perf_regs_loongarch.c
tools/perf/util/perf-regs-arch/perf_regs_mips.c
tools/perf/util/perf-regs-arch/perf_regs_powerpc.c
tools/perf/util/perf-regs-arch/perf_regs_riscv.c
tools/perf/util/perf-regs-arch/perf_regs_s390.c
tools/perf/util/perf-regs-arch/perf_regs_x86.c
tools/perf/util/perf_regs.c
tools/perf/util/perf_regs.h