Skip to content

Perf tools: perf-regs bug fix and optimization

Dapeng Mi linux-arm-kernel linux-csky linux-perf-users linux-riscv lkml 1 version Applied

Status from this message: Thanks, applied to perf-tools-next,

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest4 patches 5 repliesApplied 2/4

Changes in v3 from the cover letter

* Fix the abort issue for "-I" or "--user-regs" options. (Patch 1/4)
* Address Ian's comments.

Patches in v3 Applied · 2/4

#Subject and filesSizeRepliesApplied
1/4perf regs: Fix abort for "-I" or "--user-regs" optionstools/perf/util/parse-regs-options.c+6 -71 replyApplied
2/4perf arch: Update arch headers to use relative UAPI pathstools/perf/arch/arm/include/perf_regs.h tools/perf/arch/arm64/include/perf_regs.h tools/perf/arch/csky/include/perf_regs.h +6 more+9 -90 repliesApplied
3/4perf regs: Remove __weak attributive arch__xxx_reg_mask() functionstools/perf/arch/arm/util/Build tools/perf/arch/arm/util/perf_regs.c tools/perf/arch/arm64/util/perf_regs.c +27 more+332 -2361 reply
4/4perf regs: Remove __weak attributive arch_sdt_arg_parse_op() functiontools/perf/arch/arm64/util/Build tools/perf/arch/arm64/util/perf_regs.c tools/perf/arch/powerpc/util/Build +9 more+441 -4731 reply

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchIan Rogers
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [Patch v3 0/4] Perf tools: perf-regs bug fix and optimization

Changes:
v2 -> v3:
* Fix the abort issue for "-I" or "--user-regs" options. (Patch 1/4)
* Address Ian's comments.

v1 -> v2:
* Fixing "PERF_REG_EXTENDED_MASK" redefinition building error by changing the "asm/perf_regs.h" header path to relative UAPI path. (Patch 1/3)
* Spliting xxx_reg_mask() and xxx_sdt_arg_parse_op() conversion into 2 patches.

This patch-set remove the below three architecture specific __weak functions and converted them into the general architecture specific functions which are dispatched base on "em_machine".

uint64_t arch__intr_reg_mask(void);
uint64_t arch__user_reg_mask(void);
int arch_sdt_arg_parse_op(char *old_op, char **new_op);

The advantage of this conversion is that these architectural functions can be called even for a different architecture with host instead of only called on the host architecture.

Although the converted functions shown below can be called on any architecture, currently they are still only called for the host architecture (EM_HOST).

int perf_sdt_arg_parse_op(uint16_t e_machine, char *old_op, char **new_op); uint64_t perf_intr_reg_mask(uint16_t e_machine);
uint64_t perf_user_reg_mask(uint16_t e_machine);

Tests:
* This patch-set is only tested on x86 platforms. No issues are found for both intr-regs and user-regs options.
* Tests on other architectures are welcomed and appreciated.

History:
v1: https://lore.kernel.org/all/[email protected]/
v2: https://lore.kernel.org/all/[email protected]/

Dapeng Mi (4):
perf regs: Fix abort for "-I" or "--user-regs" options perf arch: Update arch headers to use relative UAPI paths perf regs: Remove __weak attributive arch__xxx_reg_mask() functions perf regs: Remove __weak attributive arch_sdt_arg_parse_op() function

 tools/perf/arch/arm/include/perf_regs.h       |   2 +-
 tools/perf/arch/arm/util/Build                |   2 -
 tools/perf/arch/arm/util/perf_regs.c          |  13 -
 tools/perf/arch/arm64/include/perf_regs.h     |   2 +-
 tools/perf/arch/arm64/util/Build              |   1 -
 tools/perf/arch/arm64/util/perf_regs.c        | 141 ---------
 tools/perf/arch/csky/Build                    |   1 -
 tools/perf/arch/csky/include/perf_regs.h      |   2 +-
 tools/perf/arch/csky/util/Build               |   1 -
 tools/perf/arch/csky/util/perf_regs.c         |  13 -
 tools/perf/arch/loongarch/include/perf_regs.h |   2 +-
 tools/perf/arch/loongarch/util/Build          |   1 -
 tools/perf/arch/loongarch/util/perf_regs.c    |  13 -
 tools/perf/arch/mips/include/perf_regs.h      |   2 +-
 tools/perf/arch/mips/util/Build               |   1 -
 tools/perf/arch/mips/util/perf_regs.c         |  13 -
 tools/perf/arch/powerpc/include/perf_regs.h   |   2 +-
 tools/perf/arch/powerpc/util/Build            |   1 -
 tools/perf/arch/powerpc/util/perf_regs.c      | 172 -----------
 tools/perf/arch/riscv/include/perf_regs.h     |   9 +-
 tools/perf/arch/riscv/util/Build              |   1 -
 tools/perf/arch/riscv/util/perf_regs.c        |  13 -
 tools/perf/arch/s390/include/perf_regs.h      |   2 +-
 tools/perf/arch/s390/util/Build               |   1 -
 tools/perf/arch/s390/util/perf_regs.c         |  13 -
 tools/perf/arch/x86/include/perf_regs.h       |   2 +-
 tools/perf/arch/x86/util/Build                |   1 -
 tools/perf/arch/x86/util/perf_regs.c          | 283 ------------------
 tools/perf/util/evsel.c                       |   4 +-
 tools/perf/util/parse-regs-options.c          |  13 +-
 .../util/perf-regs-arch/perf_regs_aarch64.c   | 139 ++++++++-
 .../perf/util/perf-regs-arch/perf_regs_arm.c  |   7 +-
 .../perf/util/perf-regs-arch/perf_regs_csky.c |   7 +-
 .../util/perf-regs-arch/perf_regs_loongarch.c |   7 +-
 .../perf/util/perf-regs-arch/perf_regs_mips.c |   7 +-
 .../util/perf-regs-arch/perf_regs_powerpc.c   | 183 ++++++++++-
 .../util/perf-regs-arch/perf_regs_riscv.c     |   7 +-
 .../perf/util/perf-regs-arch/perf_regs_s390.c |   7 +-
 .../perf/util/perf-regs-arch/perf_regs_x86.c  | 281 ++++++++++++++++-
 tools/perf/util/perf_regs.c                   | 109 ++++++-
 tools/perf/util/perf_regs.h                   |  27 +-
 tools/perf/util/probe-file.c                  |   3 +-
 42 files changed, 787 insertions(+), 724 deletions(-)
 delete mode 100644 tools/perf/arch/arm/util/perf_regs.c
 delete mode 100644 tools/perf/arch/arm64/util/perf_regs.c
 delete mode 100644 tools/perf/arch/csky/Build
 delete mode 100644 tools/perf/arch/csky/util/Build
 delete mode 100644 tools/perf/arch/csky/util/perf_regs.c
 delete mode 100644 tools/perf/arch/loongarch/util/perf_regs.c
 delete mode 100644 tools/perf/arch/mips/util/perf_regs.c
 delete mode 100644 tools/perf/arch/powerpc/util/perf_regs.c
 delete mode 100644 tools/perf/arch/riscv/util/perf_regs.c
 delete mode 100644 tools/perf/arch/s390/util/perf_regs.c
 delete mode 100644 tools/perf/arch/x86/util/perf_regs.c
Signature · 1 line
2.34.1