From patchwork Mon Aug 7 07:51:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 13343174 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 A49C5C04FDF for ; Mon, 7 Aug 2023 07:52:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DojrPvmWQYCa6yU0p08wtA7RwXaCXgqcDifQ0wrP2d4=; b=0/OKFgWyj9m0CD TQksJRe4dLRWxDaI8LbxZ8TFxSzuF2l74Vzslrk0tP5XQHZI7v08JY1NLySf00kE1jr5N6h+zdy+8 erdTI1D1QoeHhMwrV/kcqs3dSI4xykdIWDZcwFqeAQTSBfCgJRclxCku4acG6odLv0eHszia0ALOG iVXHqta8z/Aaa7xpvWbYWwbumSMdqFQt8gNbcV0ipdhYd5tp6ualgrXU6VfEAg5rQhAjfxtxVKa07 l2CEs9uhomXBFnypYwREfDSpBw0DX5i542kUYRIFmvMP0QlEGJgnuCDCAUK+TBJSKxYMbBJVIyk4H geU1mEU7U5oso54oNCoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qSv1t-00GOWM-2V; Mon, 07 Aug 2023 07:51:53 +0000 Received: from out30-99.freemail.mail.aliyun.com ([115.124.30.99]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qSv1m-00GOPq-1s for linux-arm-kernel@lists.infradead.org; Mon, 07 Aug 2023 07:51:51 +0000 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=renyu.zj@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0VpC-05Q_1691394699; Received: from srmbuffer011165236051.sqa.net(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VpC-05Q_1691394699) by smtp.aliyun-inc.com; Mon, 07 Aug 2023 15:51:40 +0800 From: Jing Zhang To: John Garry , Ian Rogers Cc: Will Deacon , James Clark , Arnaldo Carvalho de Melo , Mark Rutland , Mike Leach , Leo Yan , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Adrian Hunter , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-doc@vger.kernel.org, Zhuo Song , Jing Zhang , Shuai Xue Subject: [PATCH v6 6/7] perf jevents: Add support for Arm CMN PMU aliasing Date: Mon, 7 Aug 2023 15:51:24 +0800 Message-Id: <1691394685-61240-7-git-send-email-renyu.zj@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1691394685-61240-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1691394685-61240-1-git-send-email-renyu.zj@linux.alibaba.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230807_005146_837828_D97F01B0 X-CRM114-Status: GOOD ( 16.96 ) 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 Currently just add aliases for part of Arm CMN PMU events which are general and compatible for any SoC and CMN-ANY. "Compat" value "434*;436*;43c*;43a*" means it is compatible with all CMN600/CMN650/CMN700/Ci700, which can be obtained from commit 7819e05a0dce ("perf/arm-cmn: Revamp model detection"). The arm-cmn PMU events got from: [0] https://developer.arm.com/documentation/100180/0302/?lang=en [1] https://developer.arm.com/documentation/101408/0100/?lang=en [2] https://developer.arm.com/documentation/102308/0302/?lang=en [3] https://developer.arm.com/documentation/101569/0300/?lang=en Signed-off-by: Jing Zhang Reviewed-by: John Garry --- .../pmu-events/arch/arm64/arm/cmn/sys/cmn.json | 266 +++++++++++++++++++++ tools/perf/pmu-events/jevents.py | 1 + 2 files changed, 267 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/arm/cmn/sys/cmn.json diff --git a/tools/perf/pmu-events/arch/arm64/arm/cmn/sys/cmn.json b/tools/perf/pmu-events/arch/arm64/arm/cmn/sys/cmn.json new file mode 100644 index 0000000..e54036c --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/arm/cmn/sys/cmn.json @@ -0,0 +1,266 @@ +[ + { + "EventName": "hnf_cache_miss", + "EventIdCode": "0x1", + "Type": "0x5", + "BriefDescription": "Counts total cache misses in first lookup result (high priority).", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hnf_slc_sf_cache_access", + "EventIdCode": "0x2", + "Type": "0x5", + "BriefDescription": "Counts number of cache accesses in first access (high priority).", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hnf_cache_fill", + "EventIdCode": "0x3", + "Type": "0x5", + "BriefDescription": "Counts total allocations in HN SLC (all cache line allocations to SLC).", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hnf_pocq_retry", + "EventIdCode": "0x4", + "Type": "0x5", + "BriefDescription": "Counts number of retried requests.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hnf_pocq_reqs_recvd", + "EventIdCode": "0x5", + "Type": "0x5", + "BriefDescription": "Counts number of requests that HN receives.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hnf_sf_hit", + "EventIdCode": "0x6", + "Type": "0x5", + "BriefDescription": "Counts number of SF hits.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hnf_sf_evictions", + "EventIdCode": "0x7", + "Type": "0x5", + "BriefDescription": "Counts number of SF eviction cache invalidations initiated.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hnf_dir_snoops_sent", + "EventIdCode": "0x8", + "Type": "0x5", + "BriefDescription": "Counts number of directed snoops sent (not including SF back invalidation).", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hnf_brd_snoops_sent", + "EventIdCode": "0x9", + "Type": "0x5", + "BriefDescription": "Counts number of multicast snoops sent (not including SF back invalidation).", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hnf_slc_eviction", + "EventIdCode": "0xa", + "Type": "0x5", + "BriefDescription": "Counts number of SLC evictions (dirty only).", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hnf_slc_fill_invalid_way", + "EventIdCode": "0xb", + "Type": "0x5", + "BriefDescription": "Counts number of SLC fills to an invalid way.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hnf_mc_retries", + "EventIdCode": "0xc", + "Type": "0x5", + "BriefDescription": "Counts number of retried transactions by the MC.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hnf_mc_reqs", + "EventIdCode": "0xd", + "Type": "0x5", + "BriefDescription": "Counts number of requests that are sent to MC.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hnf_qos_hh_retry", + "EventIdCode": "0xe", + "Type": "0x5", + "BriefDescription": "Counts number of times a HighHigh priority request is protocolretried at the HN‑F.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "rnid_s0_rdata_beats", + "EventIdCode": "0x1", + "Type": "0xa", + "BriefDescription": "Number of RData beats (RVALID and RREADY) dispatched on port 0. This event measures the read bandwidth, including CMO responses.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "rnid_s1_rdata_beats", + "EventIdCode": "0x2", + "Type": "0xa", + "BriefDescription": "Number of RData beats (RVALID and RREADY) dispatched on port 1. This event measures the read bandwidth, including CMO responses.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "rnid_s2_rdata_beats", + "EventIdCode": "0x3", + "Type": "0xa", + "BriefDescription": "Number of RData beats (RVALID and RREADY) dispatched on port 2. This event measures the read bandwidth, including CMO responses.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "rnid_rxdat_flits", + "EventIdCode": "0x4", + "Type": "0xa", + "BriefDescription": "Number of RXDAT flits received. This event measures the true read data bandwidth, excluding CMOs.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "rnid_txdat_flits", + "EventIdCode": "0x5", + "Type": "0xa", + "BriefDescription": "Number of TXDAT flits dispatched. This event measures the write bandwidth.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "rnid_txreq_flits_total", + "EventIdCode": "0x6", + "Type": "0xa", + "BriefDescription": "Number of TXREQ flits dispatched. This event measures the total request bandwidth.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "rnid_txreq_flits_retried", + "EventIdCode": "0x7", + "Type": "0xa", + "BriefDescription": "Number of retried TXREQ flits dispatched. This event measures the retry rate.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "sbsx_txrsp_retryack", + "EventIdCode": "0x4", + "Type": "0x7", + "BriefDescription": "Number of RXREQ flits dispatched. This event is a measure of the retry rate.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "sbsx_txdat_flitv", + "EventIdCode": "0x5", + "Type": "0x7", + "BriefDescription": "Number of TXDAT flits dispatched from XP to SBSX. This event is a measure of the write bandwidth.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "sbsx_arvalid_no_arready", + "EventIdCode": "0x21", + "Type": "0x7", + "BriefDescription": "Number of cycles the SBSX bridge is stalled because of backpressure on AR channel.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "sbsx_awvalid_no_awready", + "EventIdCode": "0x22", + "Type": "0x7", + "BriefDescription": "Number of cycles the SBSX bridge is stalled because of backpressure on AW channel.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "sbsx_wvalid_no_wready", + "EventIdCode": "0x23", + "Type": "0x7", + "BriefDescription": "Number of cycles the SBSX bridge is stalled because of backpressure on W channel.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hni_txrsp_retryack", + "EventIdCode": "0x2a", + "Type": "0x4", + "BriefDescription": "Number of RXREQ flits dispatched. This event is a measure of the retry rate.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hni_arvalid_no_arready", + "EventIdCode": "0x2b", + "Type": "0x4", + "BriefDescription": "Number of cycles the HN-I bridge is stalled because of backpressure on AR channel.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hni_arready_no_arvalid", + "EventIdCode": "0x2c", + "Type": "0x4", + "BriefDescription": "Number of cycles the AR channel is waiting for new requests from HN-I bridge.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hni_awvalid_no_awready", + "EventIdCode": "0x2d", + "Type": "0x4", + "BriefDescription": "Number of cycles the HN-I bridge is stalled because of backpressure on AW channel.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hni_awready_no_awvalid", + "EventIdCode": "0x2e", + "Type": "0x4", + "BriefDescription": "Number of cycles the AW channel is waiting for new requests from HN-I bridge.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hni_wvalid_no_wready", + "EventIdCode": "0x2f", + "Type": "0x4", + "BriefDescription": "Number of cycles the HN-I bridge is stalled because of backpressure on W channel.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + }, + { + "EventName": "hni_txdat_stall", + "EventIdCode": "0x30", + "Type": "0x4", + "BriefDescription": "TXDAT valid but no link credit available.", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a*" + } +] diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py index 9c0f63a..bfdfb67 100755 --- a/tools/perf/pmu-events/jevents.py +++ b/tools/perf/pmu-events/jevents.py @@ -272,6 +272,7 @@ class JsonEvent: 'DFPMC': 'amd_df', 'cpu_core': 'cpu_core', 'cpu_atom': 'cpu_atom', + 'arm_cmn': 'arm_cmn', } return table[unit] if unit in table else f'uncore_{unit.lower()}'