Skip to content

Remove PERF_HAVE_DWARF_REGS

Ian Rogers linux-arm-kernel linux-csky linux-perf-users linux-riscv lkml 2 versions – Applied

Status from this message: Applied to perf-tools-next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest20 patches 1 replyApplied 20/20
  2. v320 patches 10 repliesSuperseded

Patches in v4 All 20 applied

#Subject and filesSizeRepliesApplied
1/20perf bpf-prologue: Remove unused filetools/perf/util/bpf-prologue.h+0 -370 repliesApplied
2/20perf dwarf-regs: Remove PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSETtools/perf/Makefile.config tools/perf/arch/arm64/Makefile tools/perf/arch/arm64/util/dwarf-regs.c +11 more+27 -1970 repliesApplied
3/20perf dwarf-regs: Add EM_HOST and EF_HOST definestools/perf/util/disasm.c tools/perf/util/dwarf-regs.c tools/perf/util/include/dwarf-regs.h+83 -80 repliesApplied
4/20perf disasm: Add e_machine/e_flags to struct archtools/perf/arch/arc/annotate/instructions.c tools/perf/arch/arm/annotate/instructions.c tools/perf/arch/arm64/annotate/instructions.c +9 more+30 -20 repliesApplied
5/20perf dwarf-regs: Pass accurate disassembly machine to get_dwarf_regnumtools/perf/util/annotate.c tools/perf/util/dwarf-regs.c tools/perf/util/include/dwarf-regs.h+12 -70 repliesApplied
6/20perf dwarf-regs: Pass ELF flags to get_dwarf_regstrtools/perf/util/dwarf-regs.c tools/perf/util/include/dwarf-regs.h tools/perf/util/probe-finder.c +1 more+17 -130 repliesApplied
7/20perf dwarf-regs: Move x86 dwarf-regs out of archtools/perf/arch/x86/util/Build tools/perf/util/Build tools/perf/util/dwarf-regs-x86.c +2 more+27 -260 repliesApplied
8/20perf arm64: Remove dwarf-regs.ctools/perf/arch/arm64/util/Build tools/perf/arch/arm64/util/dwarf-regs.c tools/perf/util/dwarf-regs.c +1 more+3 -840 repliesApplied
9/20perf arm: Remove dwarf-regs.ctools/perf/arch/arm/util/Build tools/perf/arch/arm/util/dwarf-regs.c tools/perf/util/dwarf-regs.c +1 more+3 -660 repliesApplied
10/20perf dwarf-regs: Move csky dwarf-regs out of archtools/perf/arch/csky/util/Build tools/perf/util/Build tools/perf/util/dwarf-regs-csky.c +2 more+20 -140 repliesApplied
11/20perf loongarch: Remove dwarf-regs.ctools/perf/arch/loongarch/util/Build tools/perf/arch/loongarch/util/dwarf-regs.c tools/perf/util/dwarf-regs.c +1 more+4 -380 repliesApplied
12/20perf mips: Remove dwarf-regs.ctools/perf/arch/mips/util/Build tools/perf/arch/mips/util/dwarf-regs.c tools/perf/util/dwarf-regs.c +1 more+3 -420 repliesApplied
13/20perf dwarf-regs: Move powerpc dwarf-regs out of archtools/perf/arch/powerpc/util/Build tools/perf/arch/powerpc/util/dwarf-regs.c tools/perf/util/Build +3 more+70 -1490 repliesApplied
14/20perf riscv: Remove dwarf-regs.c and add dwarf-regs-table.htools/perf/arch/riscv/include/dwarf-regs-table.h tools/perf/arch/riscv/util/Build tools/perf/util/dwarf-regs.c +1 more+12 -300 repliesApplied
15/20perf s390: Remove dwarf-regs.ctools/perf/arch/s390/util/Build tools/perf/arch/s390/util/dwarf-regs.c tools/perf/util/dwarf-regs.c +1 more+3 -200 repliesApplied
16/20perf sh: Remove dwarf-regs.ctools/perf/arch/sh/Build tools/perf/arch/sh/util/Build tools/perf/arch/sh/util/dwarf-regs.c +2 more+3 -460 repliesApplied
17/20perf sparc: Remove dwarf-regs.ctools/perf/arch/sparc/Build tools/perf/arch/sparc/util/Build tools/perf/arch/sparc/util/dwarf-regs.c +2 more+6 -440 repliesApplied
18/20perf xtensa: Remove dwarf-regs.ctools/perf/arch/xtensa/Build tools/perf/arch/xtensa/util/Build tools/perf/arch/xtensa/util/dwarf-regs.c +2 more+3 -260 repliesApplied
19/20perf dwarf-regs: Remove get_arch_regstr codetools/perf/util/dwarf-regs.c tools/perf/util/include/dwarf-regs.h+0 -190 repliesApplied
20/20perf build: Remove PERF_HAVE_DWARF_REGStools/perf/Makefile.config tools/perf/arch/arm/Makefile tools/perf/arch/arm64/Makefile +10 more+5 -510 repliesApplied

