[PATCH v1 0/7] Refactor perf python module build

2024-06-12 Thread Ian Rogers
to work with heterogeneous cores. Patches 1 to 5 add static libraries for existing parts of the perf build. Patch 6 adds the python build using libraries rather than C source files. Patch 7 cleans up the python dependencies and removes the no longer needed python-ext-sources. Ian Rogers (7

[PATCH v1 1/7] perf ui: Make ui its own library

2024-06-12 Thread Ian Rogers
Make the ui code its own library. This is done to avoid compiling code twice, once for the perf tool and once for the perf python module. Signed-off-by: Ian Rogers --- tools/perf/Build | 2 +- tools/perf/Makefile.perf | 10 ++ tools/perf/ui/Build | 18

[PATCH v1 2/7] perf pmu-events: Make pmu-events a library

2024-06-12 Thread Ian Rogers
Make pmu-events into a library so it may be linked against things like the python module and not built from source. Signed-off-by: Ian Rogers --- tools/perf/Makefile.perf | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/perf/Makefile.perf b/tools/perf

[PATCH v1 3/7] perf test: Make tests its own library

2024-06-12 Thread Ian Rogers
Make the tests code its own library. This is done to avoid compiling code twice, once for the perf tool and once for the perf python module. Signed-off-by: Ian Rogers --- tools/perf/Build| 3 +- tools/perf/Makefile.perf| 11 ++- tools/perf/arch/Build

[PATCH v1 4/7] perf bench: Make bench its own library

2024-06-12 Thread Ian Rogers
Make the benchmark code into a library so it may be linked against things like the python module to avoid compiling code twice. Signed-off-by: Ian Rogers --- tools/perf/Build | 4 ++-- tools/perf/Makefile.perf | 11 +- tools/perf/bench/Build | 46

[PATCH v1 5/7] perf util: Make util its own library

2024-06-12 Thread Ian Rogers
. Signed-off-by: Ian Rogers --- tools/perf/Build | 5 +- tools/perf/Makefile.perf | 12 +- tools/perf/arch/Build | 3 +- tools/perf/arch/arm/Build | 2 +- tools/perf/arch/arm/util/Build

[PATCH v1 6/7] perf python: Switch module to linking libraries from building source

2024-06-12 Thread Ian Rogers
. The libraries are passed through LDFLAGS to avoid complexity in python. Force the -fPIC flag for libbpf.a to ensure it is suitable for linking into the perf python module. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 5 + tools/perf/Makefile.perf | 6 +- tools/perf/util

[PATCH v1 7/7] perf python: Clean up build dependencies

2024-06-12 Thread Ian Rogers
The python build now depends on libraries and doesn't use python-ext-sources except for the util/python.c dependency. Switch to just directly depending on that file and util/setup.py. This allows the removal of python-ext-sources. Signed-off-by: Ian Rogers --- tools/perf/Makefile

Re: [PATCH v1 0/7] Refactor perf python module build

2024-06-13 Thread Ian Rogers
On Thu, Jun 13, 2024 at 8:10 AM James Clark wrote: [...] > >> Reviewed-by: James Clark > >> > >> It does require a clean build to avoid some -fPIC errors presumably > >> because not everything that requires it gets rebuilt, for anyone who > >> gets stuck on that. > > > > We need to find a way to

[PATCH v2 1/8] perf build: Add '*.a' to clean targets

2024-06-13 Thread Ian Rogers
Fix some excessively long lines by deploying '\'. Signed-off-by: Ian Rogers --- tools/perf/Makefile.perf | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 5c35c0d89306..acc41a6717db 100644 -

[PATCH v2 2/8] perf ui: Make ui its own library

2024-06-13 Thread Ian Rogers
Make the ui code its own library. This is done to avoid compiling code twice, once for the perf tool and once for the perf python module. Signed-off-by: Ian Rogers Reviewed-by: James Clark --- tools/perf/Build | 2 +- tools/perf/Makefile.perf | 10 ++ tools/perf/ui

[PATCH v2 3/8] perf pmu-events: Make pmu-events a library

2024-06-13 Thread Ian Rogers
Make pmu-events into a library so it may be linked against things like the python module and not built from source. Signed-off-by: Ian Rogers Reviewed-by: James Clark --- tools/perf/Makefile.perf | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/perf

[PATCH v2 5/8] perf bench: Make bench its own library

2024-06-13 Thread Ian Rogers
Make the benchmark code into a library so it may be linked against things like the python module to avoid compiling code twice. Signed-off-by: Ian Rogers Reviewed-by: James Clark --- tools/perf/Build | 4 ++-- tools/perf/Makefile.perf | 11 +- tools/perf/bench/Build | 46

[PATCH v2 6/8] perf util: Make util its own library

2024-06-13 Thread Ian Rogers
. Signed-off-by: Ian Rogers Reviewed-by: James Clark --- tools/perf/Build | 5 +- tools/perf/Makefile.perf | 12 +- tools/perf/arch/Build | 3 +- tools/perf/arch/arm/Build | 2 +- tools/perf/arch

[PATCH v2 7/8] perf python: Switch module to linking libraries from building source

2024-06-13 Thread Ian Rogers
. The libraries are passed through LDFLAGS to avoid complexity in python. Force the -fPIC flag for libbpf.a to ensure it is suitable for linking into the perf python module. Signed-off-by: Ian Rogers Reviewed-by: James Clark --- tools/perf/Makefile.config | 5 + tools/perf/Makefile.perf | 6

[PATCH v2 4/8] perf test: Make tests its own library

2024-06-13 Thread Ian Rogers
Make the tests code its own library. This is done to avoid compiling code twice, once for the perf tool and once for the perf python module. Signed-off-by: Ian Rogers Reviewed-by: James Clark --- tools/perf/Build| 3 +- tools/perf/Makefile.perf| 11 ++- tools

[PATCH v2 8/8] perf python: Clean up build dependencies

2024-06-13 Thread Ian Rogers
The python build now depends on libraries and doesn't use python-ext-sources except for the util/python.c dependency. Switch to just directly depending on that file and util/setup.py. This allows the removal of python-ext-sources. Signed-off-by: Ian Rogers Reviewed-by: James Clark ---

[PATCH v2 0/8] Refactor perf python module build

2024-06-13 Thread Ian Rogers
thon build using libraries rather than C source files. Patch 8 cleans up the python dependencies and removes the no longer needed python-ext-sources. v2: Add '*.a' cleanup to clean target. Add reviewed-by James Clark. Ian Rogers (8): perf build: Add '*.a' to clean targets pe

[PATCH v3 0/8] Refactor perf python module build

2024-06-13 Thread Ian Rogers
s with GCC and LTO. v2: Add '*.a' cleanup to clean target. Add reviewed-by James Clark. Ian Rogers (8): perf build: Add '*.a' to clean targets perf ui: Make ui its own library perf pmu-events: Make pmu-events a library perf test: Make tests its own library perf bench: Mak

[PATCH v3 1/8] perf build: Add '*.a' to clean targets

2024-06-13 Thread Ian Rogers
Fix some excessively long lines by deploying '\'. Signed-off-by: Ian Rogers --- tools/perf/Makefile.perf | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 5c35c0d89306..acc41a6717db 100644 -

[PATCH v3 2/8] perf ui: Make ui its own library

2024-06-13 Thread Ian Rogers
Make the ui code its own library. This is done to avoid compiling code twice, once for the perf tool and once for the perf python module. Signed-off-by: Ian Rogers Reviewed-by: James Clark --- tools/perf/Build | 2 +- tools/perf/Makefile.perf | 10 ++ tools/perf/ui

[PATCH v3 3/8] perf pmu-events: Make pmu-events a library

2024-06-13 Thread Ian Rogers
Make pmu-events into a library so it may be linked against things like the python module and not built from source. Signed-off-by: Ian Rogers Reviewed-by: James Clark --- tools/perf/Makefile.perf | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/perf

[PATCH v3 4/8] perf test: Make tests its own library

2024-06-13 Thread Ian Rogers
Make the tests code its own library. This is done to avoid compiling code twice, once for the perf tool and once for the perf python module. Signed-off-by: Ian Rogers Reviewed-by: James Clark --- tools/perf/Build| 3 +- tools/perf/Makefile.perf| 11 ++- tools

[PATCH v3 5/8] perf bench: Make bench its own library

2024-06-13 Thread Ian Rogers
Make the benchmark code into a library so it may be linked against things like the python module to avoid compiling code twice. Signed-off-by: Ian Rogers Reviewed-by: James Clark --- tools/perf/Build | 4 ++-- tools/perf/Makefile.perf | 11 +- tools/perf/bench/Build | 46

[PATCH v3 7/8] perf python: Switch module to linking libraries from building source

2024-06-13 Thread Ian Rogers
. The libraries are passed through LDFLAGS to avoid complexity in python. Force the -fPIC flag for libbpf.a to ensure it is suitable for linking into the perf python module. Signed-off-by: Ian Rogers Reviewed-by: James Clark --- tools/perf/Makefile.config | 5 + tools/perf/Makefile.perf | 6

[PATCH v3 6/8] perf util: Make util its own library

2024-06-13 Thread Ian Rogers
. Signed-off-by: Ian Rogers Reviewed-by: James Clark --- tools/perf/Build | 5 +- tools/perf/Makefile.perf | 12 +- tools/perf/arch/Build | 4 +- tools/perf/arch/arm/Build | 2 +- tools/perf/arch

[PATCH v3 8/8] perf python: Clean up build dependencies

2024-06-13 Thread Ian Rogers
The python build now depends on libraries and doesn't use python-ext-sources except for the util/python.c dependency. Switch to just directly depending on that file and util/setup.py. This allows the removal of python-ext-sources. Signed-off-by: Ian Rogers Reviewed-by: James Clark ---

Re: [PATCH v3 0/8] Refactor perf python module build

2024-06-24 Thread Ian Rogers
On Thu, Jun 13, 2024 at 4:31 PM Ian Rogers wrote: > > Refactor the perf python module build to instead of building C files > it links libraries. To support this make static libraries for tests, > ui, util and pmu-events. Doing this allows fewer functions to be > stubbed o

Re: [PATCH v3 7/8] perf python: Switch module to linking libraries from building source

2024-06-25 Thread Ian Rogers
On Tue, Jun 25, 2024 at 10:48 AM Namhyung Kim wrote: > > Hello, > > On Tue, Jun 25, 2024 at 5:24 AM James Clark wrote: > > > > > > > > On 24/06/2024 23:26, Namhyung Kim wrote: > > > On Thu, Jun 13, 2024 at 04:31:21PM -0700, Ian Rogers wrote: > >

Re: [PATCH v2 18/31] perf dwarf-regs: Move x86 dwarf-regs out of arch

2024-10-07 Thread Ian Rogers
On Mon, Oct 7, 2024 at 1:35 AM Masami Hiramatsu wrote: > > On Sat, 5 Oct 2024 12:55:28 -0700 > Ian Rogers wrote: > > > Move arch/x86/util/dwarf-regs.c to util/dwarf-regs-x86.c and compile > > in unconditionally. To avoid get_arch_regnum being duplicated, rename > >

Re: [PATCH v2 16/31] perf dwarf-regs: Pass accurate disassembly machine to get_dwarf_regnum

2024-10-07 Thread Ian Rogers
On Mon, Oct 7, 2024 at 1:08 AM Masami Hiramatsu wrote: > > On Sat, 5 Oct 2024 12:55:26 -0700 > Ian Rogers wrote: > > > Rather than pass 0/EM_NONE, use the value computed in the disasm > > struct arch. Switch the EM_NONE case to EM_HOST, rewriting EM_NONE

Re: [PATCH v2 17/31] perf dwarf-regs: Pass ELF flags to get_dwarf_regstr

2024-10-07 Thread Ian Rogers
On Mon, Oct 7, 2024 at 1:09 AM Masami Hiramatsu wrote: > > On Sat, 5 Oct 2024 12:55:27 -0700 > Ian Rogers wrote: > > > Pass a flags value as architectures like csky need the flags to > > determine the ABI variant. > > > > Same here. I need some example

[PATCH v2 00/31] Libdw/dwarf build clean up

2024-10-05 Thread Ian Rogers
aming PERF_HAVE_DWARF_REGS to PERF_HAVE_LIBDW_REGS, remove it. Ian Rogers (31): perf build: Fix !HAVE_DWARF_GETLOCATIONS_SUPPORT perf build: Rename NO_DWARF to NO_LIBDW perf build: Remove defined but never used variable perf build: Rename test-dwarf to test-libdw perf build: Combine libdw-dwarf-u

[PATCH v2 01/31] perf build: Fix !HAVE_DWARF_GETLOCATIONS_SUPPORT

2024-10-05 Thread Ian Rogers
Testing with a LIBDW_DIR showed some issues. In dwarf-aux.h if HAVE_DWARF_GETLOCATIONS_SUPPORT isn't defined then the code uses an undefined errno value, so add errno.h. In Makefile.config the dwarf feature tests need the LIBDW_DIR setting in the CFLAGS/LDFLAGS. Signed-off-by: Ian R

[PATCH v2 09/31] perf libdw: Remove unnecessary defines

2024-10-05 Thread Ian Rogers
As HAVE_DWARF_GETLOCATIONS_SUPPORT and HAVE_DWARF_CFI_SUPPORT always match HAVE_DWARF_SUPPORT remove the macros and use HAVE_DWARF_SUPPORT. If building the file is guarded by CONFIG_DWARF then remove all ifs. Signed-off-by: Ian Rogers --- tools/perf/Documentation/perf-check.txt | 2 +- tools

[PATCH v2 02/31] perf build: Rename NO_DWARF to NO_LIBDW

2024-10-05 Thread Ian Rogers
NO_DWARF could mean more than NO_LIBDW support, in particular no libunwind support. Rename to be more intention revealing. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 16 tools/perf/Makefile.perf | 2 +- tools/perf/arch/arm/Makefile | 2

[PATCH v2 08/31] perf probe: Move elfutils support check to libdw check

2024-10-05 Thread Ian Rogers
The test _ELFUTILS_PREREQ(0, 142) is false for elfutils before 2009-06-13, but that is 15 years ago and very unlikely. Add a test to test-libdw.c and assume the libdw version is at least 0.142 to simplify the build logic. Signed-off-by: Ian Rogers --- tools/build/feature/test-libdw.c | 10

[PATCH v2 07/31] perf build: Combine test-dwarf-getcfi into test-libdw

2024-10-05 Thread Ian Rogers
dwarf_getcfi support in libdw is 15 years old. Make libdw imply dwarf_getcfi support and simplify build logic. Signed-off-by: Ian Rogers --- tools/build/Makefile.feature| 1 - tools/build/feature/Makefile| 4 tools/build/feature/test-dwarf_getcfi.c | 9

[PATCH v2 05/31] perf build: Combine libdw-dwarf-unwind into libdw feature tests

2024-10-05 Thread Ian Rogers
Support in libdw has been present for 10 years so let's simplify the build logic with a single feature test. Signed-off-by: Ian Rogers --- tools/build/Makefile.feature | 2 -- tools/build/feature/Makefile | 4 tools/build/feature/test-

[PATCH v2 06/31] perf build: Combine test-dwarf-getlocations into test-libdw

2024-10-05 Thread Ian Rogers
dwarf_getlocations support in libdw is more than 10 years old. Make libdw imply dwarf_getlocations support and simplify build logic. Signed-off-by: Ian Rogers --- tools/build/Makefile.feature | 2 -- tools/build/feature/Makefile | 4 tools/build/feature

[PATCH v2 04/31] perf build: Rename test-dwarf to test-libdw

2024-10-05 Thread Ian Rogers
Be more intention revealing that the dwarf test is actually testing for libdw support. Signed-off-by: Ian Rogers --- tools/build/Makefile.feature | 6 +++--- tools/build/feature/Makefile | 16 tools/build/feature/test-all.c

[PATCH v2 03/31] perf build: Remove defined but never used variable

2024-10-05 Thread Ian Rogers
Previously NO_DWARF_UNWIND was part of conditional compilation but it is now unused so remove. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 55a39211496d..182e14e39cd5

[PATCH v2 10/31] perf build: Rename HAVE_DWARF_SUPPORT to HAVE_LIBDW_SUPPORT

2024-10-05 Thread Ian Rogers
In Makefile.config for unwinding the name dwarf implies either libunwind or libdw. Make it clearer that HAVE_DWARF_SUPPORT is really just defined when libdw is present by renaming to HAVE_LIBDW_SUPPORT. Signed-off-by: Ian Rogers --- tools/perf/Documentation/perf-check.txt | 6

[PATCH v2 13/31] perf dwarf-regs: Remove PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET

2024-10-05 Thread Ian Rogers
.h. Rename structs starting pt_ as the ptrace derived offset is now removed. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 4 - tools/perf/arch/arm64/Makefile | 1 - tools/perf/arch/arm64/util/dwarf-regs.c | 20 +--- tools/perf/arch/loongarc

[PATCH v2 18/31] perf dwarf-regs: Move x86 dwarf-regs out of arch

2024-10-05 Thread Ian Rogers
EM_HOST and remove get_arch_regstr from dwarf-regs-x86.c. Signed-off-by: Ian Rogers --- tools/perf/arch/x86/util/Build| 3 --- tools/perf/util/Build | 1 + .../dwarf-regs.c => util/dwarf-regs-x86.c}| 24 +-- tools/perf/util/dwarf-reg

