From patchwork Sat Feb 1 07:14:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13956102 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 0E708C0218A for ; Sat, 1 Feb 2025 07:16:41 +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:To:From:Subject:References:Mime-Version :Message-Id:In-Reply-To:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=p3x3htkdE8SAc7zi8U7PFuzB5P84n14zGgtcKwSGOoA=; b=jEI5rjmnM0ZHkg 7EemAWxrxCROPp6aPlDGcWs96zn5WMJvw4QBl5VVyRaSPVwNi/Gr2iUnJuq0shKUyjlOHafGX3doN MK6bqFMKWM0YsWfWzxyZeJKeX3x9AkflrrdS4/xctG7YOc4tDfMM3ILVLEL1LVA66srJFEWA5tvtV 98hPBU2GquHmoZzuNXkaP4d2jw5tgXtb5e8RIvTIRNzmYNsEBrZIgjONHCAAGcn+dpuVqJGP3IGXi fnDUyvgpd+SLAcrp+HagS+TDlIlNzCdi6m7r3bXznmS4BdjRVmWfSz0k6+Tct7DoUUyQdEMt6IUXI Ukqu/arafChDoNK9m/tw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1te7k2-0000000ByF6-3uda; Sat, 01 Feb 2025 07:16:34 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1te7ii-0000000Bxq9-1gGI for linux-riscv@lists.infradead.org; Sat, 01 Feb 2025 07:15:13 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-6f46fb73061so17511677b3.1 for ; Fri, 31 Jan 2025 23:15:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1738394111; x=1738998911; darn=lists.infradead.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=LGBkL6/m1fMDNttX5VnFRmHBz53xz5ZxOlN/bCE/zys=; b=vGC7hrkASxFiXIZi1gAC23JAYnyrurciID+pmPaTu0Q4eIaGaMcvj+0sW2TiFsv2Mc SG+PA6GPjP+fMymlnu88OB8rQgrDDdwTMs/32qCSOn4tZLKrT5IhoKCx0MR/R+b/0Qch aBNxh+WNl7/o/z2ePETdXDT6MmPtJt3JcsAx9+4kMDkFBb5dtBj9N/UK4ZAk4M14QvS4 2/hMlKq6dK5DhMWu4HX96zV2+1JYQAG/w5irV79lw61zZjbMuLehveH06tNfrBabu4Hv H/TEnsj5TSlScNArqiBTj1naPKK7wj69IH2nGqVuCUuZ9kMyXIWGgBs1C+mjmuGxrLR5 bZSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738394111; x=1738998911; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LGBkL6/m1fMDNttX5VnFRmHBz53xz5ZxOlN/bCE/zys=; b=lSZT3Yt8KhGhyGZJI4WQJyJi9lEG9dotD8McwigGrSsYgzmvZTpDrcXodCkJb8XI89 edPj0C63N0chKAOP2mjF4bMHCT2pt/ZTicJvIa7fhkavO7GQ4J/RG9mzGhtch/mMqJqD gAiMLfqKosNzQV8k26lI1LiljGh4LKuCHdmNzsYcVQRDubeQx6nBCjaZbe1I5yzb4tWM eearEPfqkc6AB0hiH/CbUY4zLdK+AnU1HLz4Huk6pEY/ENUj9biMth+c02Hzbt53HOBX LsCisohnopvK+tORFzz3BaYTTGjR8ZJeHKWHxG+iThXcTPmzgfPypGxJdN0vHiBPe/cV 2gxA== X-Forwarded-Encrypted: i=1; AJvYcCWPEInzQGzew/qrYsfuh4olBAGm2ieBB7n3OKguPKaRvKL/yaxF2PwVDS3o0TgY1ZI9N1HL6by8RnVVlQ==@lists.infradead.org X-Gm-Message-State: AOJu0YzxdlJRtOxITvNPlxBfpQjWphdUzhSkZdkLQah2VI3gAechWjlx U2+1on78sluB886QtWMcgIW1OXoq+UHKpxEQ+Gv3xGDHbDc3su08/3VpL/HJVooxzG7TzWL7he9 QXi6VMw== X-Google-Smtp-Source: AGHT+IHULmAB9lh1r1OVXMJiQiYvfj2+yZMx4fUpyTZyNlm2CfOV8YC4/iQGmwu2MW+sifATxPEk2wvsTvhV X-Received: from irogers.svl.corp.google.com ([2620:15c:2c5:11:de26:87db:e4d0:62b6]) (user=irogers job=sendgmr) by 2002:a0d:e701:0:b0:6dd:bb6e:ec89 with SMTP id 00721157ae682-6f8c199baf7mr396817b3.2.1738394111133; Fri, 31 Jan 2025 23:15:11 -0800 (PST) Date: Fri, 31 Jan 2025 23:14:49 -0800 In-Reply-To: <20250201071455.718247-1-irogers@google.com> Message-Id: <20250201071455.718247-2-irogers@google.com> Mime-Version: 1.0 References: <20250201071455.718247-1-irogers@google.com> X-Mailer: git-send-email 2.48.1.362.g079036d154-goog Subject: [PATCH v1 1/7] perf syscalltble: Remove syscall_table.h From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Guo Ren , Paul Walmsley , Palmer Dabbelt , Albert Ou , Charlie Jenkins , Bibo Mao , Arnd Bergmann , Huacai Chen , Catalin Marinas , Jiri Slaby , " =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= " , Howard Chu , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-riscv@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250131_231512_443642_B16A6084 X-CRM114-Status: GOOD ( 14.98 ) 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 The definition of "static const char *const syscalltbl[] = {" is done in a generated syscalls_32.h or syscalls_64.h that is architecture dependent. In order to include the appropriate file a syscall_table.h is found via the perf include path and it includes the syscalls_32.h or syscalls_64.h as appropriate. To support having multiple syscall tables, one for 32-bit and one for 64-bit, or for different architectures, an include path cannot be used. Remove syscall_table.h because of this and inline what it does into syscalltbl.c. For architectures without a syscall_table.h this will cause a failure to include either syscalls_32.h or syscalls_64.h rather than a failure to include syscall_table.h. For architectures that only included one or other, the behavior matches BITS_PER_LONG as previously done on architectures supporting both syscalls_32.h and syscalls_64.h. Signed-off-by: Ian Rogers --- tools/perf/arch/alpha/include/syscall_table.h | 2 -- tools/perf/arch/arc/include/syscall_table.h | 2 -- tools/perf/arch/arm/include/syscall_table.h | 2 -- tools/perf/arch/arm64/include/syscall_table.h | 8 -------- tools/perf/arch/csky/include/syscall_table.h | 2 -- tools/perf/arch/loongarch/include/syscall_table.h | 2 -- tools/perf/arch/mips/include/syscall_table.h | 2 -- tools/perf/arch/parisc/include/syscall_table.h | 8 -------- tools/perf/arch/powerpc/include/syscall_table.h | 8 -------- tools/perf/arch/riscv/include/syscall_table.h | 8 -------- tools/perf/arch/s390/include/syscall_table.h | 2 -- tools/perf/arch/sh/include/syscall_table.h | 2 -- tools/perf/arch/sparc/include/syscall_table.h | 8 -------- tools/perf/arch/x86/include/syscall_table.h | 8 -------- tools/perf/arch/xtensa/include/syscall_table.h | 2 -- tools/perf/util/syscalltbl.c | 8 +++++++- 16 files changed, 7 insertions(+), 67 deletions(-) delete mode 100644 tools/perf/arch/alpha/include/syscall_table.h delete mode 100644 tools/perf/arch/arc/include/syscall_table.h delete mode 100644 tools/perf/arch/arm/include/syscall_table.h delete mode 100644 tools/perf/arch/arm64/include/syscall_table.h delete mode 100644 tools/perf/arch/csky/include/syscall_table.h delete mode 100644 tools/perf/arch/loongarch/include/syscall_table.h delete mode 100644 tools/perf/arch/mips/include/syscall_table.h delete mode 100644 tools/perf/arch/parisc/include/syscall_table.h delete mode 100644 tools/perf/arch/powerpc/include/syscall_table.h delete mode 100644 tools/perf/arch/riscv/include/syscall_table.h delete mode 100644 tools/perf/arch/s390/include/syscall_table.h delete mode 100644 tools/perf/arch/sh/include/syscall_table.h delete mode 100644 tools/perf/arch/sparc/include/syscall_table.h delete mode 100644 tools/perf/arch/x86/include/syscall_table.h delete mode 100644 tools/perf/arch/xtensa/include/syscall_table.h diff --git a/tools/perf/arch/alpha/include/syscall_table.h b/tools/perf/arch/alpha/include/syscall_table.h deleted file mode 100644 index b53e31c15805..000000000000 --- a/tools/perf/arch/alpha/include/syscall_table.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include diff --git a/tools/perf/arch/arc/include/syscall_table.h b/tools/perf/arch/arc/include/syscall_table.h deleted file mode 100644 index 4c942821662d..000000000000 --- a/tools/perf/arch/arc/include/syscall_table.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include diff --git a/tools/perf/arch/arm/include/syscall_table.h b/tools/perf/arch/arm/include/syscall_table.h deleted file mode 100644 index 4c942821662d..000000000000 --- a/tools/perf/arch/arm/include/syscall_table.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include diff --git a/tools/perf/arch/arm64/include/syscall_table.h b/tools/perf/arch/arm64/include/syscall_table.h deleted file mode 100644 index 7ff51b783000..000000000000 --- a/tools/perf/arch/arm64/include/syscall_table.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include - -#if __BITS_PER_LONG == 64 -#include -#else -#include -#endif diff --git a/tools/perf/arch/csky/include/syscall_table.h b/tools/perf/arch/csky/include/syscall_table.h deleted file mode 100644 index 4c942821662d..000000000000 --- a/tools/perf/arch/csky/include/syscall_table.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include diff --git a/tools/perf/arch/loongarch/include/syscall_table.h b/tools/perf/arch/loongarch/include/syscall_table.h deleted file mode 100644 index 9d0646d3455c..000000000000 --- a/tools/perf/arch/loongarch/include/syscall_table.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include diff --git a/tools/perf/arch/mips/include/syscall_table.h b/tools/perf/arch/mips/include/syscall_table.h deleted file mode 100644 index b53e31c15805..000000000000 --- a/tools/perf/arch/mips/include/syscall_table.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include diff --git a/tools/perf/arch/parisc/include/syscall_table.h b/tools/perf/arch/parisc/include/syscall_table.h deleted file mode 100644 index 7ff51b783000..000000000000 --- a/tools/perf/arch/parisc/include/syscall_table.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include - -#if __BITS_PER_LONG == 64 -#include -#else -#include -#endif diff --git a/tools/perf/arch/powerpc/include/syscall_table.h b/tools/perf/arch/powerpc/include/syscall_table.h deleted file mode 100644 index 7ff51b783000..000000000000 --- a/tools/perf/arch/powerpc/include/syscall_table.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include - -#if __BITS_PER_LONG == 64 -#include -#else -#include -#endif diff --git a/tools/perf/arch/riscv/include/syscall_table.h b/tools/perf/arch/riscv/include/syscall_table.h deleted file mode 100644 index 7ff51b783000..000000000000 --- a/tools/perf/arch/riscv/include/syscall_table.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include - -#if __BITS_PER_LONG == 64 -#include -#else -#include -#endif diff --git a/tools/perf/arch/s390/include/syscall_table.h b/tools/perf/arch/s390/include/syscall_table.h deleted file mode 100644 index b53e31c15805..000000000000 --- a/tools/perf/arch/s390/include/syscall_table.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include diff --git a/tools/perf/arch/sh/include/syscall_table.h b/tools/perf/arch/sh/include/syscall_table.h deleted file mode 100644 index 4c942821662d..000000000000 --- a/tools/perf/arch/sh/include/syscall_table.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include diff --git a/tools/perf/arch/sparc/include/syscall_table.h b/tools/perf/arch/sparc/include/syscall_table.h deleted file mode 100644 index 7ff51b783000..000000000000 --- a/tools/perf/arch/sparc/include/syscall_table.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include - -#if __BITS_PER_LONG == 64 -#include -#else -#include -#endif diff --git a/tools/perf/arch/x86/include/syscall_table.h b/tools/perf/arch/x86/include/syscall_table.h deleted file mode 100644 index 7ff51b783000..000000000000 --- a/tools/perf/arch/x86/include/syscall_table.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include - -#if __BITS_PER_LONG == 64 -#include -#else -#include -#endif diff --git a/tools/perf/arch/xtensa/include/syscall_table.h b/tools/perf/arch/xtensa/include/syscall_table.h deleted file mode 100644 index 4c942821662d..000000000000 --- a/tools/perf/arch/xtensa/include/syscall_table.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c index 928aca4cd6e9..2f76241494c8 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -7,13 +7,19 @@ #include "syscalltbl.h" #include +#include #include #include #include #include "string2.h" -#include +#if __BITS_PER_LONG == 64 + #include +#else + #include +#endif + const int syscalltbl_native_max_id = SYSCALLTBL_MAX_ID; static const char *const *syscalltbl_native = syscalltbl;