]> git.ipfire.org Git - thirdparty/linux.git/commit
perf regs: Refactor use of arch__sample_reg_masks() to perf_reg_name()
authorIan Rogers <irogers@google.com>
Wed, 21 Jan 2026 02:17:35 +0000 (18:17 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 23 Jan 2026 19:58:39 +0000 (16:58 -0300)
commit3d06db9bad1ad8e67c3981964cfba224c07fc306
tree4cba2cc9756a27f3a999eba7678662f332e1ac71
parentf0d98c78f8bf73ce2a9b7793f66cda240fa9ab10
perf regs: Refactor use of arch__sample_reg_masks() to perf_reg_name()

arch__sample_reg_masks isn't supported on ARM(32), csky, loongarch,
MIPS, RISC-V and s390.

The table returned by the function just has the name of a register
paired with the corresponding sample_regs_user mask value.

For a given perf register we can compute the name with perf_reg_name and
the mask is just 1 left-shifted by the perf register number.

Change __parse_regs to use this method for finding registers rather than
arch__sample_reg_masks, thereby adding __parse_regs support for ARM(32),
csky, loongarch, MIPS, RISC-V and s390.

As arch__sample_reg_masks is then unused, remove the now unneeded
declarations.

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Thomas Richter <tmricht@linux.ibm.com>
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Athira Rajeev <atrajeev@linux.ibm.com>
Cc: Chun-Tse Shao <ctshao@google.com>
Cc: Dapeng Mi <dapeng1.mi@linux.intel.com>
Cc: Dmitriy Vyukov <dvyukov@google.com>
Cc: Dr. David Alan Gilbert <linux@treblig.org>
Cc: Guo Ren <guoren@kernel.org>
Cc: Haibo Xu <haibo1.xu@intel.com>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Krzysztof Ɓopatowski <krzysztof.m.lopatowski@gmail.com>
Cc: Leo Yan <leo.yan@linux.dev>
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: Sergei Trofimovich <slyich@gmail.com>
Cc: Shimin Guo <shimin.guo@skydio.com>
Cc: Stephen Brennan <stephen.s.brennan@oracle.com>
Cc: Thomas Falcon <thomas.falcon@intel.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
14 files changed:
tools/perf/arch/arm/util/perf_regs.c
tools/perf/arch/arm64/util/machine.c
tools/perf/arch/arm64/util/perf_regs.c
tools/perf/arch/csky/util/perf_regs.c
tools/perf/arch/loongarch/util/perf_regs.c
tools/perf/arch/mips/util/perf_regs.c
tools/perf/arch/powerpc/util/perf_regs.c
tools/perf/arch/riscv/util/perf_regs.c
tools/perf/arch/s390/util/perf_regs.c
tools/perf/arch/x86/util/perf_regs.c
tools/perf/util/arm64-frame-pointer-unwind-support.c
tools/perf/util/parse-regs-options.c
tools/perf/util/perf_regs.c
tools/perf/util/perf_regs.h