Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp694786rdb; Tue, 15 Aug 2023 09:10:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHo9TgxmZIiXkcawX6rz5k+CNRoMyYwSw5Kd6qyOPV6p7dmdKzlbaltfE5ImzE64dS1SD3/ X-Received: by 2002:a17:903:228b:b0:1bd:ea15:e3a9 with SMTP id b11-20020a170903228b00b001bdea15e3a9mr6496601plh.48.1692115829329; Tue, 15 Aug 2023 09:10:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692115829; cv=none; d=google.com; s=arc-20160816; b=SfjJ7wXzMceprsS43Ywa+g/56HmFXdRiwVYf7T/u3m3kR9JygP8wrk9iHG96xj3PrR aZZt+Ey/8cQtndEGdYa/IXbFbh4DsWUNVQyVMts7uRpfY9KNoypLPAbT4zK7e7juZ8PH f7HsZmNC1BpyuY7grA7sPJAbO6JZR1sqVR7Hp2WCTyVWAufrmp96Pu8l9sObq1CR2ZD8 RZpX7k5tbRUsZ3qI5epCW5+SN3tUM+AXJBZwmrxJUoIsrXUUUorVWV9PuOw3ASLjMzkT vya5Q5ew6108roW/LBTx0ea84/I99tWG6SPxf/k+RKAx/dGJH1oJYQIZLcvcuzwFAEju ZcZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=GW/5WnYQS4hHjJYoQI8WRBL/1pMLlWcvcnhbxWqARoc=; fh=Qf95zixP81eXAFUI6GteHSZ97VE3pUWiZzX+Z0MsBis=; b=HdsyCbQFpURpf7anNQnXV7TWzxQiM2ypxcSQeaYxcFtuIpubNYrwcBpzKE2iOvH6lV 6ybNTDKUpidu7Nnqu4W7uH3DkhRgokDqwevmVmIQR7mFfAKkgy5ak+tl5nO01OSzt4mT yTCKktLDwY5XF+VjCg7AGqLZXBMdp43HcuX3QtCcZspHWOgua3vrNXA09jIL9Dy7xV8g 7oAV0J3IdHMUpM+IUHSsWbqKFYNLmFKlLz9PvQlu6DrIDwPqUjOnUAmD2AtYei58p1aQ dRCN1x6QZEmxw75zVXoRhsFY2FOilXI8R0s52Wx5Mr85niPol+OsuWkiY5kyNEf0tvFv TGIg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b4-20020a170902650400b001bbc066c626si5983759plk.428.2023.08.15.09.10.14; Tue, 15 Aug 2023 09:10: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237233AbjHOMoC (ORCPT + 99 others); Tue, 15 Aug 2023 08:44:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237264AbjHOMni (ORCPT ); Tue, 15 Aug 2023 08:43:38 -0400 Received: from out30-97.freemail.mail.aliyun.com (out30-97.freemail.mail.aliyun.com [115.124.30.97]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC19A172A; Tue, 15 Aug 2023 05:43:34 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=renyu.zj@linux.alibaba.com;NM=1;PH=DS;RN=20;SR=0;TI=SMTPD_---0Vps.ZOj_1692103407; Received: from 30.221.150.39(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0Vps.ZOj_1692103407) by smtp.aliyun-inc.com; Tue, 15 Aug 2023 20:43:29 +0800 Message-ID: <2b1fd6cd-69a0-c38d-c1c2-442dc36456a3@linux.alibaba.com> Date: Tue, 15 Aug 2023 20:43:27 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v6 6/7] perf jevents: Add support for Arm CMN PMU aliasing To: Ian Rogers Cc: John Garry , 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 , Shuai Xue References: <1691394685-61240-1-git-send-email-renyu.zj@linux.alibaba.com> <1691394685-61240-7-git-send-email-renyu.zj@linux.alibaba.com> From: Jing Zhang In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_IN_DEF_SPF_WL 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 在 2023/8/15 上午6:36, Ian Rogers 写道: > On Mon, Aug 7, 2023 at 12:51 AM Jing Zhang wrote: >> >> 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: > > nit: The use of the words "events" and "aliases" can be confusing - > aliases isn't specific as there may be a notion of other aliases like > for PMU names. I think in the code base we should avoid to use > "aliases" and just use "events". > Thank you for your suggestions. But if I use "event" instead of "alias" here, it may not describe it clearly because essentially I am adding aliases to existing events rather than adding new events. Thanks, Jing > Thanks, > Ian > >> [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()}' >> >> -- >> 1.8.3.1 >>