From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4923C433E0 for ; Tue, 5 Jan 2021 10:48:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 710382251F for ; Tue, 5 Jan 2021 10:48:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728902AbhAEKsW (ORCPT ); Tue, 5 Jan 2021 05:48:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:35218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727841AbhAEKsV (ORCPT ); Tue, 5 Jan 2021 05:48:21 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 369E8227C3 for ; Tue, 5 Jan 2021 10:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609843660; bh=/Tl83Bdn72WSQKObXAulIf4joOMIe7PotYb7NFDieOQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=DIHIj5JGFwd7TpyHNWpmbpcPAcGQD//AXfIX1nWZdjcC8Rv4w4i+Ba26kMw6/3ZFp MFbdUKYQG/CQB+Dew5PpU35WRaDQ15MDD+aubtKewLXUtvy/fD3dMWvdpMDw/0BGiA P+QZsVPftRZfp3+t2+BmddA8orD2dWSu3GEvwU3wqPDQpUqO+EPo/nEC8hRGR2cIr0 kZMdAIASf015tp/pqHVglWbvjck0kIVtHlx+phCocw6WBHfQyyQGtcZ+5jVBSpVQsD NccC/7XILy7buaSeWxrJES9cOHAOaxa6fD+v3woFDotxLMBT5/aYIUqsVdJg6rKrEm i+97cXDeL1C4g== Received: by mail-oo1-f46.google.com with SMTP id k7so6984219ooa.0 for ; Tue, 05 Jan 2021 02:47:40 -0800 (PST) X-Gm-Message-State: AOAM532jkDNEY49JUOQerl7W4pRg9rUOobONHVVQrs0Zcp6pi9foGdpk 10+dukn60wa7jqM9N3oU2f9OxJdt3//OHlgfvxg= X-Google-Smtp-Source: ABdhPJzPO8FsLl0M82OW0QW3Xa1A6aa810EtnEYGNlmTSY9rd0wo6Rg3+XjKqR4J/mgf3aO/tfpj01eoidOQKGh3s4Q= X-Received: by 2002:a4a:2cc9:: with SMTP id o192mr50837741ooo.66.1609843659138; Tue, 05 Jan 2021 02:47:39 -0800 (PST) MIME-Version: 1.0 References: <20201228024159.2BB66203B5@pchp3.se.axis.com> In-Reply-To: <20201228024159.2BB66203B5@pchp3.se.axis.com> From: Arnd Bergmann Date: Tue, 5 Jan 2021 11:47:23 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] perf arm64: Simplify mksyscalltbl To: Hans-Peter Nilsson Cc: Linux ARM , "linux-kernel@vger.kernel.org" , John Garry , Will Deacon , Mathieu Poirier , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Kim Phillips Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 28, 2020 at 3:44 AM Hans-Peter Nilsson wrote: > > This patch isn't intended to have any effect on the compiled > code. It just removes one level of indirection: calling the > *host* compiler to build and then run a program that just > printf:s the numerical entries of the syscall-table. In other > words, the generated syscalls.c changes from: > [46] = "ftruncate", > to: > [__NR3264_ftruncate] = "ftruncate", If you include the file, why not just use the macros directly, like #define __SYSCALL(nr, sym) [nr] = #sym ; static const char *syscalltbl_arm64[] = { #include }; #undef __SYSCALL The leaves an extra "sys_" in front of every name, but if you care, that could be left out afterwards. > At the time of this patch, powerpc (the origin, see comments), > and also e.g. x86 has moved on, from filtering "gcc -dM -E" > output to reading separate specific text-file, a table of > syscall numbers. IMHO should arm64 consider adopting this. Right, we had patches to convert include/uapi/asm-generic/unistd.h to the syscall.tbl format some time ago, but they were never merged as there were a few remaining bugs. I had planned to pick up that work but have not gotten around to it yet. If anyone is interested in doing this, I can dig out the last version of the patches. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64465C433DB for ; Tue, 5 Jan 2021 10:48:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C42042251F for ; Tue, 5 Jan 2021 10:48:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C42042251F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hq3j40eVXHWso+Jo3TvETy+iOgvlHgMjzClxv2Z787k=; b=qtrrv5HLJzOGiZmVAD3uFSBDT Q8UYMK8KSA3nCUbk4h/IEApnchZ+B6iFsx70qioBiCIhJKDPKW/Whss+Ahjc09qfd5JlPwBEFMHHq e5EFVg4Apzbrxy8M4TLEzdhHW+4hn4Cka6tb0kR5HRX+2Fz/rzxE64YLzMUfJeqgIUJ7Mjb6vvUtL D7RmoiUmycROCS19pUvOcsHNXyMNnEzgNKqjm5F80W39tRb5JDXa/wSS4cw7aykxXPmiwXDU6vKJj aOtoZaoL+vvbHdkLhMu9Cdco7MHQzICTswkfR/gOO99J/l5WG8mkG70hpLi0zzlgIF8KHyfSRDUIz 4BxGjPUkg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwjsN-00010R-5y; Tue, 05 Jan 2021 10:47:43 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwjsL-0000zp-24 for linux-arm-kernel@lists.infradead.org; Tue, 05 Jan 2021 10:47:41 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id DF12B22515 for ; Tue, 5 Jan 2021 10:47:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609843660; bh=/Tl83Bdn72WSQKObXAulIf4joOMIe7PotYb7NFDieOQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=DIHIj5JGFwd7TpyHNWpmbpcPAcGQD//AXfIX1nWZdjcC8Rv4w4i+Ba26kMw6/3ZFp MFbdUKYQG/CQB+Dew5PpU35WRaDQ15MDD+aubtKewLXUtvy/fD3dMWvdpMDw/0BGiA P+QZsVPftRZfp3+t2+BmddA8orD2dWSu3GEvwU3wqPDQpUqO+EPo/nEC8hRGR2cIr0 kZMdAIASf015tp/pqHVglWbvjck0kIVtHlx+phCocw6WBHfQyyQGtcZ+5jVBSpVQsD NccC/7XILy7buaSeWxrJES9cOHAOaxa6fD+v3woFDotxLMBT5/aYIUqsVdJg6rKrEm i+97cXDeL1C4g== Received: by mail-oo1-f45.google.com with SMTP id y14so6964842oom.10 for ; Tue, 05 Jan 2021 02:47:39 -0800 (PST) X-Gm-Message-State: AOAM5311dl8bO1mKkvoHMx3O36EthTpTgf7r0bIFgeL2Ct3Kjw1OwTQK AzVAr/RDgXhHTVwn+FOaDLmuARxSdL5U9gw3J18= X-Google-Smtp-Source: ABdhPJzPO8FsLl0M82OW0QW3Xa1A6aa810EtnEYGNlmTSY9rd0wo6Rg3+XjKqR4J/mgf3aO/tfpj01eoidOQKGh3s4Q= X-Received: by 2002:a4a:2cc9:: with SMTP id o192mr50837741ooo.66.1609843659138; Tue, 05 Jan 2021 02:47:39 -0800 (PST) MIME-Version: 1.0 References: <20201228024159.2BB66203B5@pchp3.se.axis.com> In-Reply-To: <20201228024159.2BB66203B5@pchp3.se.axis.com> From: Arnd Bergmann Date: Tue, 5 Jan 2021 11:47:23 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] perf arm64: Simplify mksyscalltbl To: Hans-Peter Nilsson X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210105_054741_192105_1A5F5473 X-CRM114-Status: GOOD ( 15.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Kim Phillips , Mathieu Poirier , Peter Zijlstra , Jiri Olsa , John Garry , "linux-kernel@vger.kernel.org" , Arnaldo Carvalho de Melo , Alexander Shishkin , Ingo Molnar , Leo Yan , Namhyung Kim , Will Deacon , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Dec 28, 2020 at 3:44 AM Hans-Peter Nilsson wrote: > > This patch isn't intended to have any effect on the compiled > code. It just removes one level of indirection: calling the > *host* compiler to build and then run a program that just > printf:s the numerical entries of the syscall-table. In other > words, the generated syscalls.c changes from: > [46] = "ftruncate", > to: > [__NR3264_ftruncate] = "ftruncate", If you include the file, why not just use the macros directly, like #define __SYSCALL(nr, sym) [nr] = #sym ; static const char *syscalltbl_arm64[] = { #include }; #undef __SYSCALL The leaves an extra "sys_" in front of every name, but if you care, that could be left out afterwards. > At the time of this patch, powerpc (the origin, see comments), > and also e.g. x86 has moved on, from filtering "gcc -dM -E" > output to reading separate specific text-file, a table of > syscall numbers. IMHO should arm64 consider adopting this. Right, we had patches to convert include/uapi/asm-generic/unistd.h to the syscall.tbl format some time ago, but they were never merged as there were a few remaining bugs. I had planned to pick up that work but have not gotten around to it yet. If anyone is interested in doing this, I can dig out the last version of the patches. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel