Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tools s390: Use generic syscall table scripts

Use the generic scripts to generate headers from the syscall table
instead of the custom ones for s390.

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Guo Ren <guoren@kernel.org>
Cc: Günther Noack <gnoack@google.com>
Cc: Ian Rogers <irogers@google.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: Jonathan Corbet <corbet@lwn.net>
Cc: Leo Yan <leo.yan@linux.dev>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mickaël Salaün <mic@digikod.net>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20250108-perf_syscalltbl-v6-15-7543b5293098@rivosinc.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Charlie Jenkins and committed by
Arnaldo Carvalho de Melo
00d1bfae 4c02c7e0

+12 -64
+1 -5
tools/perf/Makefile.config
··· 31 31 ifneq ($(NO_SYSCALL_TABLE),1) 32 32 NO_SYSCALL_TABLE := 1 33 33 34 - ifeq ($(SRCARCH),s390) 35 - NO_SYSCALL_TABLE := 0 36 - endif 37 - 38 34 # architectures that use the generic syscall table scripts 39 35 ifneq ($(filter $(SRCARCH), $(generic_syscall_table_archs)),) 40 36 NO_SYSCALL_TABLE := 0 ··· 86 90 endif 87 91 88 92 ifeq ($(ARCH),s390) 89 - CFLAGS += -fPIC -I$(OUTPUT)arch/s390/include/generated 93 + CFLAGS += -fPIC 90 94 endif 91 95 92 96 ifeq ($(ARCH),mips)
+1 -1
tools/perf/Makefile.perf
··· 311 311 endif 312 312 endif 313 313 # architectures that use the generic syscall table 314 - generic_syscall_table_archs := riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc 314 + generic_syscall_table_archs := riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc s390 315 315 ifneq ($(filter $(SRCARCH), $(generic_syscall_table_archs)),) 316 316 include $(srctree)/tools/perf/scripts/Makefile.syscalls 317 317 endif
-21
tools/perf/arch/s390/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 HAVE_KVM_STAT_SUPPORT := 1 3 3 PERF_HAVE_JITDUMP := 1 4 - 5 - # 6 - # Syscall table generation for perf 7 - # 8 - 9 - out := $(OUTPUT)arch/s390/include/generated/asm 10 - header := $(out)/syscalls_64.c 11 - sysprf := $(srctree)/tools/perf/arch/s390/entry/syscalls 12 - sysdef := $(sysprf)/syscall.tbl 13 - systbl := $(sysprf)/mksyscalltbl 14 - 15 - # Create output directory if not already present 16 - $(shell [ -d '$(out)' ] || mkdir -p '$(out)') 17 - 18 - $(header): $(sysdef) $(systbl) 19 - $(Q)$(SHELL) '$(systbl)' $(sysdef) > $@ 20 - 21 - clean:: 22 - $(call QUIET_CLEAN, s390) $(RM) $(header) 23 - 24 - archheaders: $(header)
+2
tools/perf/arch/s390/entry/syscalls/Kbuild
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + syscall-y += syscalls_64.h
+5
tools/perf/arch/s390/entry/syscalls/Makefile.syscalls
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + 3 + syscall_abis_64 += renameat rlimit memfd_secret 4 + 5 + syscalltbl = $(srctree)/tools/perf/arch/s390/entry/syscalls/syscall.tbl
-32
tools/perf/arch/s390/entry/syscalls/mksyscalltbl
··· 1 - #!/bin/sh 2 - # SPDX-License-Identifier: GPL-2.0 3 - # 4 - # Generate system call table for perf 5 - # 6 - # Copyright IBM Corp. 2017, 2018 7 - # Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com> 8 - # 9 - 10 - SYSCALL_TBL=$1 11 - 12 - if ! test -r $SYSCALL_TBL; then 13 - echo "Could not read input file" >&2 14 - exit 1 15 - fi 16 - 17 - create_table() 18 - { 19 - local max_nr nr abi sc discard 20 - 21 - echo 'static const char *const syscalltbl_s390_64[] = {' 22 - while read nr abi sc discard; do 23 - printf '\t[%d] = "%s",\n' $nr $sc 24 - max_nr=$nr 25 - done 26 - echo '};' 27 - echo "#define SYSCALLTBL_S390_64_MAX_ID $max_nr" 28 - } 29 - 30 - grep -E "^[[:digit:]]+[[:space:]]+(common|64)" $SYSCALL_TBL \ 31 - |sort -k1 -n \ 32 - |create_table
+2
tools/perf/arch/s390/include/syscall_table.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #include <asm/syscalls_64.h>
+1 -5
tools/perf/util/syscalltbl.c
··· 14 14 #include <string.h> 15 15 #include "string2.h" 16 16 17 - #if defined(__s390x__) 18 - #include <asm/syscalls_64.c> 19 - const int syscalltbl_native_max_id = SYSCALLTBL_S390_64_MAX_ID; 20 - static const char *const *syscalltbl_native = syscalltbl_s390_64; 21 - #elif defined(GENERIC_SYSCALL_TABLE) 17 + #if defined(GENERIC_SYSCALL_TABLE) 22 18 #include <syscall_table.h> 23 19 const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID; 24 20 static const char *const *syscalltbl_native = syscalltbl;