From patchwork Tue Aug 27 16:51:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13779822 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 89405C54731 for ; Tue, 27 Aug 2024 16:54:33 +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:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=souC2zS5QUi/C137l4YgCB/OnXpvzxdFFl61J8yOmoM=; b=LQlHpJOKQIivfP9RNtDNovf4DN alEh1wnITDHgZa02QQLQUF5pUvROOOMXZd2jO9/+bDH8y82cr5EjZj1zTNMaUK90/AfUf9k2aZxPA xLyC81L7mwIiy+Q2zoc9CslIJZpkzWnBsvEtsxDQ89S4xWeRQ4UwRpTrzyhA2cQ1KqlTfUc9cmTRf WLa7JVPCEwLy/7cxLOmbZUPDQnOHoXkDhAHWRBzNfbuLg4sgGiCBOXrxB414WxyB43OAw47gepd+4 Xda9HjnuPrWx+au14iiuMFxiC4hnhC08sx+gcjkGzQthQ9ExEz6Z23ddYSOw1fVxZ+43Fsu7q/hWQ Z0VqMYwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sizSb-0000000C9uj-0yEm; Tue, 27 Aug 2024 16:54:25 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sizQ1-0000000C95a-2AB3 for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 16:51:46 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F237711FB; Tue, 27 Aug 2024 09:52:10 -0700 (PDT) Received: from e132581.cambridge.arm.com (e132581.arm.com [10.2.76.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BF7923F66E; Tue, 27 Aug 2024 09:51:42 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , James Clark , Namhyung Kim , Ian Rogers , Jiri Olsa , Adrian Hunter , John Garry , Will Deacon , Mark Rutland , Mike Leach , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v1 1/7] perf arm-spe: Rename arm_spe__synth_data_source_generic() Date: Tue, 27 Aug 2024 17:51:19 +0100 Message-Id: <20240827165125.3311306-2-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240827165125.3311306-1-leo.yan@arm.com> References: <20240827165125.3311306-1-leo.yan@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240827_095145_626649_BB1BB311 X-CRM114-Status: GOOD ( 10.73 ) 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 The arm_spe__synth_data_source_generic() function is invoked when the tool detects that CPUs do not support data source packets and falls back to synthesizing only the memory level. Rename it to arm_spe__synth_memory_level() for better reflecting its purpose. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index be34d4c4306a..97f3c190817b 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -496,8 +496,8 @@ static void arm_spe__synth_data_source_neoverse(const struct arm_spe_record *rec } } -static void arm_spe__synth_data_source_generic(const struct arm_spe_record *record, - union perf_mem_data_src *data_src) +static void arm_spe__synth_memory_level(const struct arm_spe_record *record, + union perf_mem_data_src *data_src) { if (record->type & (ARM_SPE_LLC_ACCESS | ARM_SPE_LLC_MISS)) { data_src->mem_lvl = PERF_MEM_LVL_L3; @@ -534,7 +534,7 @@ static u64 arm_spe__synth_data_source(const struct arm_spe_record *record, u64 m if (is_neoverse) arm_spe__synth_data_source_neoverse(record, &data_src); else - arm_spe__synth_data_source_generic(record, &data_src); + arm_spe__synth_memory_level(record, &data_src); if (record->type & (ARM_SPE_TLB_ACCESS | ARM_SPE_TLB_MISS)) { data_src.mem_dtlb = PERF_MEM_TLB_WK; From patchwork Tue Aug 27 16:51:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13779823 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 3ABCFC5472F for ; Tue, 27 Aug 2024 16:56:18 +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:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6gGXinK/TL7VcnR9Z2D3lqw8ia/bec+alDkyjkCWO+A=; b=XRaCud1KKWzmKJC5FYJwVJIZ70 b30BwkVHkT9jZWXNxCJ1DSUovsuiI2VM5QYRT8aUBdfW/pUh0rkvjNnKSQiw2N1m5xAdEozgFeXyB jZkWqeGTp/wn57Td6U1/uOS4fkYoHgv34X58Xg5/KNlR1V8nis4Dl7gPiER61P6L2WkN/0Uu6IuSk 5S/gvP06lZmjGnx4AlnmbCRSOfSbc1zFcsiL/Uy1fmrorHhneHirq0gbr6D5svDGjoFKWYxUWByol iT6XRYK6QNivEIkgpq+zE+NUzJt1LkJnfjPaWVlh9l1FdttdRDUQWLpgUd7yrNHbvL3Vt56UKIUwT rcKe3txQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sizUC-0000000CAWJ-43GI; Tue, 27 Aug 2024 16:56:04 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sizQ3-0000000C96B-1WV9 for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 16:51:48 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 41A3D13D5; Tue, 27 Aug 2024 09:52:13 -0700 (PDT) Received: from e132581.cambridge.arm.com (e132581.arm.com [10.2.76.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0F11D3F66E; Tue, 27 Aug 2024 09:51:44 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , James Clark , Namhyung Kim , Ian Rogers , Jiri Olsa , Adrian Hunter , John Garry , Will Deacon , Mark Rutland , Mike Leach , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v1 2/7] perf arm-spe: Rename the common data source encoding Date: Tue, 27 Aug 2024 17:51:20 +0100 Message-Id: <20240827165125.3311306-3-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240827165125.3311306-1-leo.yan@arm.com> References: <20240827165125.3311306-1-leo.yan@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240827_095147_510962_C7F2A179 X-CRM114-Status: GOOD ( 14.78 ) 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 The Neoverse CPUs follow the common data source encoding, and other CPU variants can share the same format. Rename the CPU list and data source definitions as common data source names. This change prepares for appending more CPU variants. Signed-off-by: Leo Yan --- .../util/arm-spe-decoder/arm-spe-decoder.h | 18 ++++++------ tools/perf/util/arm-spe.c | 28 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h index 1443c28545a9..358c611eeddb 100644 --- a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h +++ b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h @@ -56,15 +56,15 @@ enum arm_spe_op_type { ARM_SPE_OP_BR_INDIRECT = 1 << 17, }; -enum arm_spe_neoverse_data_source { - ARM_SPE_NV_L1D = 0x0, - ARM_SPE_NV_L2 = 0x8, - ARM_SPE_NV_PEER_CORE = 0x9, - ARM_SPE_NV_LOCAL_CLUSTER = 0xa, - ARM_SPE_NV_SYS_CACHE = 0xb, - ARM_SPE_NV_PEER_CLUSTER = 0xc, - ARM_SPE_NV_REMOTE = 0xd, - ARM_SPE_NV_DRAM = 0xe, +enum arm_spe_common_data_source { + ARM_SPE_COMMON_DS_L1D = 0x0, + ARM_SPE_COMMON_DS_L2 = 0x8, + ARM_SPE_COMMON_DS_PEER_CORE = 0x9, + ARM_SPE_COMMON_DS_LOCAL_CLUSTER = 0xa, + ARM_SPE_COMMON_DS_SYS_CACHE = 0xb, + ARM_SPE_COMMON_DS_PEER_CLUSTER = 0xc, + ARM_SPE_COMMON_DS_REMOTE = 0xd, + ARM_SPE_COMMON_DS_DRAM = 0xe, }; struct arm_spe_record { diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index 97f3c190817b..2ab9078d49fc 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -413,15 +413,15 @@ static int arm_spe__synth_instruction_sample(struct arm_spe_queue *speq, return arm_spe_deliver_synth_event(spe, speq, event, &sample); } -static const struct midr_range neoverse_spe[] = { +static const struct midr_range common_ds_encoding_cpus[] = { MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1), MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2), MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1), {}, }; -static void arm_spe__synth_data_source_neoverse(const struct arm_spe_record *record, - union perf_mem_data_src *data_src) +static void arm_spe__synth_data_source_common(const struct arm_spe_record *record, + union perf_mem_data_src *data_src) { /* * Even though four levels of cache hierarchy are possible, no known @@ -443,17 +443,17 @@ static void arm_spe__synth_data_source_neoverse(const struct arm_spe_record *rec } switch (record->source) { - case ARM_SPE_NV_L1D: + case ARM_SPE_COMMON_DS_L1D: data_src->mem_lvl = PERF_MEM_LVL_L1 | PERF_MEM_LVL_HIT; data_src->mem_lvl_num = PERF_MEM_LVLNUM_L1; data_src->mem_snoop = PERF_MEM_SNOOP_NONE; break; - case ARM_SPE_NV_L2: + case ARM_SPE_COMMON_DS_L2: data_src->mem_lvl = PERF_MEM_LVL_L2 | PERF_MEM_LVL_HIT; data_src->mem_lvl_num = PERF_MEM_LVLNUM_L2; data_src->mem_snoop = PERF_MEM_SNOOP_NONE; break; - case ARM_SPE_NV_PEER_CORE: + case ARM_SPE_COMMON_DS_PEER_CORE: data_src->mem_lvl = PERF_MEM_LVL_L2 | PERF_MEM_LVL_HIT; data_src->mem_lvl_num = PERF_MEM_LVLNUM_L2; data_src->mem_snoopx = PERF_MEM_SNOOPX_PEER; @@ -462,8 +462,8 @@ static void arm_spe__synth_data_source_neoverse(const struct arm_spe_record *rec * We don't know if this is L1, L2 but we do know it was a cache-2-cache * transfer, so set SNOOPX_PEER */ - case ARM_SPE_NV_LOCAL_CLUSTER: - case ARM_SPE_NV_PEER_CLUSTER: + case ARM_SPE_COMMON_DS_LOCAL_CLUSTER: + case ARM_SPE_COMMON_DS_PEER_CLUSTER: data_src->mem_lvl = PERF_MEM_LVL_L3 | PERF_MEM_LVL_HIT; data_src->mem_lvl_num = PERF_MEM_LVLNUM_L3; data_src->mem_snoopx = PERF_MEM_SNOOPX_PEER; @@ -471,7 +471,7 @@ static void arm_spe__synth_data_source_neoverse(const struct arm_spe_record *rec /* * System cache is assumed to be L3 */ - case ARM_SPE_NV_SYS_CACHE: + case ARM_SPE_COMMON_DS_SYS_CACHE: data_src->mem_lvl = PERF_MEM_LVL_L3 | PERF_MEM_LVL_HIT; data_src->mem_lvl_num = PERF_MEM_LVLNUM_L3; data_src->mem_snoop = PERF_MEM_SNOOP_HIT; @@ -480,13 +480,13 @@ static void arm_spe__synth_data_source_neoverse(const struct arm_spe_record *rec * We don't know what level it hit in, except it came from the other * socket */ - case ARM_SPE_NV_REMOTE: + case ARM_SPE_COMMON_DS_REMOTE: data_src->mem_lvl = PERF_MEM_LVL_REM_CCE1; data_src->mem_lvl_num = PERF_MEM_LVLNUM_ANY_CACHE; data_src->mem_remote = PERF_MEM_REMOTE_REMOTE; data_src->mem_snoopx = PERF_MEM_SNOOPX_PEER; break; - case ARM_SPE_NV_DRAM: + case ARM_SPE_COMMON_DS_DRAM: data_src->mem_lvl = PERF_MEM_LVL_LOC_RAM | PERF_MEM_LVL_HIT; data_src->mem_lvl_num = PERF_MEM_LVLNUM_RAM; data_src->mem_snoop = PERF_MEM_SNOOP_NONE; @@ -522,7 +522,7 @@ static void arm_spe__synth_memory_level(const struct arm_spe_record *record, static u64 arm_spe__synth_data_source(const struct arm_spe_record *record, u64 midr) { union perf_mem_data_src data_src = { .mem_op = PERF_MEM_OP_NA }; - bool is_neoverse = is_midr_in_range_list(midr, neoverse_spe); + bool is_common = is_midr_in_range_list(midr, common_ds_encoding_cpus); if (record->op & ARM_SPE_OP_LD) data_src.mem_op = PERF_MEM_OP_LOAD; @@ -531,8 +531,8 @@ static u64 arm_spe__synth_data_source(const struct arm_spe_record *record, u64 m else return 0; - if (is_neoverse) - arm_spe__synth_data_source_neoverse(record, &data_src); + if (is_common) + arm_spe__synth_data_source_common(record, &data_src); else arm_spe__synth_memory_level(record, &data_src); From patchwork Tue Aug 27 16:51:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13779824 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 76DA6C5472F for ; Tue, 27 Aug 2024 16:57:03 +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:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MewTf0GMdaq95V3xbZ5fyn+pS9mu/FXnMGa6+NKhCAY=; b=IQf6AyrYzurChPgXQwTvNsBPpX qCJAj7iCpIBjCZIzS5nqufIl/8WeKxnlhvz+twsCZz9fnXoL+hS5sHrIhKDcg+aflaEGe5CwmW7TS gZjKLKlB/Xbosyuu4nbdKrzrmKbG6MgMD84sx1RVfQo6A/5s98x5EvIvXrNUE0SJoOedwwQs75NY9 TLU1NnHGIuHPO8/WfvQz0RO77uiI+/czV1yQiMJrbJglNhPJQhU1SZOQLEmUf7ry4XV2PVMiN24gX H4MCaXmRD+UPkw1Bh2sSLUy4T4lMwogG3v1kpdumEDJAAc9ElnFB3Rd2rU4dwpzYyB/129uDhxghX VsvzhhRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sizV0-0000000CAhQ-0X7y; Tue, 27 Aug 2024 16:56:54 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sizQ5-0000000C96g-36QY for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 16:51:51 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 84E071424; Tue, 27 Aug 2024 09:52:15 -0700 (PDT) Received: from e132581.cambridge.arm.com (e132581.arm.com [10.2.76.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 525CB3F66E; Tue, 27 Aug 2024 09:51:47 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , James Clark , Namhyung Kim , Ian Rogers , Jiri Olsa , Adrian Hunter , John Garry , Will Deacon , Mark Rutland , Mike Leach , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v1 3/7] perf arm-spe: Introduce arm_spe__is_homogeneous() Date: Tue, 27 Aug 2024 17:51:21 +0100 Message-Id: <20240827165125.3311306-4-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240827165125.3311306-1-leo.yan@arm.com> References: <20240827165125.3311306-1-leo.yan@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240827_095149_858059_F668D093 X-CRM114-Status: GOOD ( 12.35 ) 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 Introduce the arm_spe__is_homogeneous() function, it uses to check if Arm SPE is homogeneous cross all CPUs. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index 2ab9078d49fc..e7ad52215066 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -82,6 +82,7 @@ struct arm_spe { u64 **metadata; u64 metadata_ver; u64 metadata_num_cpu; + bool is_homogeneous; }; struct arm_spe_queue { @@ -1316,6 +1317,30 @@ static u64 *arm_spe__create_meta_blk(u64 *buf, int per_cpu_size) return metadata; } +static bool arm_spe__is_homogeneous(u64 **metadata, int num_cpu) +{ + u64 midr; + int i; + + if (!num_cpu) + return false; + + for (i = 0; i < num_cpu; i++) { + if (!metadata[i]) + return false; + + if (i == 0) { + midr = metadata[i][ARM_SPE_CPU_MIDR]; + continue; + } + + if (midr != metadata[i][ARM_SPE_CPU_MIDR]) + return false; + } + + return true; +} + int arm_spe_process_auxtrace_info(union perf_event *event, struct perf_session *session) { @@ -1384,6 +1409,7 @@ int arm_spe_process_auxtrace_info(union perf_event *event, spe->metadata = metadata; spe->metadata_ver = metadata_ver; spe->metadata_num_cpu = num_cpu; + spe->is_homogeneous = arm_spe__is_homogeneous(metadata, num_cpu); spe->timeless_decoding = arm_spe__is_timeless_decoding(spe); From patchwork Tue Aug 27 16:51:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13779825 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 894F5C5472F for ; Tue, 27 Aug 2024 16:57:50 +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:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AgH4V8/Dt4jy1CjykRdVTyuGgMdaHVhocBmU4Pjdi7c=; b=2qItaJS2TEKw0cjwNNyKRXwz3N UYaRj+zj/lBx4ZgoAor6BwfSLtJaBSmAP4nJEpISYS/xQOG/zXyYq9PyzU4pVVL3enSdDjQQeiKrq aJJdRR9eM0yqWJlvXmvdoCAkf4/F8Ct/6Ch/BHyrmJfEctZcPEmaC2rquBGzUNSSMfCqATAR0EB9f JT2HvXICrbfLGNqKY8QaERhsned75q15PoMHR3XUNMDOKIU1kd2ja7CNRnlJoeoKwSHb/NHesbism Y3iAMB3uAlUgXiJoQ/EtP5dyoNvYVx6TDiZgM02dcgS600uRMT8rcfXNNhaIl9UpmUedi8+UO83ir Q81TtMuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sizVl-0000000CAp1-1seU; Tue, 27 Aug 2024 16:57:41 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sizQ7-0000000C97Y-4A16 for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 16:51:53 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C83DD11FB; Tue, 27 Aug 2024 09:52:17 -0700 (PDT) Received: from e132581.cambridge.arm.com (e132581.arm.com [10.2.76.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 956553F66E; Tue, 27 Aug 2024 09:51:49 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , James Clark , Namhyung Kim , Ian Rogers , Jiri Olsa , Adrian Hunter , John Garry , Will Deacon , Mark Rutland , Mike Leach , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v1 4/7] perf arm-spe: Use metadata to decide the data source feature Date: Tue, 27 Aug 2024 17:51:22 +0100 Message-Id: <20240827165125.3311306-5-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240827165125.3311306-1-leo.yan@arm.com> References: <20240827165125.3311306-1-leo.yan@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240827_095152_137371_274C7414 X-CRM114-Status: GOOD ( 22.62 ) 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 info in the metadata to decide if the data source feature is supported. The two factors are involving the decision, one is the CPU MIDR which must be in the CPU list for the common data source encoding, and another one is the Load Data Source (LDS) capacity. For the metadata version 1, it doesn't include info for MIDR and LDS. In this case, due to absent info for making decision, print out warning to remind users to upgrade tool and returns false. If the perf data contains the metadata version 2, only above two conditions are met, it is safe to say the data source packet complies the common encoding. Otherwise, it returns false. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 68 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index e7ad52215066..600b8b031539 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -278,6 +278,20 @@ static int arm_spe_set_tid(struct arm_spe_queue *speq, pid_t tid) return 0; } +static u64 *arm_spe__get_metadata_by_cpu(struct arm_spe *spe, u64 cpu) +{ + u64 i; + + if (!spe->metadata) + return NULL; + + for (i = 0; i < spe->metadata_num_cpu; i++) + if (spe->metadata[i][ARM_SPE_CPU] == cpu) + return spe->metadata[i]; + + return NULL; +} + static struct simd_flags arm_spe__synth_simd_flags(const struct arm_spe_record *record) { struct simd_flags simd_flags = {}; @@ -520,10 +534,58 @@ static void arm_spe__synth_memory_level(const struct arm_spe_record *record, data_src->mem_lvl |= PERF_MEM_LVL_REM_CCE1; } -static u64 arm_spe__synth_data_source(const struct arm_spe_record *record, u64 midr) +static bool arm_spe__is_common_ds_encoding(struct arm_spe_queue *speq) +{ + struct arm_spe *spe = speq->spe; + bool is_in_cpu_list; + u64 *metadata = NULL; + u64 midr = 0, lds = 0; + + /* + * Metadata version 1 doesn't contain any info for MIDR and LDS. + * Simply return false in this case. + */ + if (spe->metadata_ver == 1) { + pr_warning_once("The data file contains metadata version 1, " + "which is absent the info for data source. " + "Please upgrade the tool to record data.\n"); + return false; + } + + /* CPU ID is -1 for per-thread mode */ + if (speq->cpu < 0) { + /* + * On the heterogeneous system, due to CPU ID is -1, + * cannot confirm the data source packet is supported. + */ + if (!spe->is_homogeneous) + return false; + + /* In homogeneous system, simply use CPU0's metadata */ + if (spe->metadata) + metadata = spe->metadata[0]; + } else { + metadata = arm_spe__get_metadata_by_cpu(spe, speq->cpu); + } + + if (!metadata) + return false; + + midr = metadata[ARM_SPE_CPU_MIDR]; + lds = metadata[ARM_SPE_CAP_LDS]; + + is_in_cpu_list = is_midr_in_range_list(midr, common_ds_encoding_cpus); + if (is_in_cpu_list && lds) + return true; + else + return false; +} + +static u64 arm_spe__synth_data_source(struct arm_spe_queue *speq, + const struct arm_spe_record *record) { union perf_mem_data_src data_src = { .mem_op = PERF_MEM_OP_NA }; - bool is_common = is_midr_in_range_list(midr, common_ds_encoding_cpus); + bool is_common = arm_spe__is_common_ds_encoding(speq); if (record->op & ARM_SPE_OP_LD) data_src.mem_op = PERF_MEM_OP_LOAD; @@ -556,7 +618,7 @@ static int arm_spe_sample(struct arm_spe_queue *speq) u64 data_src; int err; - data_src = arm_spe__synth_data_source(record, spe->midr); + data_src = arm_spe__synth_data_source(speq, record); if (spe->sample_flc) { if (record->type & ARM_SPE_L1D_MISS) { From patchwork Tue Aug 27 16:51:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13779847 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 5A9F6C54731 for ; Tue, 27 Aug 2024 16:58:40 +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:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=E6vAVBYCF9g0P+CDARUoEAoGzrIpP0UFRfyvttOB/WQ=; b=cG7jsEJ43kg4Fm8lMdUpqLhXgA Z+nsXIKFdngt3flulLEcE4dWUfhtrg7+wFiJNbqRdaHLpq0gOjw/whkSQNcmu06g4wrZslNPbthdl BKS6SIK4Cg0LoNWLuIny4bFCPZZjs5Qg+krX0hRbIP7aTcrlPNJKVo6POhYeXpR2UW6yw4QnkVWrh nTzrP6wqMsO5wgEfDv3XEjFB5XJ8VGfPlJkkOIithmiMnIhdMT21GCzfJZr15k4xGzUoH33lo7xBy 8OAaJomL40q2XRnR0/Li8ZvUg0RKNFUZRFEGQuePwwKgpzwP/vhUSVhLd31InjgF701aGI1Mpq4Ip bO1JF/Tw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sizWX-0000000CAwV-0vLR; Tue, 27 Aug 2024 16:58:29 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sizQA-0000000C986-1AHG for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 16:51:55 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 17DC713D5; Tue, 27 Aug 2024 09:52:20 -0700 (PDT) Received: from e132581.cambridge.arm.com (e132581.arm.com [10.2.76.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D97E23F66E; Tue, 27 Aug 2024 09:51:51 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , James Clark , Namhyung Kim , Ian Rogers , Jiri Olsa , Adrian Hunter , John Garry , Will Deacon , Mark Rutland , Mike Leach , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v1 5/7] perf arm-spe: Remove the unused 'midr' field Date: Tue, 27 Aug 2024 17:51:23 +0100 Message-Id: <20240827165125.3311306-6-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240827165125.3311306-1-leo.yan@arm.com> References: <20240827165125.3311306-1-leo.yan@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240827_095154_377429_312A281C X-CRM114-Status: GOOD ( 10.85 ) 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 The 'midr' field is replaced by the MIDR values stored in metadata (per CPU wise). Remove the 'midr' field as it is no longer used. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index 600b8b031539..f7bc39043a23 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -46,7 +46,6 @@ struct arm_spe { u32 auxtrace_type; struct perf_session *session; struct machine *machine; - u64 midr; struct perf_tsc_conversion tc; @@ -1409,8 +1408,6 @@ int arm_spe_process_auxtrace_info(union perf_event *event, struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info; size_t min_sz; struct perf_record_time_conv *tc = &session->time_conv; - const char *cpuid = perf_env__cpuid(session->evlist->env); - u64 midr = strtol(cpuid, NULL, 16); struct arm_spe *spe; u64 *ptr = NULL; u64 **metadata = NULL; @@ -1467,7 +1464,6 @@ int arm_spe_process_auxtrace_info(union perf_event *event, spe->session = session; spe->machine = &session->machines.host; /* No kvm support */ spe->auxtrace_type = auxtrace_info->type; - spe->midr = midr; spe->metadata = metadata; spe->metadata_ver = metadata_ver; spe->metadata_num_cpu = num_cpu; From patchwork Tue Aug 27 16:51:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13779848 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 26D60C54731 for ; Tue, 27 Aug 2024 16:59:29 +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:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FFE5iZGrXUNvPObzangcYxiE65Mf78lPPp5WrTEII6k=; b=Qf5WaYOmxVpJy5A64MENUseu0V KQYiRQxr6aw6HuNlXzdRZj7w3toPc1gSsuXcYBG/Z2I3M3FqwcVNKyKiKtiHrnvdYeeDOjrj3NUdO y7JIVYWGqNlaOx97yhPRUM3NSiX7jmoxYcMI4CWl2FVd9HA7gi1DSL5uYBJFgxQYptyB3FVlRlcGj sgKL/Wbly57y3vmnQmKBK7eCcBcz2nxTi2VvWtwzWwN8NnCd6rknd1/1WiGRBE5b3OY95P5maWjm4 JNu89pn9sLsc2QiWTeD+8D4rCcyuTrZhe5SCuQPG+Oz+yC4HXpBDaD/YQmJqhkJP1LERxFjX0mjBW lboCGPAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sizXK-0000000CB9f-0uRG; Tue, 27 Aug 2024 16:59:18 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sizQC-0000000C99N-2dZr for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 16:51:57 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 83C5011FB; Tue, 27 Aug 2024 09:52:22 -0700 (PDT) Received: from e132581.cambridge.arm.com (e132581.arm.com [10.2.76.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2963A3F66E; Tue, 27 Aug 2024 09:51:54 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , James Clark , Namhyung Kim , Ian Rogers , Jiri Olsa , Adrian Hunter , John Garry , Will Deacon , Mark Rutland , Mike Leach , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Besar Wicaksono , Leo Yan Subject: [PATCH v1 6/7] perf arm-spe: Add Neoverse-V2 to common data source encoding list Date: Tue, 27 Aug 2024 17:51:24 +0100 Message-Id: <20240827165125.3311306-7-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240827165125.3311306-1-leo.yan@arm.com> References: <20240827165125.3311306-1-leo.yan@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240827_095156_736743_82DCC6F7 X-CRM114-Status: UNSURE ( 9.05 ) X-CRM114-Notice: Please train this message. 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 From: Besar Wicaksono Add Neoverse-V2 MIDR to the common data source encoding range list. Signed-off-by: Besar Wicaksono Reviewed-by: Leo Yan --- tools/perf/util/arm-spe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index f7bc39043a23..b97837f71bfc 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -431,6 +431,7 @@ static const struct midr_range common_ds_encoding_cpus[] = { MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1), MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2), MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1), + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2), {}, }; From patchwork Tue Aug 27 16:51:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13779849 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 A3C8BC5472F for ; Tue, 27 Aug 2024 17:00:16 +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:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+WrzSKFwSwCFZPZIdzFCkPPgAQvSQJiv/92rmJQPfvU=; b=BGMlfMs4aPgjHJSu9FFMIk/m1v 9o5j3E5wt8r4xMlOMRixqSJnA/sk7V+VzB4JhIiP8kDTxhxtrxaOeT1C0z3DChmQm6hyqn9Rj92Da jIFV7tmB5XPznVZOlk+9xhQTOVayyJcn+WrpCDsTMGclQKC71AOCzstnIEgc9zribBZyw5Ir7RXVO zOcBP1R3elc19yxSiH+FQzLlMGdUuYzRqIr1AiUOflXfmeUzoDLLRJKYmPnOVs56XzWJjCDpqceB8 84sUj6H++V5VL7qMcD/ClH2OYuhRYYUNFcWEL6EPLKA8/6pZdFqEQIkZOKzVZTaqaEvheyg8Hj5Qk 2w0HlDQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sizY6-0000000CBJu-0dy1; Tue, 27 Aug 2024 17:00:06 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sizQE-0000000C9Ao-3xDl for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 16:52:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CFE2711FB; Tue, 27 Aug 2024 09:52:24 -0700 (PDT) Received: from e132581.cambridge.arm.com (e132581.arm.com [10.2.76.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 942343F66E; Tue, 27 Aug 2024 09:51:56 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , James Clark , Namhyung Kim , Ian Rogers , Jiri Olsa , Adrian Hunter , John Garry , Will Deacon , Mark Rutland , Mike Leach , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v1 7/7] perf arm-spe: Add Cortex CPUs to common data source encoding list Date: Tue, 27 Aug 2024 17:51:25 +0100 Message-Id: <20240827165125.3311306-8-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240827165125.3311306-1-leo.yan@arm.com> References: <20240827165125.3311306-1-leo.yan@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240827_095159_053124_A50EF014 X-CRM114-Status: UNSURE ( 9.75 ) X-CRM114-Notice: Please train this message. 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 Add Cortex-A720, Cortex-A725, Cortex-X1C, Cortex-X3 and Cortex-X925 into the common data source encoding list. As ever CPU's technical reference manual defines the data source packet as the common encoding format. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index b97837f71bfc..422950db9566 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -428,6 +428,11 @@ static int arm_spe__synth_instruction_sample(struct arm_spe_queue *speq, } static const struct midr_range common_ds_encoding_cpus[] = { + MIDR_ALL_VERSIONS(MIDR_CORTEX_A720), + MIDR_ALL_VERSIONS(MIDR_CORTEX_A725), + MIDR_ALL_VERSIONS(MIDR_CORTEX_X1C), + MIDR_ALL_VERSIONS(MIDR_CORTEX_X3), + MIDR_ALL_VERSIONS(MIDR_CORTEX_X925), MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1), MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2), MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1),