[PATCH v2 15/31] perf disasm: Add e_machine/e_flags to struct arch

2024-10-05 Thread Ian Rogers
Currently functions like get_dwarf_regnum only work with the host architecture. Carry the elf machine and flags in struct arch so that in disassembly these can be used to allow cross platform disassembly. Signed-off-by: Ian Rogers --- tools/perf/arch/arc/annotate/instructions.c | 2

[PATCH v2 17/31] perf dwarf-regs: Pass ELF flags to get_dwarf_regstr

2024-10-05 Thread Ian Rogers
Pass a flags value as architectures like csky need the flags to determine the ABI variant. Signed-off-by: Ian Rogers --- tools/perf/util/dwarf-regs.c | 3 ++- tools/perf/util/include/dwarf-regs.h | 11 ++- tools/perf/util/probe-finder.c | 13 +++-- tools/perf/util

[PATCH v2 11/31] perf build: Rename CONFIG_DWARF to CONFIG_LIBDW

2024-10-05 Thread Ian Rogers
In Makefile.config for unwinding the name dwarf implies either libunwind or libdw. Make it clearer that CONFIG_DWARF is really just defined when libdw is present by renaming to CONFIG_LIBDW. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 2 +- tools/perf/arch/arm/util

[PATCH v2 12/31] perf bpf-prologue: Remove unused file