Reviews trailers per patch

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

PatchMasami Hiramatsu (Google)
1/20R-b
2/20R-b
3/20R-b
4/20R-b
5/20R-b
6/20R-b
7/20R-b
8/20R-b
9/20R-b
10/20R-b
11/20R-b
12/20R-b
13/20R-b
14/20R-b
15/20R-b
16/20R-b
17/20R-b
18/20R-b
19/20R-b
20/20R-b

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

Read the v4 thread

Cover letter [PATCH v4 00/20] Remove PERF_HAVE_DWARF_REGS

These changes were originally on top of:
https://lore.kernel.org/lkml/[email protected]/

Prior to these patches PERF_HAVE_DWARF_REGS indicated the presence of dwarf-regs.c in the arch directory. dwarf-regs.c provided upto 4 functions:

1) regs_query_register_offset would translate a register name into a pt_regs offset and was used by BPF prologues. BPF prologues existed for BPF events and support for these was removed many releases ago. This code was dead and could be removed.

2) get_arch_regstr duplicated get_dwarf_regstr and so it could be removed. The case for csky was a little more complicated as the ABI controlled the string. The callers of get_dwarf_regstr were updated to also pass the ELF flags so that on csky the ABI appropriate table could be used. As the argument is only used on csky this a no-op for everything else.

3) get_arch_regnum translated a register name back to a dwarf number and only existed on x86 where "al", "ax", "eax" and "rax" could all mean register 0. This code was moved to util with similar machine/flags logic to get_arch_regstr and for consistency with it.

4) get_powerpc_regs a PowerPC specific function used by annotate that should really be in util.

2 and 3 required the wiring through of the ELF machine and flags in callers to get_dwarf_regstr and get_dwarf_regnum. When these values weren't dependent on an ELF file a new EM_HOST and EF_HOST were added to give the host ELF machine and flags. These 2 #defines got rid of the existing separate arch files and #ifdefs.

v4: Add CSky defines to dwarf-regs.h Add reviewed-by tags from Masami.
v3: These files were separated from the rest of the v2 libdw clean up

    in:

https://lore.kernel.org/lkml/CAP-5=fVZH3L-6y_sxLwSmT8WyMXDMFnuqUksNULdQYJCPNBFYw@mail.gmail.com/

