Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp12789552rwl; Tue, 3 Jan 2023 21:39:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXti4PjbyhHUFwxp6dtsBwz0TmfuoymR5bI4ecgEw8g9vw1felWMrXC1s9LaScqvP690wf5s X-Received: by 2002:a05:6402:e83:b0:467:75c6:4565 with SMTP id h3-20020a0564020e8300b0046775c64565mr42892556eda.9.1672810786316; Tue, 03 Jan 2023 21:39:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672810786; cv=none; d=google.com; s=arc-20160816; b=E8dW3bVx7jHnqB/AwFT0uMkpYW7Omt780p1oYAySW95FLTrfFGnabiFzr3H4/MKZdk PRkdS8BouaIMTlS67bFIFCxyBSABJQvXqnK98Z9vW2XNwPs9LUmHN9SpJK1R2yVGWlgo Ub7CfGDXlO7jkhavjDz/KEHWI3W/7TOG5dcz0mK8zd7by3+WDXhvWprv/ibpFnvF1LQV vAAe9eBw/LnAH02G0ZHm1P7rqhz6EI3UzfxDQXJni6pPZAqiK1N82HZcl/P0JJw/Os+b WguJOshkeXhZamzu4DCR/PtRHKCUs4UAy5Z6w+bgUOV1EQSmy3lWfdELmoJRcHFMsorl XZAw== 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=2rxqGGJkO35hvcCjCEJGuU46o4FNs3+6zskE6rPIy5s=; b=PTZts9vZbPeWYe8eIj5ettdv8p3KWMMc/089SE1P8K58tHAGfebSptstPZandaFwrf obBS1cIr4TLHcWIc+eH//1LXS8I0AA0sh6I4RR+Kame2oQtub5SMFRC0JBIzqdh/nxtI 4RgubHzIHLX7o1l9bdPFJh7OyRNNgDb3hki1A0/XtmDsvVLaNQz4tct4I9A30x0tuliC u1PYn/1UI1MAxYczk3pRLbKtEn161GP7Re5ZyvlgkbiTvleXSMWndG+7BIfCp+4FbGPz N5ALjPWxefeqOZ54zzSUD2X6rH+TIXnx7VCT8c4ydwK0HRfXXeEMVyfWMVTLaKv6ToRP gFJQ== 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 e19-20020a056402191300b0046ffcd4df07si34878425edz.569.2023.01.03.21.39.31; Tue, 03 Jan 2023 21:39:46 -0800 (PST) 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 S229802AbjADFVa (ORCPT + 59 others); Wed, 4 Jan 2023 00:21:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbjADFV0 (ORCPT ); Wed, 4 Jan 2023 00:21:26 -0500 Received: from out30-54.freemail.mail.aliyun.com (out30-54.freemail.mail.aliyun.com [115.124.30.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFBDDDEE2; Tue, 3 Jan 2023 21:21:24 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=renyu.zj@linux.alibaba.com;NM=1;PH=DS;RN=20;SR=0;TI=SMTPD_---0VYqBg3p_1672809679; Received: from 30.221.147.98(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VYqBg3p_1672809679) by smtp.aliyun-inc.com; Wed, 04 Jan 2023 13:21:20 +0800 Message-ID: <14a2ca08-e946-f319-e2a8-f5f91e1eb8e6@linux.alibaba.com> Date: Wed, 4 Jan 2023 13:21:18 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v5 2/6] perf vendor events arm64: Add TLB metrics for neoverse-n2 To: Ian Rogers Cc: John Garry , Xing Zhengjun , Will Deacon , James Clark , Mike Leach , Leo Yan , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Andrew Kilroy , Shuai Xue , Zhuo Song References: <1672745976-2800146-1-git-send-email-renyu.zj@linux.alibaba.com> <1672745976-2800146-3-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=-13.0 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, 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/1/4 上午1:14, Ian Rogers 写道: > On Tue, Jan 3, 2023 at 3:39 AM Jing Zhang wrote: >> >> Add TLB related metrics. >> >> Signed-off-by: Jing Zhang >> Acked-by: Ian Rogers >> --- >> .../arch/arm64/arm/neoverse-n2/metrics.json | 49 ++++++++++++++++++++++ >> 1 file changed, 49 insertions(+) >> >> diff --git a/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2/metrics.json b/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2/metrics.json >> index c126f1bc..8a74e07 100644 >> --- a/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2/metrics.json >> +++ b/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2/metrics.json >> @@ -26,5 +26,54 @@ >> "MetricGroup": "TopdownL1", >> "MetricName": "backend_bound", >> "ScaleUnit": "100%" >> + }, >> + { >> + "MetricExpr": "L1D_TLB_REFILL / L1D_TLB", >> + "BriefDescription": "The rate of L1D TLB refill to the overall L1D TLB lookups", >> + "MetricGroup": "TLB", >> + "MetricName": "l1d_tlb_miss_rate", >> + "ScaleUnit": "100%" >> + }, >> + { >> + "MetricExpr": "L1I_TLB_REFILL / L1I_TLB", >> + "BriefDescription": "The rate of L1I TLB refill to the overall L1I TLB lookups", >> + "MetricGroup": "TLB", >> + "MetricName": "l1i_tlb_miss_rate", >> + "ScaleUnit": "100%" >> + }, >> + { >> + "MetricExpr": "L2D_TLB_REFILL / L2D_TLB", >> + "BriefDescription": "The rate of L2D TLB refill to the overall L2D TLB lookups", >> + "MetricGroup": "TLB", >> + "MetricName": "l2_tlb_miss_rate", >> + "ScaleUnit": "100%" >> + }, >> + { >> + "MetricExpr": "DTLB_WALK / INST_RETIRED * 1000", >> + "BriefDescription": "The rate of TLB Walks per kilo instructions for data accesses", >> + "MetricGroup": "TLB", >> + "MetricName": "dtlb_mpki", >> + "ScaleUnit": "MPKI" >> + }, >> + { >> + "MetricExpr": "DTLB_WALK / L1D_TLB", >> + "BriefDescription": "The rate of DTLB Walks to the overall L1D TLB lookups", >> + "MetricGroup": "TLB", >> + "MetricName": "dtlb_walk_rate", >> + "ScaleUnit": "100%" >> + }, >> + { >> + "MetricExpr": "ITLB_WALK / INST_RETIRED * 1000", >> + "BriefDescription": "The rate of TLB Walks per kilo instructions for instruction accesses", >> + "MetricGroup": "TLB", >> + "MetricName": "itlb_mpki", >> + "ScaleUnit": "MPKI" > > Did you test this? IIRC if there is no number in the ScaleUnit then > the scale factor becomes 0 and the metric value is always multiplied > by zero. Perhaps: > > "MetricName": "itlb_miss_rate", > "MetricExpr": "ITLB / INST_RETIRED" > "ScaleUnit": "1000MPKI" > > Thanks, > Ian > You are absolutely right, I only tested TLB metrics. Sorry for not double checking. I will repost the corrected patches. >> + }, >> + { >> + "MetricExpr": "ITLB_WALK / L1I_TLB", >> + "BriefDescription": "The rate of ITLB Walks to the overall L1I TLB lookups", >> + "MetricGroup": "TLB", >> + "MetricName": "itlb_walk_rate", >> + "ScaleUnit": "100%" >> } >> ] >> -- >> 1.8.3.1 >>