2024-10-05 Thread Ian Rogers
move unused file") Signed-off-by: Ian Rogers --- tools/perf/util/bpf-prologue.h | 37 -- 1 file changed, 37 deletions(-) delete mode 100644 tools/perf/util/bpf-prologue.h diff --git a/tools/perf/util/bpf-prologue.h b/tools/perf/util/bpf-prologue.h deleted file

[PATCH v2 16/31] perf dwarf-regs: Pass accurate disassembly machine to get_dwarf_regnum

2024-10-05 Thread Ian Rogers
Rather than pass 0/EM_NONE, use the value computed in the disasm struct arch. Switch the EM_NONE case to EM_HOST, rewriting EM_NONE if it were passed to get_dwarf_regnum. Pass a flags value as architectures like csky need the flags to determine the ABI variant. Signed-off-by: Ian Rogers

[PATCH v2 14/31] perf dwarf-regs: Add EM_HOST and EF_HOST defines

2024-10-05 Thread Ian Rogers
Computed from the build architecture defines, EM_HOST and EF_HOST give values that can be used in dwarf register lookup. Place in dwarf-regs.h so the value can be shared. Move some dwarf-regs.c constants used for EM_HOST to dwarf-regs.h. Signed-off-by: Ian Rogers --- tools/perf/util/dwarf

