From patchwork Thu Jan 9 02:36:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13931891 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 071B5E77199 for ; Thu, 9 Jan 2025 02:56:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=v1i89asmMA3DelP2P4uZLNWbfIX6JQjUYl0xKhGv3jE=; b=00fuVPW5ym9GgD t3E0v1/5APMcHh5PPfAA1VJANORLJR/2sROy53hVklalm5/78Coi+9UisW0dyzW7h/PeG5stY5Hce 0QuyCy7ZRI+gGEplizc1ZAt3Ytyg1mMDdE0E0dlEXJ5l+ZEwVFr9l8jNGHUjnPy+ZBIeBmyTlIyAQ JMO+qRLTouhfVJ2hKZSe5K8M9hdTdSxML6ZF9vhRB7/otoU1Ap8DBLOJ5/UJ/jNRc0/XO4uaI/6Fn 9+biDojtSMj9NQoaX21ZgxMAqWpOSEXDgYJky8D6XasJOa44g+v0JA1fxH725NJVGKv8Gl8Yzvb1k OgJ8nj6ZXyJ/187QBoDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tViit-0000000AWxb-2h0H; Thu, 09 Jan 2025 02:56:39 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tViQ6-0000000ASZ0-44JX for linux-riscv@lists.infradead.org; Thu, 09 Jan 2025 02:37:17 +0000 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-218c8aca5f1so8288965ad.0 for ; Wed, 08 Jan 2025 18:37:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1736390234; x=1736995034; 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=Vr1AmSpAXQaPMTqNcGDOgGl9O+bLngonO0DcMs8xKEA=; b=LJhsuCIgCg6PaQONYY6vQfY0wJe5iFj00gBBcMw0Bu9L0KnQpV9vu3asYjnzas1EFI 6mVp8/dSJ215wbxAuVeEThn9bI0Ap1QQf471CyyHovDXfZlUNUmBJpWMq+OfUpLkGtw/ l7AnBxP5V4JI3n4TcgcRlidcCmwhXtT0f+ma9ZceA4QZ4YAZm5ndVI2YkrkJ+9+XLlpt sIcWoiKJHKZLjQ89acrVH+x/KHb4voEvCQqIDb+Hk03+Aiab+mjQZToRD+tY+KMLur6k qGQMz5Slj+yJ29MU0wSxz2AnkHwcwmEpaIMqiVXHjqh6pYj8fhHN+5FhYmyOUR07tTKZ OA0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736390234; x=1736995034; 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=Vr1AmSpAXQaPMTqNcGDOgGl9O+bLngonO0DcMs8xKEA=; b=eb/scsNiqV3aoW2bIg/OyUzFNucW46YVsDQ35s8Dzx56IM3SVAZvbFqIEy8ACFh24G M+fBg4CPHb9u8N8DbrHwz5LA3iW4guwuMl1nvrEgZTPd30FFSHtB4ionHhme49apDe9i 4vP7e9AeYiHmVau1WXosvrA7VQRLPBcQSV3pfVq8+0Lyb5rGKxCauX9jDw75hbe8vv2R c3kLFrErIKW64egjtq9Tbs1ptdLoOo+kyeOoO8wq+6316cjUKHlfstNIc6sc3AUAxBqG glqYPzZLmX1i47+Fi2lZHJick7d5V3Pe5rToc7EKaU9i1FZYlwp/KfJHlggC7rELjAFw Z0IQ== X-Forwarded-Encrypted: i=1; AJvYcCXHwyBAeToFpQimPYbqSMor27NgrYit96whulPSTRQD1EQOfkVIJ0/gIEdoyh9BC6YgClwS8BjGhWhEaw==@lists.infradead.org X-Gm-Message-State: AOJu0Yx2wQlFoSLBrUeGo/mWuUhUdVt3qqHIyxncBNo6EKlKnmwkGQT2 vS7AGyryO1tKR2Q8ACzVRuKH6B6woI4gKwe9seoeZEUpwozhN8Zbx1Qg24DmmF0= X-Gm-Gg: ASbGncsi2TE/PRi8fltb97HF+x8KY+sPNkbabDCiR4gtXZ1pUGSP0y95aOtY4P8ETGC BEgjWW0ZK6RwZdRl1kvOSBYFEk3V9qlPlbjQP4RbRGoUbkIVa11PMvT7HoqteFlTtspbUw37eVb 9XO75WuQelrlgcnS44Roy88KvlJqCQC6fU67e5yfBB5prOfykIAo25TVWXOWqImS8epTm472Dq7 1TeqheE5UG1V9bDePVCnjHSQHbYvBzOTz00m6cQYHmLts2GufDFv+kgqGwbNUhrcSU9i0s9 X-Google-Smtp-Source: AGHT+IFz+rK9PR+JzC1FWypELvWH1cEgCo1/H/4+lhIOHW9EGZFvsyY6ABvYR7ydQVwOeMLVFuh4vg== X-Received: by 2002:a17:902:d4cd:b0:216:3c2b:a5e5 with SMTP id d9443c01a7336-21a83f71115mr60403015ad.27.1736390234363; Wed, 08 Jan 2025 18:37:14 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9176bed6sm1434365ad.12.2025.01.08.18.37.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 18:37:13 -0800 (PST) From: Charlie Jenkins Date: Wed, 08 Jan 2025 18:36:30 -0800 Subject: [PATCH v6 15/16] perf tools: s390: Use generic syscall table scripts MIME-Version: 1.0 Message-Id: <20250108-perf_syscalltbl-v6-15-7543b5293098@rivosinc.com> References: <20250108-perf_syscalltbl-v6-0-7543b5293098@rivosinc.com> In-Reply-To: <20250108-perf_syscalltbl-v6-0-7543b5293098@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 , 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=6102; i=charlie@rivosinc.com; h=from:subject:message-id; bh=WUFZcwWRoAiXUoWOaiOcPbkuOTuGd1/b8k7miYOj5aI=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3q9mf5e1eXqbXJv61NV3h9jeCp2N/6Wx/6L05h0PF3qT CZ9i93VUcrCIMbBICumyMJzrYG59Y5+2VHRsgkwc1iZQIYwcHEKwEQ2NzD8Zu+0PnT4+jKbzMYp 4d757N3JCgf63ZoDL22dHs0rWJvexcjwSO5zzQrN1+c3N6hfSbKUDl0wuTLmXqjl4qzSs9nLD9b xAgA= 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-20250108_183715_043175_1A872CC1 X-CRM114-Status: GOOD ( 15.34 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=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 | 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 7213f6d806e5497309524cacb16bd8313e9bc5cb..feb61be7c4f93d7ebe0530839aebcd03ab8ec425 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -31,10 +31,6 @@ $(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 ifneq ($(filter $(SRCARCH), $(generic_syscall_table_archs)),) NO_SYSCALL_TABLE := 0 @@ -90,7 +86,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 0e30da3b781b5a51ea179ab15993391ff7055635..8081adf0e02354b9662a4e3c8493d6b1cec9fe25 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 -generic_syscall_table_archs := riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc +generic_syscall_table_archs := riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips powerpc s390 ifneq ($(filter $(SRCARCH), $(generic_syscall_table_archs)),) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif 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;