From nobody Sun Nov 24 16:01:10 2024 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 BD9CC1FAC5B for ; Mon, 4 Nov 2024 21:07:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730754448; cv=none; b=Bw4VfMEfwyIlze4/KJQ9e+iZAaIoGIvfxhnq9tO0eKgeNsVJXFiKhZF0leQHyQH6WvLhSsFCAetAxwI0S3nKsVXP0hqEx+VTkBI28O1gTtiLmWBapXTEMqqZvsC4fhMNBwYh8eKDfxHNTj4clZgi3bsn66FGKsBvCtFrI60TFX8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730754448; c=relaxed/simple; bh=KeKtFvY7SKL2pD81p/skRGxyJKh4FWPknkDrKqvLM5M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EjDg/fVX31D48WjIVlYXeGWeyBmnmbLhzQbv5/9EAADDacCWgxqDv8UzKnjD4nVeOdLC8dpsIGKQI8NaK9VWMFI5N8edTQD5r4mAxQ4iHG+a3E0tW/fCULttNL6LMkB9y/UuGdo7eEl9ApneE+ZTfR5zh5thacSCkJ2T1irZOJE= 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=e6952aj+; arc=none smtp.client-ip=209.85.214.182 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="e6952aj+" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2114214c63eso14272025ad.3 for ; Mon, 04 Nov 2024 13:07:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1730754446; x=1731359246; 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=Oh0zgB7sLyVYV0helH3ndPFTnKM4MrkIfS9kOuYemTI=; b=e6952aj+Wp+FQxNfPVnfFyDgnf/JH1OoWjXoLkzzuAJK7Z9cPthsPwmv8j5vTuf1eX EG+XrQmZa05/iCaRMFRCtMrIRSgIAcAikRD68M0sriDdTZicuC0gnfRMqZeTDw+7J0r7 L1q12WnPQBtJdX2/pJ21X4kmaV5XdDf314GiMegIJ7IuQAMmZOaJvZIxWLhGpERN03je WskNQNKZmrDCG7eex4rjFI6FOG/u9Vef/J+Kfx3NbvEVQnqO3d77LxeMLvdHmsaNl7bB zjk9je3f7Bmfr5JFORxkxTU3GeCMNRg3VVPAdioJPf3bKvC8lrWx1fSLnp5y1RTCDdXp FkGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730754446; x=1731359246; 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=Oh0zgB7sLyVYV0helH3ndPFTnKM4MrkIfS9kOuYemTI=; b=ncZpeujwZgdnKtclXo2+xHs6wGLhJVnu+17xzk+gQhz//+MINJQhxSKT4tXQukLr5Q dQ9G9YDA/AQ0ce5eQAcKLm6zvIsw6HvOEwHr7ZzzBvA3HNWvXA//bcpvwutaqScBjL/Z 4o38U4w0k5LqVIf3hPgyLMOmaknKNiR0xQmMELJkDj+5GUtBIxibDDViu4ezSijonGIu Gm4m6JwJUg2i8Nj8pTLWVVU25QdVuXNxAH2yhimGj0xer+tvm2ZAoacn2Vu2V3cNfsj8 lWq0U/x1Pu1Fq/OrLRRpv3vln8AXK10A5EBtxnwIeDpmKP2uhj3HTTaD1cnm3J3h59F/ DUhg== X-Gm-Message-State: AOJu0Yy3cNgv7m06ao+om2k4u+EpWthjcX68gc+UH/xwQWYTL3bVhnss z7qe9y53d8wx/Rg1pT9B6cTf/A7yWF+tDfzaebZdiH5OKlLTEX+XZOB4nrppNzo= X-Google-Smtp-Source: AGHT+IHaBRmk3UxLy3c5UicvluKFbnEkpJfA4ngNOpqBKAciatcY4LjQasBBZP7W0E26B0O8UkiDSA== X-Received: by 2002:a17:903:228b:b0:20b:fd73:32bb with SMTP id d9443c01a7336-210c6872da0mr454535575ad.2.1730754446060; Mon, 04 Nov 2024 13:07:26 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2024 13:07:24 -0800 (PST) From: Charlie Jenkins Date: Mon, 04 Nov 2024 13:06:16 -0800 Subject: [PATCH RFT 14/16] perf tools: powerpc: Use generic syscall table 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-14-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=6676; i=charlie@rivosinc.com; h=from:subject:message-id; bh=KeKtFvY7SKL2pD81p/skRGxyJKh4FWPknkDrKqvLM5M=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ7qmeZz2rPuurp2hPgXxdcotzTm3tM22c29+sz776D/nV bOOH9vdUcrCIMbBICumyMJzrYG59Y5+2VHRsgkwc1iZQIYwcHEKwETWr2Bk6JV8Xb7skcWGDz84 p716arbsqNvxPJcbGUa7lwc5V57RmMfIcLryXNRfh+nxskfWRahvDzxpOKlzg/Hn99/tOzKflL2 dyQUA X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 Use the generic scripts to generate headers from the syscall table instead of the custom ones for powerpc. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 4 +-- tools/perf/Makefile.perf | 2 +- tools/perf/arch/powerpc/Makefile | 25 -------------- tools/perf/arch/powerpc/entry/syscalls/Kbuild | 3 ++ .../arch/powerpc/entry/syscalls/Makefile.syscalls | 6 ++++ .../perf/arch/powerpc/entry/syscalls/mksyscalltbl | 39 ------------------= ---- tools/perf/arch/powerpc/include/syscall_table.h | 8 +++++ tools/perf/util/syscalltbl.c | 8 ----- 8 files changed, 20 insertions(+), 75 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index ce7e9ae276e8..76dbd368aa9f 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)) + ifeq ($(SRCARCH),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 mips)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa = x86 alpha parisc arm64 loongarch mips powerpc)) 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 c9b78518c9a5..c42cc4901005 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 mips)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x8= 6 alpha parisc arm64 loongarch mips powerpc)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/powerpc/Makefile b/tools/perf/arch/powerpc/Mak= efile index bf6d323574f6..42dab7c8f508 100644 --- a/tools/perf/arch/powerpc/Makefile +++ b/tools/perf/arch/powerpc/Makefile @@ -6,28 +6,3 @@ endif HAVE_KVM_STAT_SUPPORT :=3D 1 PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET :=3D 1 PERF_HAVE_JITDUMP :=3D 1 - -# -# Syscall table generation for perf -# - -out :=3D $(OUTPUT)arch/powerpc/include/generated/asm -header32 :=3D $(out)/syscalls_32.c -header64 :=3D $(out)/syscalls_64.c -sysprf :=3D $(srctree)/tools/perf/arch/powerpc/entry/syscalls -sysdef :=3D $(sysprf)/syscall.tbl -systbl :=3D $(sysprf)/mksyscalltbl - -# Create output directory if not already present -$(shell [ -d '$(out)' ] || mkdir -p '$(out)') - -$(header64): $(sysdef) $(systbl) - $(Q)$(SHELL) '$(systbl)' '64' $(sysdef) > $@ - -$(header32): $(sysdef) $(systbl) - $(Q)$(SHELL) '$(systbl)' '32' $(sysdef) > $@ - -clean:: - $(call QUIET_CLEAN, powerpc) $(RM) $(header32) $(header64) - -archheaders: $(header32) $(header64) diff --git a/tools/perf/arch/powerpc/entry/syscalls/Kbuild b/tools/perf/arc= h/powerpc/entry/syscalls/Kbuild new file mode 100644 index 000000000000..84c6599b4ea6 --- /dev/null +++ b/tools/perf/arch/powerpc/entry/syscalls/Kbuild @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y +=3D syscalls_32.h +syscall-y +=3D syscalls_64.h diff --git a/tools/perf/arch/powerpc/entry/syscalls/Makefile.syscalls b/too= ls/perf/arch/powerpc/entry/syscalls/Makefile.syscalls new file mode 100644 index 000000000000..f7e87a61401c --- /dev/null +++ b/tools/perf/arch/powerpc/entry/syscalls/Makefile.syscalls @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_32 +=3D spu nospu +syscall_abis_64 +=3D spu nospu + +syscalltbl =3D $(srctree)/tools/perf/arch/powerpc/entry/syscalls/syscall.t= bl diff --git a/tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl b/tools/pe= rf/arch/powerpc/entry/syscalls/mksyscalltbl deleted file mode 100755 index 0eb316fe6dd1..000000000000 --- a/tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 -# -# Generate system call table for perf. Derived from -# s390 script. -# -# Copyright IBM Corp. 2017 -# Author(s): Hendrik Brueckner -# Changed by: Ravi Bangoria - -wordsize=3D$1 -SYSCALL_TBL=3D$2 - -if ! test -r $SYSCALL_TBL; then - echo "Could not read input file" >&2 - exit 1 -fi - -create_table() -{ - local wordsize=3D$1 - local max_nr nr abi sc discard - max_nr=3D-1 - nr=3D0 - - echo "static const char *const syscalltbl_powerpc_${wordsize}[] =3D {" - while read nr abi sc discard; do - if [ "$max_nr" -lt "$nr" ]; then - printf '\t[%d] =3D "%s",\n' $nr $sc - max_nr=3D$nr - fi - done - echo '};' - echo "#define SYSCALLTBL_POWERPC_${wordsize}_MAX_ID $max_nr" -} - -grep -E "^[[:digit:]]+[[:space:]]+(common|spu|nospu|${wordsize})" $SYSCALL= _TBL \ - |sort -k1 -n \ - |create_table ${wordsize} diff --git a/tools/perf/arch/powerpc/include/syscall_table.h b/tools/perf/a= rch/powerpc/include/syscall_table.h new file mode 100644 index 000000000000..7ff51b783000 --- /dev/null +++ b/tools/perf/arch/powerpc/include/syscall_table.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include + +#if __BITS_PER_LONG =3D=3D 64 +#include +#else +#include +#endif diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c index 724e1391893f..4320876242ae 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -17,14 +17,6 @@ #include const int syscalltbl_native_max_id =3D SYSCALLTBL_S390_64_MAX_ID; static const char *const *syscalltbl_native =3D syscalltbl_s390_64; -#elif defined(__powerpc64__) -#include -const int syscalltbl_native_max_id =3D SYSCALLTBL_POWERPC_64_MAX_ID; -static const char *const *syscalltbl_native =3D syscalltbl_powerpc_64; -#elif defined(__powerpc__) -#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(GENERIC_SYSCALL_TABLE) #include const int syscalltbl_native_max_id =3D SYSCALLTBL_MAX_ID; --=20 2.34.1