[PATCH v2 22/31] perf loongarch: Remove dwarf-regs.c

2024-10-05 Thread Ian Rogers
The file just provides the function get_arch_regstr, however, if in the only caller get_dwarf_regstr EM_HOST is used for the EM_NONE case the function can never be called. So remove as dead code. Tidy up the EM_NONE cases for loongarch in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf

[PATCH v2 24/31] perf dwarf-regs: Move powerpc dwarf-regs out of arch

2024-10-05 Thread Ian Rogers
Move arch/powerpc/util/dwarf-regs.c to util/dwarf-regs-powerpc.c and compile in unconditionally. get_arch_regstr is redundant when EM_NONE is treated as EM_HOST so remove and update dwarf-regs.c conditions. Make get_powerpc_regs unconditionally available whwn libdw is. Signed-off-by: Ian Rogers

[PATCH v2 20/31] perf arm: Remove dwarf-regs.c

2024-10-05 Thread Ian Rogers
The file just provides the function get_arch_regstr, however, if in the only caller get_dwarf_regstr EM_HOST is used for the EM_NONE case the function can never be called. So remove as dead code. Tidy up the EM_NONE cases for arm in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch

[PATCH v2 21/31] perf dwarf-regs: Move csky dwarf-regs out of arch

2024-10-05 Thread Ian Rogers
. Signed-off-by: Ian Rogers --- tools/perf/arch/csky/util/Build | 1 - tools/perf/util/Build | 1 + .../dwarf-regs.c => util/dwarf-regs-csky.c} | 19 ++- tools/perf/util/dwarf-regs.c | 11 +++ tools/perf/u

