From nobody Sun Nov 24 15:42:05 2024 Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FE271FAC5F for ; Mon, 4 Nov 2024 21:07:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730754447; cv=none; b=rP3bppUToJsxYQ38uIIqhHm4jyRW5d/BDpH0rgM7+jHq+9pKqLO4j3X+nRPmoJI2M4EO/XDMR8iRggcTkrUEYY9PcVpZu/edFpT4TtEJuF45uFFWT6gtIzH7Iqh2jXJNCeEtV9nUTASmYS/bil2qIidBrbzymOBS3RrW4n7vtNg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730754447; c=relaxed/simple; bh=OoyBSoSR0YKW97xqx60uS1tbyNrKDGxM4Vocad6xjfw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NE6tFtumzAN2HxCWDan8x8SL1uXyVUshFHSzyIpAnJTxSuYXgo3eYbiAe6eJYcYk/2Xf+V/T4MSOLl9/+LkYQ4oxfEH9dgOMvGe9IeN5BUd3/iHcpBJLRb2jlwfHzddWIhYrEYxZEQuBhh3M4ELZ4Hc2fwKCVl7Mb5A7RbWZcT0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=jFnpIdpI; arc=none smtp.client-ip=209.85.167.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="jFnpIdpI" Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3e619057165so2272300b6e.1 for ; Mon, 04 Nov 2024 13:07:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1730754445; x=1731359245; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=92GrRLDgka7EWUObBkAeZ/OwF0Pa5ocJ0bqq37OhKZU=; b=jFnpIdpIcYo0Giy+0B5TxmWYZRsCfg5QbP/oWvJHy+kAGEKqW4aynIc80Lf1khCl3I fcNb14iJbXpG/8dmIZ/U4pJJaINQg/aSCXg5LpN3HyrgL/pP8V29kPz4JSKNpB/2KwKe P+WtTOz6J2sJ9j2Vqazng5/DprYwc6gTkv1TkSVXYBNCnGxnp61r1RYuESRCwUjvC4d4 sWXv+YB+w11uJf3sYxfBbs5n0DexWhxEcmfqXHVqzL5Z3s2HB7SjF5g9okfBLlZ9Lkmy vmT5IkbKvniXRWh60VjFYd2GvVDoSYvGfxHT4Y2aGRZDXaXUGPUL8uMIUjIbEZwKu4IF EGjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730754445; x=1731359245; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=92GrRLDgka7EWUObBkAeZ/OwF0Pa5ocJ0bqq37OhKZU=; b=Ta+BHABaFEWDzUqAbCW5rT9zoW4EdTdhFKKL+v0rvnw9Xj+cK/6fppDXalwkcUOTZ1 OqULDjKEiHNX2FfRwpS2wsdXCFltuIGGHR1kJNi0Bhz/U4Piun/gQXFOOvpRVjQXpH1h b/yN3otRkVVY1LicItnlTUYmBNEFx7tpkLbpC6y1XmzFXbZJG1xRw4n49HAFjvnapmKZ +VPcf8OF5CWGFe/g75IKXosCaBmiqwmQ2sd6gCXmqtRJyMY8sYr1g7nW4BjQyqBmFJpq FtxXSSfpddGzgZ7RYZdoqIKZO/b4Yy1/BJa83pmSCaQDt+jwcXSJoHWuiorzqhBc6zpq p3KA== X-Gm-Message-State: AOJu0YwMOpGDsk+GBm60crhBflEOEsP3zVBV7WxIWjOzlTItjnw83pXp Bzov1R0fb1Ng5MYaQZOHUC7PWToNVe6PsvVmeKpcVW24Hd0p1FM7DTvzAT00KiA= X-Google-Smtp-Source: AGHT+IHwghEtsWHSIgna9eRpd6cfglYULyLkTu6aW9WjgN7UGabPnfWIpz8Ez2eA6OMZ9FOUKr0wsQ== X-Received: by 2002:a05:6808:2dc6:b0:3e5:d5c3:e88b with SMTP id 5614622812f47-3e638252a38mr30658820b6e.20.1730754443278; Mon, 04 Nov 2024 13:07:23 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ee490e08f4sm7248293a12.40.2024.11.04.13.07.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2024 13:07:22 -0800 (PST) From: Charlie Jenkins Date: Mon, 04 Nov 2024 13:06:15 -0800 Subject: [PATCH RFT 13/16] perf tools: mips: Use generic syscall scripts Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241104-perf_syscalltbl-v1-13-9adae5c761ef@rivosinc.com> References: <20241104-perf_syscalltbl-v1-0-9adae5c761ef@rivosinc.com> In-Reply-To: <20241104-perf_syscalltbl-v1-0-9adae5c761ef@rivosinc.com> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , Albert Ou , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnther_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, linux-csky@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5807; i=charlie@rivosinc.com; h=from:subject:message-id; bh=OoyBSoSR0YKW97xqx60uS1tbyNrKDGxM4Vocad6xjfw=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ7qmeVzDqo9uN3/P0e+Y+X1GiiP7lWxnO5VU4cipb0t8O 5kz3nN1lLIwiHEwyIopsvBca2BuvaNfdlS0bALMHFYmkCEMXJwCMBEGAYb/defFH23OC3SMv36g U1NugXWUcNuMmNgu5wCu+wzKvy8FMzLs5BRVS1Z/f++7lcHm5Gu/D77wY1nimvjxivmqdWe+3k/ lAAA= X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 Use the generic scripts to generate headers from the syscall table for mips. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 4 +-- tools/perf/Makefile.perf | 2 +- tools/perf/arch/mips/Makefile | 18 ------------ tools/perf/arch/mips/entry/syscalls/Kbuild | 2 ++ .../arch/mips/entry/syscalls/Makefile.syscalls | 5 ++++ tools/perf/arch/mips/entry/syscalls/mksyscalltbl | 32 ------------------= ---- tools/perf/arch/mips/include/syscall_table.h | 2 ++ tools/perf/util/syscalltbl.c | 4 --- 8 files changed, 12 insertions(+), 57 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 2cf45e3f2659..ce7e9ae276e8 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -31,12 +31,12 @@ $(call detected_var,SRCARCH) ifneq ($(NO_SYSCALL_TABLE),1) NO_SYSCALL_TABLE :=3D 1 =20 - ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc s390 mips)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc s390)) NO_SYSCALL_TABLE :=3D 0 endif =20 # architectures that use the generic syscall table scripts - ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa = x86 alpha parisc arm64 loongarch)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa = x86 alpha parisc arm64 loongarch mips)) NO_SYSCALL_TABLE :=3D 0 CFLAGS +=3D -DGENERIC_SYSCALL_TABLE CFLAGS +=3D -I$(OUTPUT)arch/$(SRCARCH)/include/generated diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index ce2c4e1c0623..c9b78518c9a5 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS :=3D all endif endif # architectures that use the generic syscall table -ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x8= 6 alpha parisc arm64 loongarch)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x8= 6 alpha parisc arm64 loongarch mips)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/mips/Makefile b/tools/perf/arch/mips/Makefile index cd0b011b3be5..6e1106fab26e 100644 --- a/tools/perf/arch/mips/Makefile +++ b/tools/perf/arch/mips/Makefile @@ -2,21 +2,3 @@ ifndef NO_DWARF PERF_HAVE_DWARF_REGS :=3D 1 endif - -# Syscall table generation for perf -out :=3D $(OUTPUT)arch/mips/include/generated/asm -header :=3D $(out)/syscalls_n64.c -sysprf :=3D $(srctree)/tools/perf/arch/mips/entry/syscalls -sysdef :=3D $(sysprf)/syscall_n64.tbl -systbl :=3D $(sysprf)/mksyscalltbl - -# Create output directory if not already present -$(shell [ -d '$(out)' ] || mkdir -p '$(out)') - -$(header): $(sysdef) $(systbl) - $(Q)$(SHELL) '$(systbl)' $(sysdef) > $@ - -clean:: - $(call QUIET_CLEAN, mips) $(RM) $(header) - -archheaders: $(header) diff --git a/tools/perf/arch/mips/entry/syscalls/Kbuild b/tools/perf/arch/m= ips/entry/syscalls/Kbuild new file mode 100644 index 000000000000..9a41e3572c3a --- /dev/null +++ b/tools/perf/arch/mips/entry/syscalls/Kbuild @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y +=3D syscalls_64.h diff --git a/tools/perf/arch/mips/entry/syscalls/Makefile.syscalls b/tools/= perf/arch/mips/entry/syscalls/Makefile.syscalls new file mode 100644 index 000000000000..9ee914bdfb05 --- /dev/null +++ b/tools/perf/arch/mips/entry/syscalls/Makefile.syscalls @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_64 +=3D n64 + +syscalltbl =3D $(srctree)/tools/perf/arch/mips/entry/syscalls/syscall_n64.= tbl diff --git a/tools/perf/arch/mips/entry/syscalls/mksyscalltbl b/tools/perf/= arch/mips/entry/syscalls/mksyscalltbl deleted file mode 100644 index c0d93f959c4e..000000000000 --- a/tools/perf/arch/mips/entry/syscalls/mksyscalltbl +++ /dev/null @@ -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 -# Changed by: Tiezhu Yang - -SYSCALL_TBL=3D$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[] =3D {' - while read nr abi sc discard; do - printf '\t[%d] =3D "%s",\n' $nr $sc - max_nr=3D$nr - done - echo '};' - echo "#define SYSCALLTBL_MIPS_N64_MAX_ID $max_nr" -} - -grep -E "^[[:digit:]]+[[:space:]]+(n64)" $SYSCALL_TBL \ - |sort -k1 -n \ - |create_table diff --git a/tools/perf/arch/mips/include/syscall_table.h b/tools/perf/arch= /mips/include/syscall_table.h new file mode 100644 index 000000000000..b53e31c15805 --- /dev/null +++ b/tools/perf/arch/mips/include/syscall_table.h @@ -0,0 +1,2 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c index 7c8550ef0d7b..724e1391893f 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -25,10 +25,6 @@ static const char *const *syscalltbl_native =3D syscallt= bl_powerpc_64; #include const int syscalltbl_native_max_id =3D SYSCALLTBL_POWERPC_32_MAX_ID; static const char *const *syscalltbl_native =3D syscalltbl_powerpc_32; -#elif defined(__mips__) -#include -const int syscalltbl_native_max_id =3D SYSCALLTBL_MIPS_N64_MAX_ID; -static const char *const *syscalltbl_native =3D syscalltbl_mips_n64; #elif defined(GENERIC_SYSCALL_TABLE) #include const int syscalltbl_native_max_id =3D SYSCALLTBL_MAX_ID; --=20 2.34.1