Skip to content

Commit fa70857

Browse files
charlie-rivosacmel
authored andcommitted
perf tools loongarch: Use syscall table
loongarch uses a syscall table, use that in perf instead of using unistd.h. Signed-off-by: Charlie Jenkins <[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 cb8197d commit fa70857

File tree

8 files changed

+9
-74
lines changed

8 files changed

+9
-74
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),powerpc s390 mips loongarch))
34+
ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc s390 mips))
3535
NO_SYSCALL_TABLE := 0
3636
endif
3737

@@ -85,7 +85,6 @@ ifeq ($(SRCARCH),arm64)
8585
endif
8686

8787
ifeq ($(SRCARCH),loongarch)
88-
CFLAGS += -I$(OUTPUT)arch/loongarch/include/generated
8988
ifndef NO_LIBUNWIND
9089
LIBUNWIND_LIBS = -lunwind -lunwind-loongarch64
9190
endif

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 x86 alpha parisc arm64
314+
generic_syscall_table_archs := riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch
315315
ifneq ($(filter $(SRCARCH), $(generic_syscall_table_archs)),)
316316
include $(srctree)/tools/perf/scripts/Makefile.syscalls
317317
endif

tools/perf/arch/loongarch/Makefile

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
11
# SPDX-License-Identifier: GPL-2.0
22
PERF_HAVE_JITDUMP := 1
33
HAVE_KVM_STAT_SUPPORT := 1
4-
5-
#
6-
# Syscall table generation for perf
7-
#
8-
9-
out := $(OUTPUT)arch/loongarch/include/generated/asm
10-
header := $(out)/syscalls.c
11-
incpath := $(srctree)/tools
12-
sysdef := $(srctree)/tools/arch/loongarch/include/uapi/asm/unistd.h
13-
sysprf := $(srctree)/tools/perf/arch/loongarch/entry/syscalls/
14-
systbl := $(sysprf)/mksyscalltbl
15-
16-
# Create output directory if not already present
17-
$(shell [ -d '$(out)' ] || mkdir -p '$(out)')
18-
19-
$(header): $(sysdef) $(systbl)
20-
$(Q)$(SHELL) '$(systbl)' '$(CC)' '$(HOSTCC)' $(incpath) $(sysdef) > $@
21-
22-
clean::
23-
$(call QUIET_CLEAN, loongarch) $(RM) $(header)
24-
25-
archheaders: $(header)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
syscall-y += syscalls_64.h
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+
3+
syscall_abis_64 +=

tools/perf/arch/loongarch/entry/syscalls/mksyscalltbl

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#include <asm/syscall_table_64.h>

tools/perf/util/syscalltbl.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ static const char *const *syscalltbl_native = syscalltbl_powerpc_32;
3030
#include <asm/syscalls_n64.c>
3131
const int syscalltbl_native_max_id = SYSCALLTBL_MIPS_N64_MAX_ID;
3232
static const char *const *syscalltbl_native = syscalltbl_mips_n64;
33-
#elif defined(__loongarch__)
34-
#include <asm/syscalls.c>
35-
const int syscalltbl_native_max_id = SYSCALLTBL_LOONGARCH_MAX_ID;
36-
static const char *const *syscalltbl_native = syscalltbl_loongarch;
3733
#elif defined(GENERIC_SYSCALL_TABLE)
3834
#include <syscall_table.h>
3935
const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID;

0 commit comments

Comments
 (0)