[PATCH v2 19/31] perf arm64: Remove dwarf-regs.c

2024-10-05 Thread Ian Rogers
The file just provides the function get_arch_regstr, however, if in the only caller get_dwarf_regstr EM_HOST is used for the EM_NONE case the function can never be called. So remove as dead code. Tidy up the EM_NONE cases for arm64 in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch

[PATCH v2 23/31] perf mips: Remove dwarf-regs.c

2024-10-05 Thread Ian Rogers
The file just provides the function get_arch_regstr, however, if in the only caller get_dwarf_regstr EM_HOST is used for the EM_NONE case the function can never be called. So remove as dead code. Tidy up the EM_NONE cases for mips in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch

[PATCH v2 30/31] perf dwarf-regs: Remove get_arch_regstr code

2024-10-05 Thread Ian Rogers
get_arch_regstr no longer exists so remove declaration. Associated ifs and switches are made unconditional. Signed-off-by: Ian Rogers --- tools/perf/util/dwarf-regs.c | 12 tools/perf/util/include/dwarf-regs.h | 7 --- 2 files changed, 19 deletions(-) diff --git a

[PATCH v2 26/31] perf s390: Remove dwarf-regs.c

2024-10-05 Thread Ian Rogers
The file just provides the function get_arch_regstr, however, if in the only caller get_dwarf_regstr EM_HOST is used for the EM_NONE case the function can never be called. So remove as dead code. Tidy up the EM_NONE cases for s390 in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch

[PATCH v2 25/31] perf riscv: Remove dwarf-regs.c and add dwarf-regs-table.h

2024-10-05 Thread Ian Rogers
-regs.c. Signed-off-by: Ian Rogers --- .../dwarf-regs-table.h} | 32 --- tools/perf/arch/riscv/util/Build | 1 - tools/perf/util/dwarf-regs.c | 7 ++-- tools/perf/util/include/dwarf-regs.h | 2 +- 4 files changed, 12

[PATCH v2 28/31] perf sparc: Remove dwarf-regs.c

2024-10-05 Thread Ian Rogers
sparc in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch/sparc/Build | 1 - tools/perf/arch/sparc/util/Build| 1 - tools/perf/arch/sparc/util/dwarf-regs.c | 39 - tools/perf/util/dwarf-regs.c| 6 ++-- tools/perf/util/include

[PATCH v2 27/31] perf sh: Remove dwarf-regs.c

2024-10-05 Thread Ian Rogers
dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch/sh/Build | 1 - tools/perf/arch/sh/util/Build| 1 - tools/perf/arch/sh/util/dwarf-regs.c | 41 tools/perf/util/dwarf-regs.c | 4 +-- tools/perf/util/include/dwarf-regs.h | 2

[PATCH v2 29/31] perf xtensa: Remove dwarf-regs.c

2024-10-05 Thread Ian Rogers
xtensa in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch/xtensa/Build | 1 - tools/perf/arch/xtensa/util/Build| 1 - tools/perf/arch/xtensa/util/dwarf-regs.c | 21 - tools/perf/util/dwarf-regs.c | 4 ++-- tools/perf/util/include

[PATCH v2 31/31] perf build: Remove PERF_HAVE_DWARF_REGS

