From patchwork Fri Dec 13 00:33:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13906182 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 23789E7717F for ; Fri, 13 Dec 2024 00:52:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+pka+oHLhYgtgvKTbIDY/zAibUvBwaOFa9npTDjnf8A=; b=s/41KQNK1KJJF12oVrNKrPsus2 3/Da/Y+Ui3GTL1Z6MxQoLHMuGGX+BvU5BGD/onQ4x/pBNPW/dZWq6m+DvkoQz+p9NRrw5Ql3I+155 tXHQPdItZ7Yrcrh0GaFSUe1bC3Qr72JmDdNxcY7pG7FxJdoUuitMCAE6tVjs7/7crRVzK8LVLX5qk PHP8QIlWlajsF5t8bhrZgkRGUqjTabr2H0jXajNgVDryyyX8eAtkF2Y2Sgpjnq0AhX4b7bTq9xFvo 3rHxa4IzChcMlpAZNGbk9nOT7ZHJbR6rPWV+8xqtjsyixOCHfTrOiV/P/Qq0XQ2SqD1iKijrYAp5w q2jI04kw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLtuZ-00000002LYY-2tWt; Fri, 13 Dec 2024 00:52:07 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLtcp-00000002IJm-1QyM for linux-arm-kernel@lists.infradead.org; Fri, 13 Dec 2024 00:33:48 +0000 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2ee6dd1dd5eso941009a91.3 for ; Thu, 12 Dec 2024 16:33:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1734050027; x=1734654827; darn=lists.infradead.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=+pka+oHLhYgtgvKTbIDY/zAibUvBwaOFa9npTDjnf8A=; b=p7im8EJ6sZwZufJDEvTd4xkyCv1l7GmAXR46y9GOvRDVZMR55SFJieMBiwCiWdeUs5 4JgugG0QrDEq8waQ63A+Kxb3add2aM7lWz4qKq2IewQIDQASS0mz61WSgup/i2G98y6P 7DZRVtV4nJsUkcT7kuGxBGbPPwiiCZVZ21LjWII+6cU05jvsfs2lr7MZpijDhCnc0AY3 5da8x7Jdnx/lAryKy3I/hxRPo2cR2QLNCPkOfsCywbPJQicm1IPHND0lXipHWq5lPm43 1HLySRKWm+47Ph5/CYQYkE0M3X7lRK0+1hqQlgt4F6fpueptgV4Zy0s34qq/NxEz0i2O p95g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734050027; x=1734654827; 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=+pka+oHLhYgtgvKTbIDY/zAibUvBwaOFa9npTDjnf8A=; b=i1/YxbGj8gUC96B3F6mPSqdNgt8ktpFNGpLGZFBnXtSzwpIoafoaNvIyDJHzNCftw/ DbIAWJLcnaozhDThsCqUAQxOpxeUxBFcUjb1fFmQWpO29yWuk/AJqk7hHdqucAIa5yA9 gfosymSArU7iA9brWp5um81FQje3lAv8EXDsTLwngxV95B758MBNwMFYhxg3wyYQSGvR IRSOPFa3dToI1y5ToqwoS7yCHcQzOdcQYY7pqYeOdqXIwzWrDOswoEWZ8aWeejG8oXC7 hvyTaJOSFQTJs3mdSEmBqoM8rB4RCW7rH7duTbLCyDFEKetY5ak7R1wAcMAzFQ8zibA1 jFhw== X-Forwarded-Encrypted: i=1; AJvYcCXz73DEPSyhjWmUw+hxOXgMkaWmxmLc4j4W6vIMfUh/y+C4bNDMDOYjyc2YM8Uo9Bgu5kE9VoxmwKLzCBdjKo75@lists.infradead.org X-Gm-Message-State: AOJu0YzXVCEoBR+F9yMtCPOskFzRrVkolLumfk15x6MxdQqH8U+E4isS 5ItL3bqAcOh3w0dquP0sogBAfr6lKO34+8JClyd133SMORrNyI1gE/OFmsb/8R0= X-Gm-Gg: ASbGncvCB/sTGGAV6otjygoljeDmC+SLTyj2S8fq+0lcOQHBt7R+Wdfx4euOTAevHEW yI6zurYjB7ExMpDLE3W+OGNJs5XCvlf47WTZzVuR1cqyrLJlP92v/hc17dIBe5FrbGhIWxWhTcu KFtNCxKWHIPjCvkLO5F63esLDpwZ8JjVwRmD+Coe99tgQAM7pFAFn6ljAkysrIW8Y5P7pZlY/ia n9et/2yP4fcIhgox8C/9fWF8HcttMC7RIezcOLXgm7ILzf6JgVd7sekoKs9T8d5JbbL9pHc X-Google-Smtp-Source: AGHT+IHzZ3bXJ0cy5rr0lWYKZxXGVM8gv6U7Mp7+XdqikZu489dXujvjckGU7RMBQANT1p4rUrKCWA== X-Received: by 2002:a17:90b:2883:b0:2ee:8e75:4ae1 with SMTP id 98e67ed59e1d1-2f28fd69b42mr995910a91.21.1734050026769; Thu, 12 Dec 2024 16:33:46 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142e0ce50sm1934462a91.39.2024.12.12.16.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2024 16:33:45 -0800 (PST) From: Charlie Jenkins Date: Thu, 12 Dec 2024 16:33:05 -0800 Subject: [PATCH v2 15/16] perf tools: s390: Use generic syscall table scripts MIME-Version: 1.0 Message-Id: <20241212-perf_syscalltbl-v2-15-f8ca984ffe40@rivosinc.com> References: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@rivosinc.com> In-Reply-To: <20241212-perf_syscalltbl-v2-0-f8ca984ffe40@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 , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnt?= =?utf-8?q?her_Noack?= , Christian Brauner , Guo Ren , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Jonathan Corbet , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , 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.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6382; i=charlie@rivosinc.com; h=from:subject:message-id; bh=SdqrBFVai22Ulnc/RZqlr6Emdw7FO8UY/I4PiNM6pQc=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3p0w0GZf58rer42WZlmnpVUf5zmPq/zH4esfL1TEPe5W KXAyb87SlkYxDgYZMUUWXiuNTC33tEvOypaNgFmDisTyBAGLk4BmEiUDiPDXt7Zm4+6HwhXUnz6 oYjVdV3G7tM7j2xSneg9p3OqyGHJHEaGF36SiV2n5hp/y2R0edgx6fuOKTc4AiZsF1b56PnvV7c lHwA= X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_163347_387481_38B31337 X-CRM114-Status: GOOD ( 16.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 | 8 ++---- 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, 13 insertions(+), 65 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 1ca8c9814cbffbc4bbed3b40e0d6e53f0f9b77f1..c62622b4eb3dcbdfbd49ad371f15b92bfa4a6c43 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 := 1 - ifeq ($(SRCARCH),s390) - NO_SYSCALL_TABLE := 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 := 0 CFLAGS += -DGENERIC_SYSCALL_TABLE CFLAGS += -I$(OUTPUT)/tools/perf/arch/$(SRCARCH)/include/generated @@ -78,7 +74,7 @@ ifeq ($(SRCARCH),loongarch) endif ifeq ($(ARCH),s390) - CFLAGS += -fPIC -I$(OUTPUT)arch/s390/include/generated + CFLAGS += -fPIC endif ifeq ($(ARCH),mips) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 45bccc88e0087b57e4d9549e281cdbafc152a2fd..1f3262c1f9d44261be0315c693837cfdfb3071de 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -311,7 +311,7 @@ FEATURE_TESTS := all endif endif # architectures that use the generic syscall table -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)) 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 c431c21b11ef824535c1b9fb6ca4246d666fc97b..0033698a65ce5d5d7ebcc280399957561dd9d2c6 100644 --- a/tools/perf/arch/s390/Makefile +++ b/tools/perf/arch/s390/Makefile @@ -1,24 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only HAVE_KVM_STAT_SUPPORT := 1 PERF_HAVE_JITDUMP := 1 - -# -# Syscall table generation for perf -# - -out := $(OUTPUT)arch/s390/include/generated/asm -header := $(out)/syscalls_64.c -sysprf := $(srctree)/tools/perf/arch/s390/entry/syscalls -sysdef := $(sysprf)/syscall.tbl -systbl := $(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/s390/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..9a41e3572c3afd4f202321fd9e492714540e8fd3 --- /dev/null +++ b/tools/perf/arch/s390/entry/syscalls/Kbuild @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += 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 0000000000000000000000000000000000000000..9762d7abf17c3f79a6213e7306a5f7b56e833a78 --- /dev/null +++ b/tools/perf/arch/s390/entry/syscalls/Makefile.syscalls @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_64 += renameat rlimit memfd_secret + +syscalltbl = $(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 52eb88a77c94727aeb8c15427cdd43dfe5f9f2bd..0000000000000000000000000000000000000000 --- 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=$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[] = {' - while read nr abi sc discard; do - printf '\t[%d] = "%s",\n' $nr $sc - max_nr=$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 0000000000000000000000000000000000000000..b53e31c15805319a01719c22d489c4037378b02b --- /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 8869fed1a58946c590484816354d8c74aff52ee3..210f61b0a7a264a427ebb602185d3a9da2f426f4 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -14,11 +14,7 @@ #include #include "string2.h" -#if defined(__s390x__) -#include -const int syscalltbl_native_max_id = SYSCALLTBL_S390_64_MAX_ID; -static const char *const *syscalltbl_native = syscalltbl_s390_64; -#elif defined(GENERIC_SYSCALL_TABLE) +#if defined(GENERIC_SYSCALL_TABLE) #include const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID; static const char *const *syscalltbl_native = syscalltbl;