Skip to content

Commit a874d1f

Browse files
charlie-rivosacmel
authored andcommitted
perf tools x86: Use generic syscall scripts
Use the generic scripts to generate headers from the syscall table for both 32- and 64-bit x86. Signed-off-by: Charlie Jenkins <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Christian Brauner <[email protected]> Cc: Guo Ren <[email protected]> Cc: Günther Noack <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: James Clark <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: John Garry <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mickaël Salaün <[email protected]> Cc: Mike Leach <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 24f122d commit a874d1f

File tree

9 files changed

+20
-80
lines changed

9 files changed

+20
-80
lines changed

tools/perf/Makefile.config

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $(call detected_var,SRCARCH)
3131
ifneq ($(NO_SYSCALL_TABLE),1)
3232
NO_SYSCALL_TABLE := 1
3333

34-
ifeq ($(SRCARCH),$(filter $(SRCARCH),x86 powerpc arm64 s390 mips loongarch riscv))
34+
ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc arm64 s390 mips loongarch))
3535
NO_SYSCALL_TABLE := 0
3636
endif
3737

@@ -58,7 +58,6 @@ endif
5858
# Additional ARCH settings for x86
5959
ifeq ($(SRCARCH),x86)
6060
$(call detected,CONFIG_X86)
61-
CFLAGS += -I$(OUTPUT)arch/x86/include/generated
6261
ifeq (${IS_64_BIT}, 1)
6362
CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT
6463
ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S

tools/perf/Makefile.perf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ FEATURE_TESTS := all
311311
endif
312312
endif
313313
# architectures that use the generic syscall table
314-
generic_syscall_table_archs := riscv arc csky arm sh sparc xtensa
314+
generic_syscall_table_archs := riscv arc csky arm sh sparc xtensa x86
315315
ifneq ($(filter $(SRCARCH), $(generic_syscall_table_archs)),)
316316
include $(srctree)/tools/perf/scripts/Makefile.syscalls
317317
endif

tools/perf/arch/x86/Build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ perf-util-y += util/
22
perf-test-y += tests/
33

44
ifdef SHELLCHECK
5-
SHELL_TESTS := entry/syscalls/syscalltbl.sh
65
TEST_LOGS := $(SHELL_TESTS:%=%.shellcheck_log)
76
else
87
SHELL_TESTS :=

tools/perf/arch/x86/Makefile

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
11
# SPDX-License-Identifier: GPL-2.0
22
HAVE_KVM_STAT_SUPPORT := 1
33
PERF_HAVE_JITDUMP := 1
4-
5-
###
6-
# Syscall table generation
7-
#
8-
9-
generated := $(OUTPUT)arch/x86/include/generated
10-
out := $(generated)/asm
11-
header := $(out)/syscalls_64.c
12-
header_32 := $(out)/syscalls_32.c
13-
sys := $(srctree)/tools/perf/arch/x86/entry/syscalls
14-
systbl := $(sys)/syscalltbl.sh
15-
16-
# Create output directory if not already present
17-
$(shell [ -d '$(out)' ] || mkdir -p '$(out)')
18-
19-
$(header): $(sys)/syscall_64.tbl $(systbl)
20-
$(Q)$(SHELL) '$(systbl)' $(sys)/syscall_64.tbl 'x86_64' > $@
21-
22-
$(header_32): $(sys)/syscall_32.tbl $(systbl)
23-
$(Q)$(SHELL) '$(systbl)' $(sys)/syscall_32.tbl 'x86' > $@
24-
25-
clean::
26-
$(call QUIET_CLEAN, x86) $(RM) -r $(header) $(generated)
27-
28-
archheaders: $(header) $(header_32)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
syscall-y += syscalls_32.h
3+
syscall-y += syscalls_64.h
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
syscall_abis_32 += i386
4+
syscall_abis_64 +=
5+
6+
syscalltbl = $(srctree)/tools/perf/arch/x86/entry/syscalls/syscall_%.tbl

tools/perf/arch/x86/entry/syscalls/syscalltbl.sh

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#include <asm/bitsperlong.h>
3+
4+
#if __BITS_PER_LONG == 64
5+
#include <asm/syscalls_64.h>
6+
#else
7+
#include <asm/syscalls_32.h>
8+
#endif

tools/perf/util/syscalltbl.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,7 @@
1414
#include <string.h>
1515
#include "string2.h"
1616

17-
#if defined(__x86_64__)
18-
#include <asm/syscalls_64.c>
19-
const int syscalltbl_native_max_id = SYSCALLTBL_x86_64_MAX_ID;
20-
static const char *const *syscalltbl_native = syscalltbl_x86_64;
21-
#elif defined(__i386__)
22-
#include <asm/syscalls_32.c>
23-
const int syscalltbl_native_max_id = SYSCALLTBL_x86_MAX_ID;
24-
static const char *const *syscalltbl_native = syscalltbl_x86;
25-
#elif defined(__s390x__)
17+
#if defined(__s390x__)
2618
#include <asm/syscalls_64.c>
2719
const int syscalltbl_native_max_id = SYSCALLTBL_S390_64_MAX_ID;
2820
static const char *const *syscalltbl_native = syscalltbl_s390_64;

0 commit comments

Comments
 (0)