From patchwork Wed Jan 8 02:08:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13930095 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 35F70E77198 for ; Wed, 8 Jan 2025 03:37:17 +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=c8uNJ/vXA7NGF0yxSiSP2RkC1jPs5fLciqUxBAB6Mg4=; b=w5li8nma20575ryYN1HYavnj5b KyK+DjiSbTegpTCsFIXb+3wIi27pRNrqHbNThzepPeBPybV1JRaSWOEymymZfHwer/5n6qkzfGZIR ni8wYIVYEuZUuWq9EpVfr9Y+Q1Y751a0sIYObnxNlxV1t8mnOjtGGLCKWA1bmnayqveCqKkJFo6rL gQFo0CQMzJL+gf0s9OAmKS7gD77FH/eUC90WwxMPMs2ecNLAxUtgjiFNtwRCFb8fAhAQXmeIWkM8S rPE6Tp/U542BHVcMDhWbxlXx1U9fUNsVVT2TKMN4epnbJTwnMDcvHpln+JOJl6V5xu0F07QtQebOS pHCI7lBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tVMsV-000000072IK-06at; Wed, 08 Jan 2025 03:37:07 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tVLUv-00000006oyF-1EtL for linux-arm-kernel@lists.infradead.org; Wed, 08 Jan 2025 02:08:42 +0000 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2163dc5155fso237076765ad.0 for ; Tue, 07 Jan 2025 18:08:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1736302120; x=1736906920; 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=c8uNJ/vXA7NGF0yxSiSP2RkC1jPs5fLciqUxBAB6Mg4=; b=h0CcqLd0e9N24HcmoCYfSF+skq0TZL2CxCInBJcjNG0lmlxH/qMQ5HMU/tihuHe0/F 6jLtYcGSTx0AOJiuQHo9RIlb5+3Ct+L8no2HCndEqIREMNYWdBaPtKHaBHXJB+V2lff+ 445N7305cQTgZkjTOxYuk0X6j7Njs1FaYCmPKSvo9u9anABtJ1fmmCqJlo2JVXXP21PZ QVR4qhR7g2OMhbzTNegHqlqAEfUubSiK9uU9CIcGDFuXehhQAlyr5urULdoVZ6SISHv3 X5hKZgONUlcypI06s82PifUvd2xDbvFEhLRaux7dfiZETovc65yto6g6SfNngUNBNqhi S5Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736302120; x=1736906920; 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=c8uNJ/vXA7NGF0yxSiSP2RkC1jPs5fLciqUxBAB6Mg4=; b=Jm+q3QNnH9TNtqNThnl5uXRqOJyNfpZVGgDV8cgdcZZOBHwlMvNj4e5p2HZrqRzjoI MfpMcDo/7qAhbGzQ0OIPNkCi0mxkuyiI1TiKd1DR3Sj+99u+pe2TiKx63YB0tCZgiP4A Isgnnss6hGM3q9UG3jllak2k6ppt42IqQmWnt5jbwo05/ugE+Lo7GADpvH3VwV0pYfDG vj4nxnOlaW/P8V5f0mz3DcaRzS+xu2PqtJzLbpdQu4eqnUGofmLzw3T59peV8dpYknQh 1T9iT7qN3gJgcK+deVjNPGSabIeEVjlDDcJmNqsi+h2FK/KPQWDb7nSpW6HJRyBSeABs OtuA== X-Forwarded-Encrypted: i=1; AJvYcCXB3PT2WatkP42iZSHvJhtDRGe+VH7mHcoCcEQHVswqQEDHEbTDIM9NMWXBoalTOZOVOIK71K2UazO5AELuRsHI@lists.infradead.org X-Gm-Message-State: AOJu0YzIrH3pcvUIsNXhrIi+XKLyNhfbScM0uJ8qLp4vOILDmjZVPFrE hHmYQCHPTNjHUSQs0i1+ciaxBF3bA4n4ebZwR/3b+yfwqVeCpzkzYk2MbSSVbfI= X-Gm-Gg: ASbGncukeq++uMOsLFGHCiL49davsj4ioZTUsZVN6OYdI3J4Z2AYft3L5Rlhzl7WvT5 YubcR1GaQv+kh6ILPB08eRfr/C6pc5IwJokswWxy8P8sauk8Bq/oNp5kl125Wky2xnlUs9BDmdn LBXzK//XyVAZfrd1kwB8q/UhXtljSD0TgrFptD1fujixkt8ZzL85OTX/eLsXWHv3HvZpWeIj8i4 AFtuPEhHvux4vnSECeNrix+KvtN43C4BeVDc4JJ4Pw53MrqmfoU4e3zFzoXWbRVWVaeq4+M X-Google-Smtp-Source: AGHT+IFDydFgEV/GNLZvcTlJ2ShF70+JdSjTRhD9Fjo1he6KAYSzA0gH3X1xLwKHfEXLdhfx9ra61A== X-Received: by 2002:a17:902:ec8f:b0:211:efa9:a4e6 with SMTP id d9443c01a7336-21a83f5d8b7mr15310275ad.23.1736302120625; Tue, 07 Jan 2025 18:08:40 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dca0282fsm316662405ad.259.2025.01.07.18.08.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 18:08:39 -0800 (PST) From: Charlie Jenkins Date: Tue, 07 Jan 2025 18:08:01 -0800 Subject: [PATCH v5 13/16] perf tools: mips: Use generic syscall scripts MIME-Version: 1.0 Message-Id: <20250107-perf_syscalltbl-v5-13-935de46d3175@rivosinc.com> References: <20250107-perf_syscalltbl-v5-0-935de46d3175@rivosinc.com> In-Reply-To: <20250107-perf_syscalltbl-v5-0-935de46d3175@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=5143; i=charlie@rivosinc.com; h=from:subject:message-id; bh=1DxWrtrDP0aS/Gfe9epTRxAlgriq5hGWv0IFvaoNd/w=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3rtPRaB/fOFNls6FczkSz3MpCSqyeyls1BXYAa77crlJ bZTVzt1lLIwiHEwyIopsvBca2BuvaNfdlS0bALMHFYmkCEMXJwCMBG1WYwMy8XtnnNkt+hdMRGS Svh87YrKTpnHVr33JzwoXXcg++d2XkaGWQqTA/YWbrivetC0JuesdYuWsxBT06cXH+uDtcIUpz9 jAQA= 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-20250107_180841_390306_F24FD3CD X-CRM114-Status: GOOD ( 16.80 ) 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 for mips. Signed-off-by: Charlie Jenkins --- tools/perf/Makefile.config | 3 +- tools/perf/Makefile.perf | 2 +- 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 --- 7 files changed, 11 insertions(+), 39 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 8b0595da9402c7d69aef1e120e815d320ecf006c..e053a2304f40f6cd06a9fd022ba863b5bf2efa5e 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -31,7 +31,7 @@ $(call detected_var,SRCARCH) ifneq ($(NO_SYSCALL_TABLE),1) NO_SYSCALL_TABLE := 1 - ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc s390 mips)) + ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc s390)) NO_SYSCALL_TABLE := 0 endif @@ -95,7 +95,6 @@ ifeq ($(ARCH),s390) endif ifeq ($(ARCH),mips) - CFLAGS += -I$(OUTPUT)arch/mips/include/generated ifndef NO_LIBUNWIND LIBUNWIND_LIBS = -lunwind -lunwind-mips endif diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 558f1425a09d536c3b85798840e173067c3da463..84d23f147365d5a57c83fe16a2faedf45f4e2f70 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 +generic_syscall_table_archs := riscv arc csky arm sh sparc xtensa x86 alpha parisc arm64 loongarch mips ifneq ($(filter $(SRCARCH), $(generic_syscall_table_archs)),) include $(srctree)/tools/perf/scripts/Makefile.syscalls endif diff --git a/tools/perf/arch/mips/entry/syscalls/Kbuild b/tools/perf/arch/mips/entry/syscalls/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..9a41e3572c3afd4f202321fd9e492714540e8fd3 --- /dev/null +++ b/tools/perf/arch/mips/entry/syscalls/Kbuild @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +syscall-y += 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 0000000000000000000000000000000000000000..9ee914bdfb05860fdd37a49f1ced03fcf2c9ed78 --- /dev/null +++ b/tools/perf/arch/mips/entry/syscalls/Makefile.syscalls @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +syscall_abis_64 += n64 + +syscalltbl = $(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 c0d93f959c4e1b8c12edcb5624bbc131231df7e3..0000000000000000000000000000000000000000 --- 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=$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[] = {' - while read nr abi sc discard; do - printf '\t[%d] = "%s",\n' $nr $sc - max_nr=$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 0000000000000000000000000000000000000000..b53e31c15805319a01719c22d489c4037378b02b --- /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 3001386e13a502be5279aa6e4742af0b96202b35..675702d686d0d1b53dd3ee2017cc9695686b9c63 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -26,10 +26,6 @@ static const char *const *syscalltbl_native = syscalltbl_powerpc_64; #include const int syscalltbl_native_max_id = SYSCALLTBL_POWERPC_32_MAX_ID; static const char *const *syscalltbl_native = syscalltbl_powerpc_32; -#elif defined(__mips__) -#include -const int syscalltbl_native_max_id = SYSCALLTBL_MIPS_N64_MAX_ID; -static const char *const *syscalltbl_native = syscalltbl_mips_n64; #elif defined(GENERIC_SYSCALL_TABLE) #include const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID;