[PATCH v5 03/11] perf syscalltbl: Remove syscall_table.h

2025-03-07 Thread Ian Rogers
The definition of "static const char *const syscalltbl[] = {" is done in a generated syscalls_32.h or syscalls_64.h that is architecture dependent. In order to include the appropriate file a syscall_table.h is found via the perf include path and it includes the syscalls_32.h or syscalls_64.h as app

[PATCH v5 10/11] perf build: Remove Makefile.syscalls

2025-03-07 Thread Ian Rogers
Now a single beauty file is generated and used by all architectures, remove the per-architecture Makefiles, Kbuild files and previous generator script. Note: there was conversation with Charlie Jenkins and they'd written an alternate approach to support multiple architectures: https://lore.kernel

[PATCH v5 11/11] perf syscalltbl: Mask off ABI type for MIPS system calls

2025-03-07 Thread Ian Rogers
Arnd Bergmann described that MIPS system calls don't necessarily start from 0 as an ABI prefix is applied: https://lore.kernel.org/lkml/8ed7dfb2-1e4d-4aa4-a04b-0397a8936...@app.fastmail.com/ When decoding the "id" (aka system call number) for MIPS ignore values greater-than 1000. Signed-off-by: Ia

[PATCH v5 09/11] perf syscalltbl: Use lookup table containing multiple architectures

2025-03-07 Thread Ian Rogers
Switch to use the lookup table containing all architectures rather than tables matching the perf binary. This fixes perf trace when executed on a 32-bit i386 binary on an x86-64 machine. Note in the following the system call names of the 32-bit i386 binary as seen by an x86-64 perf. Before: ```

[PATCH v5 06/11] perf dso: Add support for reading the e_machine type for a dso

2025-03-07 Thread Ian Rogers
For ELF file dsos read the e_machine from the ELF header. For kernel types assume the e_machine matches the perf tool. In other cases return EM_NONE. When reading from the ELF header use DSO__SWAP that may need dso->needs_swap initializing. Factor out dso__swap_init to allow this. Signed-off-by:

[PATCH v5 08/11] perf trace beauty: Add syscalltbl.sh generating all system call tables

2025-03-07 Thread Ian Rogers
Rather than generating individual syscall header files generate a single trace/beauty/generated/syscalltbl.c. In a syscalltbls array have references to each architectures tables along with the corresponding e_machine. When the 32-bit or 64-bit table is ambiguous, match the perf binary's type. For A

[PATCH v5 07/11] perf thread: Add support for reading the e_machine type for a thread

2025-03-07 Thread Ian Rogers
First try to read the e_machine from the dsos associated with the thread's maps. If live use the executable from /proc/pid/exe and read the e_machine from the ELF header. On failure use EM_HOST. Change builtin-trace syscall functions to pass e_machine from the thread rather than EM_HOST, so that in

[PATCH v5 05/11] perf syscalltbl: Remove struct syscalltbl

2025-03-07 Thread Ian Rogers
The syscalltbl held entries of system call name and number pairs, generated from a native syscalltbl at start up. As there are gaps in the system call number there is a notion of index into the table. Going forward we want the system call table to be identifiable by a machine type, for example, i38

[PATCH v5 04/11] perf trace: Reorganize syscalls

2025-03-07 Thread Ian Rogers
Identify struct syscall information in the syscalls table by a machine type and syscall number, not just system call number. Having the machine type means that 32-bit system calls can be differentiated from 64-bit ones on a machine capable of both. Having a table for all machine types and all syste

[PATCH v5 02/11] perf dso: kernel-doc for enum dso_binary_type

2025-03-07 Thread Ian Rogers
There are many and non-obvious meanings to the dso_binary_type enum values. Add kernel-doc to speed interpretting their meanings. Acked-by: Arnaldo Carvalho de Melo Signed-off-by: Ian Rogers --- tools/perf/util/dso.h | 53 +++ 1 file changed, 53 insertion

[PATCH v5 01/11] perf dso: Move libunwind dso_data variables into ifdef

2025-03-07 Thread Ian Rogers
The variables elf_base_addr, debug_frame_offset, eh_frame_hdr_addr and eh_frame_hdr_offset are only accessed in unwind-libunwind-local.c which is conditionally built on having libunwind support. Make the variables conditional on libunwind support too. Reviewed-by: Arnaldo Carvalho de Melo Signed-

[PATCH v5 00/11] perf: Support multiple system call tables in the build

2025-03-07 Thread Ian Rogers
This work builds on the clean up of system call tables and removal of libaudit by Charlie Jenkins . The system call table in perf trace is used to map system call numbers to names and vice versa. Prior to these changes, a single table matching the perf binary's build was present. The table would b

Re: [PATCH 07/13] s390: make setup_zero_pages() use memblock

2025-03-07 Thread Heiko Carstens
On Thu, Mar 06, 2025 at 08:51:17PM +0200, Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Allocating the zero pages from memblock is simpler because the memory is > already reserved. > > This will also help with pulling out memblock_free_all() to the generic > code and reducing code