2024-10-05 Thread Ian Rogers
the Makefile. Add missing SPDX for RISC-V Makefile. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 13 - tools/perf/arch/arm/Makefile | 3 --- tools/perf/arch/arm64/Makefile | 3 --- tools/perf/arch/csky/Makefile | 4 tools/perf/arch

[PATCH v3 06/11] perf build: Combine test-dwarf-getlocations into test-libdw

2024-10-16 Thread Ian Rogers
dwarf_getlocations support in libdw is more than 10 years old. Make libdw imply dwarf_getlocations support and simplify build logic. Signed-off-by: Ian Rogers --- tools/build/Makefile.feature | 2 -- tools/build/feature/Makefile | 4 tools/build/feature

[PATCH v3 07/11] perf build: Combine test-dwarf-getcfi into test-libdw

2024-10-16 Thread Ian Rogers
dwarf_getcfi support in libdw is 15 years old. Make libdw imply dwarf_getcfi support and simplify build logic. Signed-off-by: Ian Rogers --- tools/build/Makefile.feature| 1 - tools/build/feature/Makefile| 4 tools/build/feature/test-dwarf_getcfi.c | 9

[PATCH v3 08/11] perf probe: Move elfutils support check to libdw check

2024-10-16 Thread Ian Rogers
The test _ELFUTILS_PREREQ(0, 142) is false for elfutils before 2009-06-13, but that is 15 years ago and very unlikely. Add a test to test-libdw.c and assume the libdw version is at least 0.142 to simplify the build logic. Signed-off-by: Ian Rogers --- tools/build/feature/test-libdw.c | 10

[PATCH v3 00/11] Libdw/dwarf build clean up

2024-10-16 Thread Ian Rogers
another day. v3: Move PERF_HAVE_DWARF_REGS cleanup to follow up patch series. Add build fix from patch series these changes are on top of. v2: Instead of renaming PERF_HAVE_DWARF_REGS to PERF_HAVE_LIBDW_REGS, remove it. Ian Rogers (11): perf build: Fix LIBDW_DIR perf build: Rename

[PATCH v3 01/11] perf build: Fix LIBDW_DIR

2024-10-16 Thread Ian Rogers
Testing with a LIBDW_DIR showed that in Makefile.config the dwarf feature tests need the LIBDW_DIR setting in the CFLAGS/LDFLAGS. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tools/perf/Makefile.config b/tools/perf

[PATCH v3 02/11] perf build: Rename NO_DWARF to NO_LIBDW

2024-10-16 Thread Ian Rogers
NO_DWARF could mean more than NO_LIBDW support, in particular no libunwind support. Rename to be more intention revealing. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 16 tools/perf/Makefile.perf | 2 +- tools/perf/arch/arm/Makefile | 2

[PATCH v3 05/11] perf build: Combine libdw-dwarf-unwind into libdw feature tests

2024-10-16 Thread Ian Rogers
Support in libdw has been present for 10 years so let's simplify the build logic with a single feature test. Signed-off-by: Ian Rogers --- tools/build/Makefile.feature | 2 -- tools/build/feature/Makefile | 4 tools/build/feature/test-

[PATCH v3 04/11] perf build: Rename test-dwarf to test-libdw

2024-10-16 Thread Ian Rogers
Be more intention revealing that the dwarf test is actually testing for libdw support. Signed-off-by: Ian Rogers --- tools/build/Makefile.feature | 6 +++--- tools/build/feature/Makefile | 16 tools/build/feature/test-all.c

[PATCH v3 03/11] perf build: Remove defined but never used variable

2024-10-16 Thread Ian Rogers
Previously NO_DWARF_UNWIND was part of conditional compilation but it is now unused so remove. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index cc2cfc3aab40..dd5468b8b5de

[PATCH v3 09/11] perf libdw: Remove unnecessary defines

2024-10-16 Thread Ian Rogers
As HAVE_DWARF_GETLOCATIONS_SUPPORT and HAVE_DWARF_CFI_SUPPORT always match HAVE_DWARF_SUPPORT remove the macros and use HAVE_DWARF_SUPPORT. If building the file is guarded by CONFIG_DWARF then remove all ifs. Signed-off-by: Ian Rogers --- tools/perf/Documentation/perf-check.txt | 2 +- tools

[PATCH v3 10/11] perf build: Rename HAVE_DWARF_SUPPORT to HAVE_LIBDW_SUPPORT

2024-10-16 Thread Ian Rogers
In Makefile.config for unwinding the name dwarf implies either libunwind or libdw. Make it clearer that HAVE_DWARF_SUPPORT is really just defined when libdw is present by renaming to HAVE_LIBDW_SUPPORT. Signed-off-by: Ian Rogers --- tools/perf/Documentation/perf-check.txt | 6

[PATCH v3 11/11] perf build: Rename CONFIG_DWARF to CONFIG_LIBDW

2024-10-16 Thread Ian Rogers
In Makefile.config for unwinding the name dwarf implies either libunwind or libdw. Make it clearer that CONFIG_DWARF is really just defined when libdw is present by renaming to CONFIG_LIBDW. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 2 +- tools/perf/arch/arm/util

[PATCH v3 00/20] Remove PERF_HAVE_DWARF_REGS

