From patchwork Mon May 29 02:23:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 99948 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1241934vqr; Sun, 28 May 2023 19:41:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4GM6bwRYPYcLBlRGI30RsxqvaimlMLVJWmyBzhaN/ZUQtoXOU7Q1xyp6oITdY1X4Yj9svn X-Received: by 2002:a05:6a20:428e:b0:10b:8221:3348 with SMTP id o14-20020a056a20428e00b0010b82213348mr7791983pzj.50.1685328098756; Sun, 28 May 2023 19:41:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685328098; cv=none; d=google.com; s=arc-20160816; b=GhR2urOC/S0tQuBSlBdFRrXYaSMJNjGeSvmhZuO8KSR5tePakTbPe6/jEPOS9aTnit Z6LAadOcs63MVhOj0L+qUXnLTuNHsYojvKaGIeJcZihPc2T0+mb/7D93CEnNpHQ96TAc HiOW1kHfAkH4yIBWHtCdZnRcThDB7kg8uDGwlhVTKx2uKShhpgNdENJgq8rMU7B2+4yO LkIyO3r064aEIXyit8cI3WWLlqIZ3AFuRUSUI98cu4qULv39vOZxQ7vdlfXOwYrhC5ZN zp8u0DCd03+i2VTaS6LpP768mfHOastQVwafAU7VQeec9JplUmZfnyMdgJrSuEFtoliZ gt3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=Pvwol2EoqavQ8Z0Unq65Wc2oIkc7E9XUrglfwqiJFT8=; b=zuGdT7NTISfZt2u6WNiRIg+dS7A361JwtwZ5nTuseSRmtwbusApfhEyG62pLOe+1Pw shGOMx2VBtku5MxTRZZtX3yl2KJFObj4uiNuoTGSYfN4VyDC2gYMDBDSaBjv64n/wzkA oEnscsQBHdJnGf/bE3SAclKqbyudnngk8ypRQop4zN0T4BiL6Em3aeKBP4gt4nNiwlHJ /xcKfd50e0wVk3rUDen7lK0c1zhRK1biikZv1NRw5qUff87e7Way10QnACI/jcbWKjQ5 Q6SMD6csMNUhDSjq0FLQZloRjM/1Opt/Nw9PZbgFxyqRionRC0MsbE6IQdpSO86GdXSZ wwGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h28-20020aa79f5c000000b0064cecf7b981si8930891pfr.311.2023.05.28.19.41.27; Sun, 28 May 2023 19:41:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230328AbjE2CXh (ORCPT + 99 others); Sun, 28 May 2023 22:23:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230330AbjE2CXb (ORCPT ); Sun, 28 May 2023 22:23:31 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 46284AD; Sun, 28 May 2023 19:23:29 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8AxBvGWDHRkRxkCAA--.5009S3; Mon, 29 May 2023 10:23:18 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxRrWSDHRkNzh+AA--.9081S3; Mon, 29 May 2023 10:23:17 +0800 (CST) From: Tiezhu Yang To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter Cc: Hans-Peter Nilsson , Alexander Kapshuk , Leo Yan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, loongson-kernel@lists.loongnix.cn Subject: [PATCH v2 1/3] perf arm64: Rename create_table_from_c() to create_sc_table() Date: Mon, 29 May 2023 10:23:12 +0800 Message-Id: <1685326994-11987-2-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1685326994-11987-1-git-send-email-yangtiezhu@loongson.cn> References: <1685326994-11987-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf8BxRrWSDHRkNzh+AA--.9081S3 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvdXoWruFykWryxAr47JryrWrW8tFb_yoWDuFg_CF WSgw1Du3y5Xr42vF1fGFn8ur92kw4UJ398JwsrWr9rt34SqFWDZryFva4kuF1YyFsYgrnI qrsxWr18AFs8ujkaLaAFLSUrUUUUob8apTn2vfkv8UJUUUU8wcxFpf9Il3svdxBIdaVrn0 xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUY C7kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3w AFIxvE14AKwVWUXVWUAwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK 6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7 xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJwAa w2AFwI0_Jw0_GFyle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44 I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jw0_WrylYx0Ex4A2 jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY1x0262 kKe7AKxVWUtVW8ZwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwCFI7km 07C267AKxVWUtVW8ZwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r 1rMI8E67AF67kF1VAFwI0_GFv_WrylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW5 JVW7JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r 1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1U YxBIdaVFxhVjvjDU0xZFpf9x07jTq2NUUUUU= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767194596440147594?= X-GMAIL-MSGID: =?utf-8?q?1767194596440147594?= After commit 9854e7ad35fe ("perf arm64: Simplify mksyscalltbl"), it has been removed the temporary C program and used shell to generate syscall table, so let us rename create_table_from_c() to create_sc_table() to avoid confusion. Suggested-by: Leo Yan Signed-off-by: Tiezhu Yang --- tools/perf/arch/arm64/entry/syscalls/mksyscalltbl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl index 22cdf91..e530587 100755 --- a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl +++ b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl @@ -19,7 +19,7 @@ if ! test -r $input; then exit 1 fi -create_table_from_c() +create_sc_table() { local sc nr last_sc @@ -35,7 +35,7 @@ create_table() { echo "#include \"$input\"" echo "static const char *syscalltbl_arm64[] = {" - create_table_from_c + create_sc_table echo "};" } From patchwork Mon May 29 02:23:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 99946 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1239492vqr; Sun, 28 May 2023 19:32:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4d/5OMTcta76HJOHFDqtTquMzb8hRRmVivB8tb4N6eIDBPGGDN/1JJ7Ka2MKh4nIwC7Yps X-Received: by 2002:a05:6a00:1991:b0:645:1081:98ec with SMTP id d17-20020a056a00199100b00645108198ecmr13151602pfl.13.1685327538728; Sun, 28 May 2023 19:32:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685327538; cv=none; d=google.com; s=arc-20160816; b=H405wS41dG23bXoAaQ68BJSEZAhkJvjBZ+T555uRL7xyHFIR0GotoMTWwb0BtsQNjJ H2zR67jOnirL3jKeD4EZM4Rikz66PGC5BxpIQGzTGsd/zW30pp0nU4oK3AMDv+FIVHh6 frayPLd3dNLiZsv2+KhitMDrIcTIRTme6Xyzrx1pWdHFJw1im2Qnaqd/sQmqVCu8FsnR t71Hj8fs4ulS11LHX+JhB/0q7KICdc+DkGLgeS4+tex6EC9Dnd6HcdUBqbVfpd8pU/XS 6XvynPW6zIkVzGmfcyOqoDxpDPjS+BPGJ7fPPF3m/0LyEIv3SH6Mby64C8FEay6/lTLx r/Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=244/ZlYCiJhxgU7zyXXll0sTp+yruwt8e6f4yDAMMjI=; b=jIjAjIbcn+GCpR4q4K4uxX+uTACIMYBtCshfk520KiFPpRsl8rQg2PX6HNkkVPKSYl S7F7bjTxdPQwLIm5HNHclwrKZ4mkizL3ZnqRlyvMYFQalfvqHSqPDw7AdVwImqmlySK4 +zheAJ3jKyibDxU8GA9IbiNLBSb/h1IrMFP/kwP8T0X03O5STd37YPfzkP44auemMvev W52uLGkrrgO8g6CfAy5mYiAqtVhtbvcsYELt6JZ+t23XWT1hJZsWmFCoGaGlgPZ0UzUv kcMc1rrWDuPVhGPOa37q9ZXz+3cY6Qxz6lsxeQYGd0qXxe6KA9nZwUlstgBSAblf//h0 BEWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y64-20020a638a43000000b005348a306abcsi8875633pgd.755.2023.05.28.19.32.06; Sun, 28 May 2023 19:32:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230520AbjE2CXf (ORCPT + 99 others); Sun, 28 May 2023 22:23:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230210AbjE2CXb (ORCPT ); Sun, 28 May 2023 22:23:31 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A6EFCA9; Sun, 28 May 2023 19:23:28 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8AxiPGXDHRkVRkCAA--.5076S3; Mon, 29 May 2023 10:23:19 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxRrWSDHRkNzh+AA--.9081S4; Mon, 29 May 2023 10:23:18 +0800 (CST) From: Tiezhu Yang To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter Cc: Hans-Peter Nilsson , Alexander Kapshuk , Leo Yan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, loongson-kernel@lists.loongnix.cn Subject: [PATCH v2 2/3] perf arm64: Handle __NR3264_ prefixed syscall number Date: Mon, 29 May 2023 10:23:13 +0800 Message-Id: <1685326994-11987-3-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1685326994-11987-1-git-send-email-yangtiezhu@loongson.cn> References: <1685326994-11987-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf8BxRrWSDHRkNzh+AA--.9081S4 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvJXoW7trWxur1Dtw1xtw4ktF15CFg_yoW8JFW8pw s3C34UtayrGFy0kw1xur4jqFWrCF4kJ3W5KryjyrW3Crn8Jw15tr1YqasYkFW7Xw1xK3y5 Zr10qFy5XF18Xw7anT9S1TB71UUUUbJqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bSkYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l84 ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_Cr1U M2kKe7AKxVWUtVW8ZwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zV CFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWrXVW3AwAv7VC2 z280aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxkF7I 0En4kS14v26r1q6r43MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMxCI bckI1I0E14v26r1q6r43MI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_Jr I_JrWlx4CE17CEb7AF67AKxVW8ZVWrXwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v2 6ryj6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj4 0_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8 JrUvcSsGvfC2KfnxnUUI43ZEXa7IUnLID5UUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767194009447544813?= X-GMAIL-MSGID: =?utf-8?q?1767194009447544813?= After commit 9854e7ad35fe ("perf arm64: Simplify mksyscalltbl"), in the generated syscall table file syscalls.c, there exist some __NR3264_ prefixed syscall numbers such as [__NR3264_ftruncate], it looks like not so good, just do some small filter operations to handle __NR3264_ prefixed syscall number as a digital number. Without this patch: [__NR3264_ftruncate] = "ftruncate", With this patch: [46] = "ftruncate", Suggested-by: Alexander Kapshuk Signed-off-by: Tiezhu Yang Reviewed-by: Leo Yan --- tools/perf/arch/arm64/entry/syscalls/mksyscalltbl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl index e530587..1628731 100755 --- a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl +++ b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl @@ -40,6 +40,7 @@ create_table() } $gcc -E -dM -x c -I $incpath/include/uapi $input \ - |sed -ne 's/^#define __NR_//p' \ - |sort -t' ' -k2 -n \ + |awk '$2 ~ "__NR" && $3 !~ "__NR3264_" { + sub("^#define __NR(3264)?_", ""); + print | "sort -k2 -n"}' \ |create_table From patchwork Mon May 29 02:23:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 99949 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1242128vqr; Sun, 28 May 2023 19:42:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4TkSC7SvE97wjOqGlTCiL4MD5+P3x7yQy1jfgM5kKm+hthlRcc5uLFexU0fkoB/JWGDwqG X-Received: by 2002:a17:90a:c6:b0:253:5c1b:104d with SMTP id v6-20020a17090a00c600b002535c1b104dmr10119678pjd.33.1685328141081; Sun, 28 May 2023 19:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685328141; cv=none; d=google.com; s=arc-20160816; b=eOGq5KJCh9hZh8atDrAyeVJVo1ARBBTtSpchCC18VKFF8J1mX4sNrBH78kWL5BYDc3 s8n5F6y6I3Zav1QPrqwIhULLWZWrBGbwBMoGujQziv2B04nD8yk8IQYcJaW7QG0SCG6i 64hkDkAmQOksTBHNkLJPaqDeIsE2qZrf4ao/F7MDu56aIyoXgQCyepx2bKVFdiXvNtYf g3X4DKFkdPpBq6KO7ClK4FvWuSY8Cqer44bWFFDW5NgyV/YeY0spzU7iMndlFsDr5vMx mNxwfjgEQUI+1ntz6OqH1AyPZCjiJQnCvDlOrBAUXSdqqYqn9nMF+cPtxFoiTlBIsjyl mqTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=EBKWfxk/FrVawUtA3RN9k2Cu51kLRN/mhZsweJFLeTs=; b=LswzcBZDeoKbZcnGa+8p4SJXghaqt0W3OAsKLqyewM4G0Cheg+iShvuygiog4jMU5I GSJbNoRhXdt9SB9pIyBUfM7u8/4oaWq9Jbla9VY9q8WLEaoN8o7IO4sTrPUqm0jzwqdX XU8faUG/YSk+hDC09Tk3PLDgor6WKzXmykCqHPo6lZ8IFLxy5inpc5/dk1OLw4EcHEpn QmcEgQI4kP1vkSvYH4vPlGLoBBb/1R417KA74TI1Ee+893NosPNdNodfPtg8MwRX2b9s Ddw4MsFQSgRWM8nPXRnkDiCo5w/DN4Ml5ndqQo/YjkcwcpESnhVCHsplqWrt2Q6cabZa B9Qg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b1-20020a17090a800100b0025357108059si2084114pjn.44.2023.05.28.19.42.09; Sun, 28 May 2023 19:42:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230342AbjE2CXb (ORCPT + 99 others); Sun, 28 May 2023 22:23:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjE2CXa (ORCPT ); Sun, 28 May 2023 22:23:30 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A4E96A0; Sun, 28 May 2023 19:23:28 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8AxBvGYDHRkYhkCAA--.5012S3; Mon, 29 May 2023 10:23:20 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxRrWSDHRkNzh+AA--.9081S5; Mon, 29 May 2023 10:23:19 +0800 (CST) From: Tiezhu Yang To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter Cc: Hans-Peter Nilsson , Alexander Kapshuk , Leo Yan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, loongson-kernel@lists.loongnix.cn Subject: [PATCH v2 3/3] perf LoongArch: Simplify mksyscalltbl Date: Mon, 29 May 2023 10:23:14 +0800 Message-Id: <1685326994-11987-4-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1685326994-11987-1-git-send-email-yangtiezhu@loongson.cn> References: <1685326994-11987-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf8BxRrWSDHRkNzh+AA--.9081S5 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvJXoW7Zry5GF45JrWUKry5XFyUAwb_yoW8uF1fpF sak3srta1rZr1xCwnF9r42qF1rCws7Jr1YqFyvkrWSvw43C34Fyr10qas3JFy7G3yxtrWF vryIqryUKF48XaDanT9S1TB71UUUUbJqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bhxYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l84 ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_Cr1U M2kKe7AKxVWUtVW8ZwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zV CFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWrXVW3AwAv7VC2 z280aVAFwI0_Cr0_Gr1UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY1x 0262kKe7AKxVWUtVW8ZwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwCF I7km07C267AKxVWUtVW8ZwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r 106r1rMI8E67AF67kF1VAFwI0_GFv_WrylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AK xVW7JVWDJwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMIIF0xvE42xK8VAvwI8IcI k0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWxJVW8Jr1lIxAIcVC2z280aVCY1x0267AKxVW8 JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IUnbAw7UUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767194640777177685?= X-GMAIL-MSGID: =?utf-8?q?1767194640777177685?= In order to print the numerical entries of the syscall table, there is no need to call the host compiler to build and then run a program, this can be done directly by the shell script. This is similar with commit 9854e7ad35fe ("perf arm64: Simplify mksyscalltbl"). For now, the mksyscalltbl file of LoongArch is almost same with arm64. Signed-off-by: Tiezhu Yang Reviewed-by: Leo Yan --- .../arch/loongarch/entry/syscalls/mksyscalltbl | 36 ++++++---------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/tools/perf/arch/loongarch/entry/syscalls/mksyscalltbl b/tools/perf/arch/loongarch/entry/syscalls/mksyscalltbl index c52156f..8df7b0b 100755 --- a/tools/perf/arch/loongarch/entry/syscalls/mksyscalltbl +++ b/tools/perf/arch/loongarch/entry/syscalls/mksyscalltbl @@ -18,44 +18,28 @@ if ! test -r $input; then exit 1 fi -create_table_from_c() +create_sc_table() { local sc nr last_sc - create_table_exe=`mktemp ${TMPDIR:-/tmp}/create-table-XXXXXX` - - { - - cat <<-_EoHEADER - #include - #include "$input" - int main(int argc, char *argv[]) - { - _EoHEADER - while read sc nr; do - printf "%s\n" " printf(\"\\t[%d] = \\\"$sc\\\",\\n\", $nr);" - last_sc=$nr + printf "%s\n" " [$nr] = \"$sc\"," + last_sc=$sc done - printf "%s\n" " printf(\"#define SYSCALLTBL_LOONGARCH_MAX_ID %d\\n\", $last_sc);" - printf "}\n" - - } | $hostcc -I $incpath/include/uapi -o $create_table_exe -x c - - - $create_table_exe - - rm -f $create_table_exe + printf "%s\n" "#define SYSCALLTBL_LOONGARCH_MAX_ID __NR_$last_sc" } create_table() { + echo "#include \"$input\"" echo "static const char *syscalltbl_loongarch[] = {" - create_table_from_c + create_sc_table echo "};" } -$gcc -E -dM -x c -I $incpath/include/uapi $input \ - |sed -ne 's/^#define __NR_//p' \ - |sort -t' ' -k2 -n \ +$gcc -E -dM -x c -I $incpath/include/uapi $input \ + |awk '$2 ~ "__NR" && $3 !~ "__NR3264_" { + sub("^#define __NR(3264)?_", ""); + print | "sort -k2 -n"}' \ |create_table