From patchwork Tue May 30 09:51:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 100711 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2065547vqr; Tue, 30 May 2023 03:06:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7e7Mr3rXo1dXllB6pIYDR5APgUa+3yHwrdxUr1iXiafl/TpLVX0PXFXYiq068odUzaLyCA X-Received: by 2002:a17:903:48d:b0:1ac:7345:f254 with SMTP id jj13-20020a170903048d00b001ac7345f254mr1599558plb.33.1685441207991; Tue, 30 May 2023 03:06:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685441207; cv=none; d=google.com; s=arc-20160816; b=AHYEXetHetetLL5yin7vu5xJrA4dG0WuknaWUTcL3cQ4MYq5D0xAs46XHHk/s8F613 66AbLca7Cj78ILagpVyLUP59XvqJZdaV9aWYy3EMtAhAQusZMxA16N0Spps8zvyKLao3 zznBwPkQ7CsxFrgB+ozifIx0J3T7Zo1MJLk3mvRmd5l5YG7CoQhhypmer/fBaltykngd gKdWfqT32u5yn/D7H7ebk/+PAbIxw4mi2CkTJ6RUVwz0tuRuu0pZRxx7h2TFSg1+UiU4 fB5KCFt+U9z7xIFPl1q4KFQ1OvQvS51iYkc9NUq/z28T3YAfyw/p5N65ZcBmNXWemJUd jcKg== 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=7DQKb8WvHKiF+kcZ5SYeiOJwZ/Db7tb6PS0fH7EhLmQ=; b=TMxmQZzddJaxK8CLWRvcbZiJb48gwUAyjjWdSh+/K8TmxkqxKLvTqhzEa3lq9GmxMN BTbG3iPyLszm5QKg4S3ZSHzgJveEewbj65QrnXdXxOZ3B04k8NRB5NMdZAGxgVCbs5j1 63sYQv3aTtviCVYD2Yf+zjZ7s9M8ZT53kNymIEDzZLzKjeaZ8vK7XV0w7mnKGOtL5DSK gewnN7pJSLlv54a/LonAD8MfFeQjCLCKgFRnny++zxAQNUCZKX8OVcxmKTegGN5NoGg8 xCvSWoz9WcKIoY9hq8nLD+0PYmg7ozUDgq5F2Vey1OsKVFCYGteSHo8G/jHbanwOPhOd H3jw== 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 l6-20020a170902f68600b001aaec5cffb2si1067693plg.280.2023.05.30.03.06.35; Tue, 30 May 2023 03:06:47 -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 S231250AbjE3JvX (ORCPT + 99 others); Tue, 30 May 2023 05:51:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231153AbjE3JvN (ORCPT ); Tue, 30 May 2023 05:51:13 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 55D91F9; Tue, 30 May 2023 02:51:10 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8DxuPENx3VkUoQCAA--.5734S3; Tue, 30 May 2023 17:51:09 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxWdIJx3VkkmSAAA--.12317S3; Tue, 30 May 2023 17:51:07 +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 v3 1/5] perf tools: Declare syscalltbl_*[] as const for all archs Date: Tue, 30 May 2023 17:51:01 +0800 Message-Id: <1685440265-7021-2-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1685440265-7021-1-git-send-email-yangtiezhu@loongson.cn> References: <1685440265-7021-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf8BxWdIJx3VkkmSAAA--.12317S3 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvJXoWxKw4kurWxJr4UJF17Aw4fKrg_yoWxGr1Dp3 Z2kw1kJ3Z5Wr1rA34Igw4jqFyrurn7Gr12qryjkrZxArsxJ343trWUXa95tFWfX34xGrWj vrW8Xry5GF1IqF7anT9S1TB71UUUUbJqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bfAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l84 ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2kK e7AKxVWUtVW8ZwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWrXVW3AwAv7VC2z280 aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxkF7I0En4 kS14v26r1q6r43MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMxCIbckI 1I0E14v26r1q6r43MI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_Jr Wlx4CE17CEb7AF67AKxVW8ZVWrXwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26ryj 6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr 0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUv cSsGvfC2KfnxnUUI43ZEXa7IUnLID5UUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1767313199941109853?= X-GMAIL-MSGID: =?utf-8?q?1767313199941109853?= syscalltbl_*[] should never be changing, let us declare it as const. Suggested-by: Ian Rogers Signed-off-by: Tiezhu Yang --- tools/perf/arch/arm64/entry/syscalls/mksyscalltbl | 2 +- tools/perf/arch/loongarch/entry/syscalls/mksyscalltbl | 2 +- tools/perf/arch/mips/entry/syscalls/mksyscalltbl | 2 +- tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl | 2 +- tools/perf/arch/s390/entry/syscalls/mksyscalltbl | 2 +- tools/perf/arch/x86/entry/syscalls/syscalltbl.sh | 2 +- tools/perf/util/syscalltbl.c | 14 +++++++------- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl index 22cdf91..4edcdf6 100755 --- a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl +++ b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl @@ -34,7 +34,7 @@ create_table_from_c() create_table() { echo "#include \"$input\"" - echo "static const char *syscalltbl_arm64[] = {" + echo "static const char *const syscalltbl_arm64[] = {" create_table_from_c echo "};" } diff --git a/tools/perf/arch/loongarch/entry/syscalls/mksyscalltbl b/tools/perf/arch/loongarch/entry/syscalls/mksyscalltbl index c52156f..5fb83bd 100755 --- a/tools/perf/arch/loongarch/entry/syscalls/mksyscalltbl +++ b/tools/perf/arch/loongarch/entry/syscalls/mksyscalltbl @@ -50,7 +50,7 @@ create_table_from_c() create_table() { - echo "static const char *syscalltbl_loongarch[] = {" + echo "static const char *const syscalltbl_loongarch[] = {" create_table_from_c echo "};" } diff --git a/tools/perf/arch/mips/entry/syscalls/mksyscalltbl b/tools/perf/arch/mips/entry/syscalls/mksyscalltbl index fb1f494..c0d93f9 100644 --- a/tools/perf/arch/mips/entry/syscalls/mksyscalltbl +++ b/tools/perf/arch/mips/entry/syscalls/mksyscalltbl @@ -18,7 +18,7 @@ create_table() { local max_nr nr abi sc discard - echo 'static const char *syscalltbl_mips_n64[] = {' + 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 diff --git a/tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl b/tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl index 6c58060..0eb316f 100755 --- a/tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl +++ b/tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl @@ -23,7 +23,7 @@ create_table() max_nr=-1 nr=0 - echo "static const char *syscalltbl_powerpc_${wordsize}[] = {" + echo "static const char *const syscalltbl_powerpc_${wordsize}[] = {" while read nr abi sc discard; do if [ "$max_nr" -lt "$nr" ]; then printf '\t[%d] = "%s",\n' $nr $sc diff --git a/tools/perf/arch/s390/entry/syscalls/mksyscalltbl b/tools/perf/arch/s390/entry/syscalls/mksyscalltbl index 72ecbb6..52eb88a 100755 --- a/tools/perf/arch/s390/entry/syscalls/mksyscalltbl +++ b/tools/perf/arch/s390/entry/syscalls/mksyscalltbl @@ -18,7 +18,7 @@ create_table() { local max_nr nr abi sc discard - echo 'static const char *syscalltbl_s390_64[] = {' + 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 diff --git a/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh b/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh index 029a72c..fa526a9 100755 --- a/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh +++ b/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh @@ -18,7 +18,7 @@ emit() { syscall_macro "$nr" "$entry" } -echo "static const char *syscalltbl_${arch}[] = {" +echo "static const char *const syscalltbl_${arch}[] = {" sorted_table=$(mktemp /tmp/syscalltbl.XXXXXX) grep '^[0-9]' "$in" | sort -n > $sorted_table diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c index 313ecce..63be7b5 100644 --- a/tools/perf/util/syscalltbl.c +++ b/tools/perf/util/syscalltbl.c @@ -17,31 +17,31 @@ #if defined(__x86_64__) #include const int syscalltbl_native_max_id = SYSCALLTBL_x86_64_MAX_ID; -static const char **syscalltbl_native = syscalltbl_x86_64; +static const char *const *syscalltbl_native = syscalltbl_x86_64; #elif defined(__s390x__) #include const int syscalltbl_native_max_id = SYSCALLTBL_S390_64_MAX_ID; -static const char **syscalltbl_native = syscalltbl_s390_64; +static const char *const *syscalltbl_native = syscalltbl_s390_64; #elif defined(__powerpc64__) #include const int syscalltbl_native_max_id = SYSCALLTBL_POWERPC_64_MAX_ID; -static const char **syscalltbl_native = syscalltbl_powerpc_64; +static const char *const *syscalltbl_native = syscalltbl_powerpc_64; #elif defined(__powerpc__) #include const int syscalltbl_native_max_id = SYSCALLTBL_POWERPC_32_MAX_ID; -static const char **syscalltbl_native = syscalltbl_powerpc_32; +static const char *const *syscalltbl_native = syscalltbl_powerpc_32; #elif defined(__aarch64__) #include const int syscalltbl_native_max_id = SYSCALLTBL_ARM64_MAX_ID; -static const char **syscalltbl_native = syscalltbl_arm64; +static const char *const *syscalltbl_native = syscalltbl_arm64; #elif defined(__mips__) #include const int syscalltbl_native_max_id = SYSCALLTBL_MIPS_N64_MAX_ID; -static const char **syscalltbl_native = syscalltbl_mips_n64; +static const char *const *syscalltbl_native = syscalltbl_mips_n64; #elif defined(__loongarch__) #include const int syscalltbl_native_max_id = SYSCALLTBL_LOONGARCH_MAX_ID; -static const char **syscalltbl_native = syscalltbl_loongarch; +static const char *const *syscalltbl_native = syscalltbl_loongarch; #endif struct syscall { From patchwork Tue May 30 09:51:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 100714 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2067587vqr; Tue, 30 May 2023 03:10:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4cYwe2gy7j2OCD/E+NWs3xu1jmcPpPhXCfk0rsT9rqoc0JXuMrdhc1VPVoLPMgSstSf9yw X-Received: by 2002:a17:903:11c6:b0:1ae:8595:153 with SMTP id q6-20020a17090311c600b001ae85950153mr2041052plh.20.1685441434311; Tue, 30 May 2023 03:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685441434; cv=none; d=google.com; s=arc-20160816; b=QnpzXVww3ZbATLIwDw5XL1+40aR1yypa2GuvqjbaKjSLDj4W9rP4ww4Un/tSXHeHE6 oDur5msbOJFW7rch8Yfpz37pL2PsKdD0czRg6e4sszzc25bzsXdVNXwjvAbMalfkI6oA T5mXMnLJ7gLRibrVLwvmg7cd+d0ZqOP6P3xmZ+OQfZOb3EB95eUp+Qdwgd1rdjaYrC7r 3VIqNYNnDxcyyypTrJFeI8lC6+VyXoCsklt77WnseXhz/R1zxUgffY8M9PmkIs/GUPHq o8ZEFe076+lR506l2KMeCe/Ezk1zxoSzJZNGTFwRZ92MfV5EDNBcEtsSRsVET1GS8sej bBAQ== 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=cP6+63iqMrse+1VqR0Mrck5Lp21NfLweyAEBpukEV94=; b=KOTyBLv5E8IAkAZ0h0g3vbZyD43zzTJgEt0eVUCeeB2csNGWxOfTQrtS0dEyMgFCAr cgCs6gNj3/XqXADpYuUlHczeRsWChat8hbgG5JdJCQ6VGYOUPwGzoh4odRXXbbgWmtXG gIjXKXnNMR+3OKV2d9pOECxXFT+nZFgU4ZFbSz4JXqFpXXnTJ37WiARBUYnrFn7U3Ehr p8DVOptGJdljWz6rwxaqVmWVWk9SoUNAz9TCuMIif8G6MJwwJAUDmCfo/T+vebqo2UNZ aozUpVd0dVCrMiYjp4Yx9JCO/RiLuxy0guGi+w1HHIF416qCbsPYK+IALRd/zUJQdMsX fu2Q== 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 g18-20020a170902869200b001ac83d19265si9441369plo.291.2023.05.30.03.10.18; Tue, 30 May 2023 03:10:34 -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 S231239AbjE3JvT (ORCPT + 99 others); Tue, 30 May 2023 05:51:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231129AbjE3JvN (ORCPT ); Tue, 30 May 2023 05:51:13 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 27EE9F7; Tue, 30 May 2023 02:51:09 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8Axm+oNx3VkUIQCAA--.1322S3; Tue, 30 May 2023 17:51:09 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxWdIJx3VkkmSAAA--.12317S4; Tue, 30 May 2023 17:51:08 +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 v3 2/5] perf arm64: Rename create_table_from_c() to create_sc_table() Date: Tue, 30 May 2023 17:51:02 +0800 Message-Id: <1685440265-7021-3-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1685440265-7021-1-git-send-email-yangtiezhu@loongson.cn> References: <1685440265-7021-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf8BxWdIJx3VkkmSAAA--.12317S4 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvdXoWruFykWryxAr47JryrWrW8tFb_yoWDtrc_CF WSqw1Du3y5XrsFvF1fGFn8ur92kw4UXws8AwsFgr9rt34SqFWDZryFva4kuF1YyFsYgrnI qrs8Xr18AFs8ujkaLaAFLSUrUUUUob8apTn2vfkv8UJUUUU8wcxFpf9Il3svdxBIdaVrn0 xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUY X7kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3w AFIxvE14AKwVWUAVWUZwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK 6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7 xvwVC2z280aVAFwI0_Cr1j6rxdM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAaw2AF wI0_Jw0_GFyle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Wrv_ZF1lYx0Ex4A2jsIE 14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY1x0262kKe7 AKxVWUtVW8ZwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwCFI7km07C2 67AKxVWUtVW8ZwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI 8E67AF67kF1VAFwI0_GFv_WrylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW5JVW7 JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r 1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBI daVFxhVjvjDU0xZFpf9x07jP_-9UUUUU= 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?1767313437234583233?= X-GMAIL-MSGID: =?utf-8?q?1767313437234583233?= 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 4edcdf6..84976dc 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 *const syscalltbl_arm64[] = {" - create_table_from_c + create_sc_table echo "};" } From patchwork Tue May 30 09:51:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 100716 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2068593vqr; Tue, 30 May 2023 03:12:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5A1bbZyzwEQK6qzFGnysqCW1tFGDx55lThQj5RuoJ21S92qwlTSn4309Kyi4K6E2K6tao0 X-Received: by 2002:a05:6a00:181e:b0:63d:641f:5048 with SMTP id y30-20020a056a00181e00b0063d641f5048mr1988412pfa.16.1685441549172; Tue, 30 May 2023 03:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685441549; cv=none; d=google.com; s=arc-20160816; b=BRPrA1xdTtP1lWoWtVQfek8oFPS5jtXJ3bnzwGCi/RRoKYYgO/87D0OyJh7JpqOVGJ SAJCbxux+0hd4dsoOeTbWNnnmJB7Is9REgHPF49t3BbSC1pOuJ22fcP/Ev5jGwZ8UT1A Ndp6RkMsD2bTthUV+PEKmmaSK0CTiGmJrkKy9g+WgyJx8mZ+EFCLzjjg/nxxC7QZQg6n pOeAiqt/koCRF4jFyCUfQFAFJZ6VUWq/Er5T6LvBCxXxDt89ghr5yrm0LIDyb+3thu8N t6g+Hyfj2dOn1MITfXgFsCTnRx0qsBCdcPliatUM5QG3rPFO8YZeCtMbOu2nmNk6UO1N V/GQ== 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=GQSZK0dxm9oXJ8BBB+Np/iCCgnmIvGHu/PEoNCtAREU=; b=tSvT/vrHs8USnd7BMt2TJSeR19+t0NP5yYscGRVOXRnS6+HBrZObN2FQMjbZnLlb+B gMrqyY3v7oH7nONlTnuGu+KdYSKDDr661KthX9K612i+Hkt2dFCNuBaeJ+0bkHplaoaX AGLsio3IJQoch3+RD6W8Cj4xT37hVJ0pJpnfV0K94BXp02zBOWtSn6Leyfe+RWUa3zSJ erC9pWw5TA/jgKogKvVb8Ek8R6ZhJOgQlOz7UFbIZ3IGyhNmglO9fkIGLfqV/KlZ7bQW btwpjZaw9VFzJzNjWG617b9h9Jg6vd8znGu5e36pwIZ1U786DWVPhP3iiBYN8Jbsqfki 6KiQ== 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 u81-20020a627954000000b00643a730d50bsi1470764pfc.389.2023.05.30.03.12.13; Tue, 30 May 2023 03:12:29 -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 S231255AbjE3Jv0 (ORCPT + 99 others); Tue, 30 May 2023 05:51:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231177AbjE3JvO (ORCPT ); Tue, 30 May 2023 05:51:14 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D01E493; Tue, 30 May 2023 02:51:10 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8Bx7OoNx3VkX4QCAA--.1286S3; Tue, 30 May 2023 17:51:09 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxWdIJx3VkkmSAAA--.12317S5; Tue, 30 May 2023 17:51:09 +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 v3 3/5] perf arm64: Handle __NR3264_ prefixed syscall number Date: Tue, 30 May 2023 17:51:03 +0800 Message-Id: <1685440265-7021-4-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1685440265-7021-1-git-send-email-yangtiezhu@loongson.cn> References: <1685440265-7021-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf8BxWdIJx3VkkmSAAA--.12317S5 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvJXoW7trWxur1Dtw1xtw4ktF15CFg_yoW8JFW8pw s3C34UtFZ5GF10kw1xur4jqFZ5CF4kJF1UKryjyrW3Crn8J345tr1YqasYkFW7Xw1xK3y5 Zr1FqFy5XF18Xw7anT9S1TB71UUUUbJqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bSkYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l84 ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2kK e7AKxVWUtVW8ZwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWrXVW3AwAv7VC2z280 aVAFwI0_Cr0_Gr1UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY1x0262 kKe7AKxVWUtVW8ZwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwCFI7km 07C267AKxVWUtVW8ZwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r 1rMI8E67AF67kF1VAFwI0_GFv_WrylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW7 JVWDJwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMIIF0xvE42xK8VAvwI8IcIk0rV WUJVWUCwCI42IY6I8E87Iv67AKxVWxJVW8Jr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8 JrUvcSsGvfC2KfnxnUUI43ZEXa7IUnbAw7UUUUU== 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?1767313557804648453?= X-GMAIL-MSGID: =?utf-8?q?1767313557804648453?= 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 84976dc..0bcd64a 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