2024-10-16 Thread Ian Rogers
ne and flags. These 2 #defines got rid of the existing separate arch files and #ifdefs. v3: These files were separated from the rest of the v2 libdw clean up in: https://lore.kernel.org/lkml/CAP-5=fvzh3l-6y_sxlwsmt8wymxdmfnuquksnuldqyjcpnb...@mail.gmail.com/ Ian Rogers (20): perf bpf-prologue:

[PATCH v3 01/20] perf bpf-prologue: Remove unused file

2024-10-16 Thread Ian Rogers
move unused file") Signed-off-by: Ian Rogers --- tools/perf/util/bpf-prologue.h | 37 -- 1 file changed, 37 deletions(-) delete mode 100644 tools/perf/util/bpf-prologue.h diff --git a/tools/perf/util/bpf-prologue.h b/tools/perf/util/bpf-prologue.h deleted file

[PATCH v3 02/20] perf dwarf-regs: Remove PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET

2024-10-16 Thread Ian Rogers
.h. Rename structs starting pt_ as the ptrace derived offset is now removed. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 4 - tools/perf/arch/arm64/Makefile | 1 - tools/perf/arch/arm64/util/dwarf-regs.c | 20 +--- tools/perf/arch/loongarc

[PATCH v3 03/20] perf dwarf-regs: Add EM_HOST and EF_HOST defines

2024-10-16 Thread Ian Rogers
Computed from the build architecture defines, EM_HOST and EF_HOST give values that can be used in dwarf register lookup. Place in dwarf-regs.h so the value can be shared. Move some dwarf-regs.c constants used for EM_HOST to dwarf-regs.h. Signed-off-by: Ian Rogers --- tools/perf/util/dwarf

[PATCH v3 04/20] perf disasm: Add e_machine/e_flags to struct arch

2024-10-16 Thread Ian Rogers
Currently functions like get_dwarf_regnum only work with the host architecture. Carry the elf machine and flags in struct arch so that in disassembly these can be used to allow cross platform disassembly. Signed-off-by: Ian Rogers --- tools/perf/arch/arc/annotate/instructions.c | 2

[PATCH v3 05/20] perf dwarf-regs: Pass accurate disassembly machine to get_dwarf_regnum

2024-10-16 Thread Ian Rogers
Rather than pass 0/EM_NONE, use the value computed in the disasm struct arch. Switch the EM_NONE case to EM_HOST, rewriting EM_NONE if it were passed to get_dwarf_regnum. Pass a flags value as architectures like csky need the flags to determine the ABI variant. Signed-off-by: Ian Rogers

[PATCH v3 12/20] perf mips: Remove dwarf-regs.c

2024-10-16 Thread Ian Rogers
The file just provides the function get_arch_regstr, however, if in the only caller get_dwarf_regstr EM_HOST is used for the EM_NONE case the function can never be called. So remove as dead code. Tidy up the EM_NONE cases for mips in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch

[PATCH v3 07/20] perf dwarf-regs: Move x86 dwarf-regs out of arch

2024-10-16 Thread Ian Rogers
EM_HOST and remove get_arch_regstr from dwarf-regs-x86.c. Signed-off-by: Ian Rogers --- tools/perf/arch/x86/util/Build| 3 --- tools/perf/util/Build | 1 + .../dwarf-regs.c => util/dwarf-regs-x86.c}| 24 +-- tools/perf/util/dwarf-reg

[PATCH v3 06/20] perf dwarf-regs: Pass ELF flags to get_dwarf_regstr

2024-10-16 Thread Ian Rogers
Pass a flags value as architectures like csky need the flags to determine the ABI variant. Signed-off-by: Ian Rogers --- tools/perf/util/dwarf-regs.c | 3 ++- tools/perf/util/include/dwarf-regs.h | 11 ++- tools/perf/util/probe-finder.c | 13 +++-- tools/perf/util

[PATCH v3 10/20] perf dwarf-regs: Move csky dwarf-regs out of arch

2024-10-16 Thread Ian Rogers
. Signed-off-by: Ian Rogers --- tools/perf/arch/csky/util/Build | 1 - tools/perf/util/Build | 1 + .../dwarf-regs.c => util/dwarf-regs-csky.c} | 19 ++- tools/perf/util/dwarf-regs.c | 11 +++ tools/perf/u

[PATCH v3 08/20] perf arm64: Remove dwarf-regs.c

2024-10-16 Thread Ian Rogers
The file just provides the function get_arch_regstr, however, if in the only caller get_dwarf_regstr EM_HOST is used for the EM_NONE case the function can never be called. So remove as dead code. Tidy up the EM_NONE cases for arm64 in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch

[PATCH v3 11/20] perf loongarch: Remove dwarf-regs.c

2024-10-16 Thread Ian Rogers
The file just provides the function get_arch_regstr, however, if in the only caller get_dwarf_regstr EM_HOST is used for the EM_NONE case the function can never be called. So remove as dead code. Tidy up the EM_NONE cases for loongarch in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf

[PATCH v3 09/20] perf arm: Remove dwarf-regs.c

