mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
perf tools mips: Use generic syscall scripts
Use the generic scripts to generate headers from the syscall table for mips. 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-13-7543b5293098@rivosinc.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
fa70857a27
commit
619ffe6694
7 changed files with 11 additions and 39 deletions
|
@ -31,7 +31,7 @@ $(call detected_var,SRCARCH)
|
||||||
ifneq ($(NO_SYSCALL_TABLE),1)
|
ifneq ($(NO_SYSCALL_TABLE),1)
|
||||||
NO_SYSCALL_TABLE := 1
|
NO_SYSCALL_TABLE := 1
|
||||||
|
|
||||||
ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc s390 mips))
|
ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc s390))
|
||||||
NO_SYSCALL_TABLE := 0
|
NO_SYSCALL_TABLE := 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -95,7 +95,6 @@ ifeq ($(ARCH),s390)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),mips)
|
ifeq ($(ARCH),mips)
|
||||||
CFLAGS += -I$(OUTPUT)arch/mips/include/generated
|
|
||||||
ifndef NO_LIBUNWIND
|
ifndef NO_LIBUNWIND
|
||||||
LIBUNWIND_LIBS = -lunwind -lunwind-mips
|
LIBUNWIND_LIBS = -lunwind -lunwind-mips
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -311,7 +311,7 @@ FEATURE_TESTS := all
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
# architectures that use the generic syscall table
|
# architectures that use the generic syscall table
|
||||||
generic_syscall_table_archs := riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch
|
generic_syscall_table_archs := riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips
|
||||||
ifneq ($(filter $(SRCARCH), $(generic_syscall_table_archs)),)
|
ifneq ($(filter $(SRCARCH), $(generic_syscall_table_archs)),)
|
||||||
include $(srctree)/tools/perf/scripts/Makefile.syscalls
|
include $(srctree)/tools/perf/scripts/Makefile.syscalls
|
||||||
endif
|
endif
|
||||||
|
|
2
tools/perf/arch/mips/entry/syscalls/Kbuild
Normal file
2
tools/perf/arch/mips/entry/syscalls/Kbuild
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
syscall-y += syscalls_64.h
|
5
tools/perf/arch/mips/entry/syscalls/Makefile.syscalls
Normal file
5
tools/perf/arch/mips/entry/syscalls/Makefile.syscalls
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
|
syscall_abis_64 += n64
|
||||||
|
|
||||||
|
syscalltbl = $(srctree)/tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl
|
|
@ -1,32 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# SPDX-License-Identifier: GPL-2.0
|
|
||||||
#
|
|
||||||
# Generate system call table for perf. Derived from
|
|
||||||
# s390 script.
|
|
||||||
#
|
|
||||||
# Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
|
|
||||||
# Changed by: Tiezhu Yang <yangtiezhu@loongson.cn>
|
|
||||||
|
|
||||||
SYSCALL_TBL=$1
|
|
||||||
|
|
||||||
if ! test -r $SYSCALL_TBL; then
|
|
||||||
echo "Could not read input file" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
create_table()
|
|
||||||
{
|
|
||||||
local max_nr nr abi sc discard
|
|
||||||
|
|
||||||
echo 'static const char *const syscalltbl_mips_n64[] = {'
|
|
||||||
while read nr abi sc discard; do
|
|
||||||
printf '\t[%d] = "%s",\n' $nr $sc
|
|
||||||
max_nr=$nr
|
|
||||||
done
|
|
||||||
echo '};'
|
|
||||||
echo "#define SYSCALLTBL_MIPS_N64_MAX_ID $max_nr"
|
|
||||||
}
|
|
||||||
|
|
||||||
grep -E "^[[:digit:]]+[[:space:]]+(n64)" $SYSCALL_TBL \
|
|
||||||
|sort -k1 -n \
|
|
||||||
|create_table
|
|
2
tools/perf/arch/mips/include/syscall_table.h
Normal file
2
tools/perf/arch/mips/include/syscall_table.h
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
|
#include <asm/syscalls_64.h>
|
|
@ -26,10 +26,6 @@ static const char *const *syscalltbl_native = syscalltbl_powerpc_64;
|
||||||
#include <asm/syscalls_32.c>
|
#include <asm/syscalls_32.c>
|
||||||
const int syscalltbl_native_max_id = SYSCALLTBL_POWERPC_32_MAX_ID;
|
const int syscalltbl_native_max_id = SYSCALLTBL_POWERPC_32_MAX_ID;
|
||||||
static const char *const *syscalltbl_native = syscalltbl_powerpc_32;
|
static const char *const *syscalltbl_native = syscalltbl_powerpc_32;
|
||||||
#elif defined(__mips__)
|
|
||||||
#include <asm/syscalls_n64.c>
|
|
||||||
const int syscalltbl_native_max_id = SYSCALLTBL_MIPS_N64_MAX_ID;
|
|
||||||
static const char *const *syscalltbl_native = syscalltbl_mips_n64;
|
|
||||||
#elif defined(GENERIC_SYSCALL_TABLE)
|
#elif defined(GENERIC_SYSCALL_TABLE)
|
||||||
#include <syscall_table.h>
|
#include <syscall_table.h>
|
||||||
const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID;
|
const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID;
|
||||||
|
|
Loading…
Add table
Reference in a new issue