From nobody Sun Nov 24 16:02:46 2024 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 320461FC7F5 for ; Mon, 4 Nov 2024 21:07:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730754451; cv=none; b=ak5ZRmRJxVCMXv5gnljKb0Wc24I62cybqHk1A7f2qomb9sKKRgRafdmMCWsB+8vGUasFPfMqXesCTKV/A3M/TQ62Ray3F/eHL3N1Dj0VxYkIN4wHZcCkt2MDBm8H5B/Lpp67A/RaGb40tg931bS46wqRhMGM8/7DveKpCfWtIcc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730754451; c=relaxed/simple; bh=eFfpWK4xa8S+wLkT7ES+qqXB5NBSakxC8AalGF7WLEk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KWJvxtIl+5J26Hm/Pt+Vz6t7P5ZjkwK3liIdf8EgZkue22I3OMD5zj/zdtEut2UakhcCud1DJGRrJV/mxQM6ac5JdLhMPspqGTvDd9bTxxAeMR06fjLYsa7HZHqn++4YhQp6T65GuFOqhg4TGZ2vfVCx3PF3OZhjNzxmxwBJbvM= 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=2933aUyO; arc=none smtp.client-ip=209.85.210.170 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="2933aUyO" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-7206304f93aso4465697b3a.0 for ; Mon, 04 Nov 2024 13:07:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1730754448; x=1731359248; 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=/9aAf//xsc+qyoWm90gSA4rERDZKwTaDGDbX2kwPoNk=; b=2933aUyOxSbelxtVRkC/C2QhAgvajPEkPgXqMTrCfykY2qpTn/PH+bcW8AC8fq2cuw BqxKxN/+onKMBxmVcquCXlOOo6QgkqozPoiyRNXE7ldInbjcKacDsxlYnDNsZDTYOA1x X8A36DHT93X/2Xvuc9kU3BOb4ridRpNf5Su8gQVJkGhfvByuuLlCs97vg1HNb7ovIhKQ tNKjZ/+qKvOV9Zabmjc1cA6QoG0wwXIvX/v/oOvoEqv1jdakWvncWQQjd57c1pl96nFX RQfpXuGkyJCxX40D7re2xHwa9lktZhNYPUYfficeBtMYe+JygGE+hGjy6LceDV6vWu7O Cmug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730754448; x=1731359248; 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=/9aAf//xsc+qyoWm90gSA4rERDZKwTaDGDbX2kwPoNk=; b=G11y8X5YjNw3LHIykXgsjCMzBv0LGO+ge88pxXNGxn/VAt2q4qp+eTTl9WzYiJbR7O UhL+/rGVkkXnyMor/keOZ4LcSXKL6wwewhGAUPNBaVCboqcQd3A+Af1yPJkgz/UmjpcA aomXtEWZByJMgD5OQ6qP7z6OFPhZjYtBgkpXU6+vbmkk8VwIulUFKzIhMtBzk3rbJjT0 aV2hwyLkeTM0qxOMueGVBW0/HfaSfHiN0N4HdblCYXUvDZQm9n8FK2z1dnsGHlTwl3Eo bd9FTxVX65Iz2euY9jvQp5UCybNPXxR4F+CD/71NHOFE39ha0Uxod53wFTYr6c/wOnHU y3LQ== X-Gm-Message-State: AOJu0YwHdyZgzsdOTdVcvMYUAb9XR/F5JJBqWGpfBuMOrnTVqhdxCnhA gUzoEiYA77ttubutxZmGFPYLQzFqkpLX5Pp9dVLqGQP77Nw45U+gCG5Iv5750Kc= X-Google-Smtp-Source: AGHT+IGvYeT+krz8voIyeoeU2/dXj8vAkufm8V4iViqZtgJPyxxokpzx5Frwcvtmq4ySA6UxRwfZZA== X-Received: by 2002:a05:6a21:6da2:b0:1db:ee29:4f4c with SMTP id adf61e73a8af0-1dbee294f98mr1611579637.23.1730754448579; Mon, 04 Nov 2024 13:07:28 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2024 13:07:27 -0800 (PST) From: Charlie Jenkins Date: Mon, 04 Nov 2024 13:06:17 -0800 Subject: [PATCH RFT 15/16] perf tools: s390: 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-15-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=5741; i=charlie@rivosinc.com; h=from:subject:message-id; bh=eFfpWK4xa8S+wLkT7ES+qqXB5NBSakxC8AalGF7WLEk=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ7qmeXxL3MUlp9x8JC/YbXVeJXFjb2DN0+pTIbNyCpekK D9S+lDRUcrCIMbBICumyMJzrYG59Y5+2VHRsgkwc1iZQIYwcHEKwERU5zL8FehLKJDQOunZK13R El059cySv/KN1/WX3bW28WPuO5pygZHh649Fy9k3VTp/OtR7fHtE51ln19UPnUruZMsV/j3yo/U BMwA= 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 s390. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 6 +--- tools/perf/Makefile.perf | 2 +- tools/perf/arch/s390/Makefile | 21 -------------- tools/perf/arch/s390/entry/syscalls/Kbuild | 2 ++ .../arch/s390/entry/syscalls/Makefile.syscalls | 5 ++++ tools/perf/arch/s390/entry/syscalls/mksyscalltbl | 32 ------------------= ---- tools/perf/arch/s390/include/syscall_table.h | 2 ++ tools/perf/util/syscalltbl.c | 6 +--- 8 files changed, 12 insertions(+), 64 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 76dbd368aa9f..787be3201eec 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -31,12 +31,8 @@ $(call detected_var,SRCARCH) ifneq ($(NO_SYSCALL_TABLE),1) NO_SYSCALL_TABLE :=3D 1 =20 - ifeq ($(SRCARCH),s390) - NO_SYSCALL_TABLE :=3D 0 - endif - # 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 powerpc)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa = x86 alpha parisc arm64 loongarch mips powerpc s390)) 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 c42cc4901005..410d850f7b9a 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 powerpc)) +ifeq ($(SRCARCH),$(filter $(SRCARCH),riscv arc csky arm sh sparc xtensa x8= 6 alpha parisc arm64 loongarch mips powerpc s390)) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif include Makefile.config diff --git a/tools/perf/arch/s390/Makefile b/tools/perf/arch/s390/Makefile index 56994e63b43a..51dd7d7827e5 100644 --- a/tools/perf/arch/s390/Makefile +++ b/tools/perf/arch/s390/Makefile @@ -5,24 +5,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/s390/include/generated/asm -header :=3D $(out)/syscalls_64.c -sysprf :=3D $(srctree)/tools/perf/arch/s390/entry/syscalls -sysdef :=3D $(sysprf)/syscall.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, s390) $(RM) $(header) - -archheaders: $(header) diff --git a/tools/perf/arch/s390/entry/syscalls/Kbuild b/tools/perf/arch/s= 390/entry/syscalls/Kbuild new file mode 100644 index 000000000000..9a41e3572c3a --- /dev/null +++ b/tools/perf/arch/s390/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/s390/entry/syscalls/Makefile.syscalls b/tools/= perf/arch/s390/entry/syscalls/Makefile.syscalls new file mode 100644 index 000000000000..9762d7abf17c --- /dev/null +++ b/tools/perf/arch/s390/entry/syscalls/Makefile.syscalls @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_64 +=3D renameat rlimit memfd_secret + +syscalltbl =3D $(srctree)/tools/perf/arch/s390/entry/syscalls/syscall.tbl diff --git a/tools/perf/arch/s390/entry/syscalls/mksyscalltbl b/tools/perf/= arch/s390/entry/syscalls/mksyscalltbl deleted file mode 100755 index 52eb88a77c94..000000000000 --- a/tools/perf/arch/s390/entry/syscalls/mksyscalltbl +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 -# -# Generate system call table for perf -# -# Copyright IBM Corp. 2017, 2018 -# Author(s): Hendrik Brueckner -# - -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_s390_64[] =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_S390_64_MAX_ID $max_nr" -} - -grep -E "^[[:digit:]]+[[:space:]]+(common|64)" $SYSCALL_TBL \ - |sort -k1 -n \ - |create_table diff --git a/tools/perf/arch/s390/include/syscall_table.h b/tools/perf/arch= /s390/include/syscall_table.h new file mode 100644 index 000000000000..b53e31c15805 --- /dev/null +++ b/tools/perf/arch/s390/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 4320876242ae..9341f0d442fe 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -13,11 +13,7 @@ #include #include "string2.h" =20 -#if defined(__s390x__) -#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(GENERIC_SYSCALL_TABLE) +#if defined(GENERIC_SYSCALL_TABLE) #include const int syscalltbl_native_max_id =3D SYSCALLTBL_MAX_ID; static const char *const *syscalltbl_native =3D syscalltbl; --=20 2.34.1