2024-10-16 Thread Ian Rogers
The file just provides the function get_arch_regstr, however, if in the only caller get_dwarf_regstr EM_HOST is used for the EM_NONE case the function can never be called. So remove as dead code. Tidy up the EM_NONE cases for arm in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch

[PATCH v3 19/20] perf dwarf-regs: Remove get_arch_regstr code

2024-10-16 Thread Ian Rogers
get_arch_regstr no longer exists so remove declaration. Associated ifs and switches are made unconditional. Signed-off-by: Ian Rogers --- tools/perf/util/dwarf-regs.c | 12 tools/perf/util/include/dwarf-regs.h | 7 --- 2 files changed, 19 deletions(-) diff --git a

[PATCH v3 17/20] perf sparc: Remove dwarf-regs.c

2024-10-16 Thread Ian Rogers
sparc in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch/sparc/Build | 1 - tools/perf/arch/sparc/util/Build| 1 - tools/perf/arch/sparc/util/dwarf-regs.c | 39 - tools/perf/util/dwarf-regs.c| 6 ++-- tools/perf/util/include

[PATCH v3 13/20] perf dwarf-regs: Move powerpc dwarf-regs out of arch

2024-10-16 Thread Ian Rogers
Move arch/powerpc/util/dwarf-regs.c to util/dwarf-regs-powerpc.c and compile in unconditionally. get_arch_regstr is redundant when EM_NONE is treated as EM_HOST so remove and update dwarf-regs.c conditions. Make get_powerpc_regs unconditionally available whwn libdw is. Signed-off-by: Ian Rogers

[PATCH v3 16/20] perf sh: Remove dwarf-regs.c

2024-10-16 Thread Ian Rogers
dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch/sh/Build | 1 - tools/perf/arch/sh/util/Build| 1 - tools/perf/arch/sh/util/dwarf-regs.c | 41 tools/perf/util/dwarf-regs.c | 4 +-- tools/perf/util/include/dwarf-regs.h | 2

[PATCH v3 14/20] perf riscv: Remove dwarf-regs.c and add dwarf-regs-table.h

2024-10-16 Thread Ian Rogers
-regs.c. Signed-off-by: Ian Rogers --- .../dwarf-regs-table.h} | 32 --- tools/perf/arch/riscv/util/Build | 1 - tools/perf/util/dwarf-regs.c | 7 ++-- tools/perf/util/include/dwarf-regs.h | 2 +- 4 files changed, 12

[PATCH v3 18/20] perf xtensa: Remove dwarf-regs.c

2024-10-16 Thread Ian Rogers
xtensa in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch/xtensa/Build | 1 - tools/perf/arch/xtensa/util/Build| 1 - tools/perf/arch/xtensa/util/dwarf-regs.c | 21 - tools/perf/util/dwarf-regs.c | 4 ++-- tools/perf/util/include

[PATCH v3 15/20] perf s390: Remove dwarf-regs.c

2024-10-16 Thread Ian Rogers
The file just provides the function get_arch_regstr, however, if in the only caller get_dwarf_regstr EM_HOST is used for the EM_NONE case the function can never be called. So remove as dead code. Tidy up the EM_NONE cases for s390 in dwarf-regs.c. Signed-off-by: Ian Rogers --- tools/perf/arch

[PATCH v3 20/20] perf build: Remove PERF_HAVE_DWARF_REGS

2024-10-16 Thread Ian Rogers
the Makefile. Add missing SPDX for RISC-V Makefile. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 13 - tools/perf/arch/arm/Makefile | 3 --- tools/perf/arch/arm64/Makefile | 3 --- tools/perf/arch/csky/Makefile | 4 tools/perf/arch

Re: [PATCH v2 00/31] Libdw/dwarf build clean up

2024-10-16 Thread Ian Rogers
On Sat, Oct 5, 2024 at 12:55 PM Ian Rogers wrote: > > There patches are on top of: > https://lore.kernel.org/lkml/20240924003720.617258-1-irog...@google.com/ > where it was pointed out that a lot of the libdw conditional > compilation was due to features that have now been standard

Re: [PATCH RFT 00/16] perf tools: Use generic syscall scripts for all archs

2024-11-04 Thread Ian Rogers
On Mon, Nov 4, 2024 at 1:32 PM Charlie Jenkins wrote: > > On Mon, Nov 04, 2024 at 10:13:18PM +0100, Arnd Bergmann wrote: > > On Mon, Nov 4, 2024, at 22:06, Charlie Jenkins wrote: > > > Standardize the generation of syscall headers around syscall tables. > > > Previously each architecture independe

Re: [PATCH v3 04/20] perf disasm: Add e_machine/e_flags to struct arch

2024-11-08 Thread Ian Rogers
On Fri, Nov 8, 2024 at 9:33 AM Namhyung Kim wrote: > > On Wed, Oct 16, 2024 at 05:25:04PM -0700, Ian Rogers wrote: > > Currently functions like get_dwarf_regnum only work with the host > > architecture. Carry the elf machine and flags in struct arch so that > > in disassem

  1   2   3   >