Ian Rogers (20):
perf bpf-prologue: Remove unused file
perf dwarf-regs: Remove PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET perf dwarf-regs: Add EM_HOST and EF_HOST defines
perf disasm: Add e_machine/e_flags to struct arch
perf dwarf-regs: Pass accurate disassembly machine to get_dwarf_regnum perf dwarf-regs: Pass ELF flags to get_dwarf_regstr
perf dwarf-regs: Move x86 dwarf-regs out of arch
perf arm64: Remove dwarf-regs.c
perf arm: Remove dwarf-regs.c
perf dwarf-regs: Move csky dwarf-regs out of arch
perf loongarch: Remove dwarf-regs.c
perf mips: Remove dwarf-regs.c
perf dwarf-regs: Move powerpc dwarf-regs out of arch
perf riscv: Remove dwarf-regs.c and add dwarf-regs-table.h perf s390: Remove dwarf-regs.c
perf sh: Remove dwarf-regs.c
perf sparc: Remove dwarf-regs.c
perf xtensa: Remove dwarf-regs.c
perf dwarf-regs: Remove get_arch_regstr code
perf build: Remove PERF_HAVE_DWARF_REGS

 tools/perf/Makefile.config                    |  17 +-
 tools/perf/arch/arc/annotate/instructions.c   |   2 +
 tools/perf/arch/arm/Makefile                  |   3 -
 tools/perf/arch/arm/annotate/instructions.c   |   2 +
 tools/perf/arch/arm/util/Build                |   2 -
 tools/perf/arch/arm/util/dwarf-regs.c         |  61 -------
 tools/perf/arch/arm64/Makefile                |   4 -
 tools/perf/arch/arm64/annotate/instructions.c |   2 +
 tools/perf/arch/arm64/util/Build              |   1 -
 tools/perf/arch/arm64/util/dwarf-regs.c       |  92 -----------
 tools/perf/arch/csky/Makefile                 |   4 -
 tools/perf/arch/csky/annotate/instructions.c  |   7 +-
 tools/perf/arch/csky/util/Build               |   1 -
 tools/perf/arch/loongarch/Makefile            |   4 -
 .../arch/loongarch/annotate/instructions.c    |   2 +
 tools/perf/arch/loongarch/util/Build          |   1 -
 tools/perf/arch/loongarch/util/dwarf-regs.c   |  44 -----
 tools/perf/arch/mips/Makefile                 |   4 -
 tools/perf/arch/mips/annotate/instructions.c  |   2 +
 tools/perf/arch/mips/util/Build               |   1 -
 tools/perf/arch/mips/util/dwarf-regs.c        |  38 -----
 tools/perf/arch/powerpc/Makefile              |   5 -
 .../perf/arch/powerpc/annotate/instructions.c |   2 +
 tools/perf/arch/powerpc/util/Build            |   1 -
 tools/perf/arch/powerpc/util/dwarf-regs.c     | 153 ------------------
 tools/perf/arch/riscv/Makefile                |   5 +-
 .../arch/riscv/include/dwarf-regs-table.h     |  42 +++++
 tools/perf/arch/riscv/util/Build              |   1 -
 tools/perf/arch/riscv/util/dwarf-regs.c       |  72 ---------
 .../perf/arch/riscv64/annotate/instructions.c |   2 +
 tools/perf/arch/s390/Makefile                 |   4 -
 tools/perf/arch/s390/annotate/instructions.c  |   2 +
 tools/perf/arch/s390/util/Build               |   1 -
 tools/perf/arch/s390/util/dwarf-regs.c        |  43 -----
 tools/perf/arch/sh/Build                      |   1 -
 tools/perf/arch/sh/Makefile                   |   4 -
 tools/perf/arch/sh/util/Build                 |   1 -
 tools/perf/arch/sh/util/dwarf-regs.c          |  41 -----
 tools/perf/arch/sparc/Build                   |   1 -
 tools/perf/arch/sparc/Makefile                |   4 -
 tools/perf/arch/sparc/annotate/instructions.c |   2 +
 tools/perf/arch/sparc/util/Build              |   1 -
 tools/perf/arch/sparc/util/dwarf-regs.c       |  39 -----
 tools/perf/arch/x86/Makefile                  |   4 -
 tools/perf/arch/x86/annotate/instructions.c   |   3 +-
 tools/perf/arch/x86/util/Build                |   3 -
 tools/perf/arch/x86/util/dwarf-regs.c         | 153 ------------------
 tools/perf/arch/xtensa/Build                  |   1 -
 tools/perf/arch/xtensa/Makefile               |   4 -
 tools/perf/arch/xtensa/util/Build             |   1 -
 tools/perf/arch/xtensa/util/dwarf-regs.c      |  21 ---
 tools/perf/util/Build                         |   3 +
 tools/perf/util/annotate.c                    |   6 +-
 tools/perf/util/bpf-prologue.h                |  37 -----
 tools/perf/util/disasm.c                      |   1 +
 tools/perf/util/disasm.h                      |   4 +
 .../dwarf-regs.c => util/dwarf-regs-csky.c}   |  19 +--
 tools/perf/util/dwarf-regs-powerpc.c          |  61 +++++++
 tools/perf/util/dwarf-regs-x86.c              |  50 ++++++
 tools/perf/util/dwarf-regs.c                  |  38 +++--
 tools/perf/util/include/dwarf-regs.h          | 120 +++++++++++---
 tools/perf/util/probe-finder.c                |  13 +-
 tools/perf/util/probe-finder.h                |   3 +-
 63 files changed, 339 insertions(+), 927 deletions(-)
 delete mode 100644 tools/perf/arch/arm/util/dwarf-regs.c
 delete mode 100644 tools/perf/arch/arm64/util/dwarf-regs.c
 delete mode 100644 tools/perf/arch/csky/Makefile
 delete mode 100644 tools/perf/arch/loongarch/util/dwarf-regs.c
 delete mode 100644 tools/perf/arch/mips/util/dwarf-regs.c
 delete mode 100644 tools/perf/arch/powerpc/util/dwarf-regs.c
 create mode 100644 tools/perf/arch/riscv/include/dwarf-regs-table.h
 delete mode 100644 tools/perf/arch/riscv/util/dwarf-regs.c
 delete mode 100644 tools/perf/arch/s390/util/dwarf-regs.c
 delete mode 100644 tools/perf/arch/sh/Build
 delete mode 100644 tools/perf/arch/sh/Makefile
 delete mode 100644 tools/perf/arch/sh/util/Build
 delete mode 100644 tools/perf/arch/sh/util/dwarf-regs.c
 delete mode 100644 tools/perf/arch/sparc/Build
 delete mode 100644 tools/perf/arch/sparc/util/Build
 delete mode 100644 tools/perf/arch/sparc/util/dwarf-regs.c
 delete mode 100644 tools/perf/arch/x86/util/dwarf-regs.c
 delete mode 100644 tools/perf/arch/xtensa/Build
 delete mode 100644 tools/perf/arch/xtensa/Makefile
 delete mode 100644 tools/perf/arch/xtensa/util/Build
 delete mode 100644 tools/perf/arch/xtensa/util/dwarf-regs.c
 delete mode 100644 tools/perf/util/bpf-prologue.h
 rename tools/perf/{arch/csky/util/dwarf-regs.c => util/dwarf-regs-csky.c} (74%)
 create mode 100644 tools/perf/util/dwarf-regs-powerpc.c
 create mode 100644 tools/perf/util/dwarf-regs-x86.c
Signature · 1 line
2.47.0.277.g8800431eea-goog