From patchwork Mon Nov 14 07:41:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 19558 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2017249wru; Sun, 13 Nov 2022 23:43:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf4ppwoxC5jRvYN8yBusy0R0O9vQqFnxqzR17LJxz1FBYeSZSUj0OPWZFzzfPGThl6GgnGVG X-Received: by 2002:a17:907:36c:b0:78d:3341:aa8 with SMTP id rs12-20020a170907036c00b0078d33410aa8mr9059938ejb.96.1668411803529; Sun, 13 Nov 2022 23:43:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668411803; cv=none; d=google.com; s=arc-20160816; b=S0gV5848KMzQGfFlHLdLMOBifLXGvXn7NgYNWR3xAwhFepHVATnZ8S1ExVZvuCojUE h4iL9VHz6xVAIEhL0q3AhOyc36RNxNZaiP26WI0nZiKNFDYfJjiREv7BrS9utLlLdPmb /BOl85WS2mmkR3CzXEJEpa8mIM17Y3STbky7LVp0Ujh8YS+HaRq9/7KQ5ad1JDjrLVZM OFkBHF0SVNJ2QcBV6d+L6WOAywRSFbgjW2k7LcJ+BBJqwnG8nE2HBp26Cttg3BIAGgtK 85EdiU4vvMy4wBWOJgPDLdmRikshSmllWsgLEKhBC+cHucJZEqXzQdnEtzBOZfYj7oFO qd+g== 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:references:in-reply-to :message-id:date:subject:cc:to:from; bh=UtI0mWB9+6zJNxmrEWGdA8RU2k++CGw0+tlRQ+Pwal0=; b=XxX21zZENNX9Xc1fmWJ/zRPzMDcTbIidrHcYVLLfyvn5+9f6zgKJAn4AQ8c5UwESfQ bw6KT1uquhm6rj2AgUzCT6mwHmpcpxNVsRXJgd6DrxNBRghTRzuHmFa1D839v1a9oQAZ LTSs1L0vSWKETZMv177INqQaAD5CFfAkIfo/db7bLZBGDJgtpnhGsg4EVMpomtyhZ+gF O9qBkdUQ47NR6C25YLo19qjRoSg0b0+UVstfHyQ77Cgd93UOvbINe7tumYb4mOtUOo9E nIEtKiqpa4U3SOHt20FJ0G68phAKDeL8URYVZa+7kQaYB9alarsWm/xoe6XAvB7Rplx6 6HbA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m14-20020a056402430e00b004675aeea9c5si7697540edc.553.2022.11.13.23.42.59; Sun, 13 Nov 2022 23:43:23 -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 S235867AbiKNHmn (ORCPT + 99 others); Mon, 14 Nov 2022 02:42:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235785AbiKNHml (ORCPT ); Mon, 14 Nov 2022 02:42:41 -0500 Received: from out30-43.freemail.mail.aliyun.com (out30-43.freemail.mail.aliyun.com [115.124.30.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF252140A2; Sun, 13 Nov 2022 23:42:40 -0800 (PST) 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=ay29a033018045168;MF=renyu.zj@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0VUjWi0h_1668411757; Received: from j66e01291.sqa.eu95.tbsite.net(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VUjWi0h_1668411757) by smtp.aliyun-inc.com; Mon, 14 Nov 2022 15:42:38 +0800 From: Jing Zhang To: linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Andrew Kilroy , Shuai Xue , Zhuo Song , Jing Zhang Subject: [RFC PATCH v2 1/6] perf vendor events arm64: Add topdown L1 metrics for neoverse-n2 Date: Mon, 14 Nov 2022 15:41:55 +0800 Message-Id: <1668411720-3581-2-git-send-email-renyu.zj@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1668411720-3581-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1668411720-3581-1-git-send-email-renyu.zj@linux.alibaba.com> In-Reply-To: <1667214694-89839-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1667214694-89839-1-git-send-email-renyu.zj@linux.alibaba.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748201495931610595?= X-GMAIL-MSGID: =?utf-8?q?1749456575069487043?= The calculation formula of topdown L1 is from the document: https://documentation-service.arm.com/static/60250c7395978b529036da86?token= However, due to the wrong count of stall_slot and stall_slot_frontend in neoverse-n2, the real stall_slot and real stall_slot_frontend need to subtract cpu_cycles, so when calculating the topdownL1 metrics, stall_slot and stall_slot_frontend are corrected. Since neoverse-n2 does not yet support topdown L2, metricgroups such as Cache, TLB, Branch, InstructionsMix, and PEutilization will be added to further analysis of performance bottlenecks in the following patches. Signed-off-by: Jing Zhang --- .../arch/arm64/arm/neoverse-n2/metrics.json | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/arm/neoverse-n2/metrics.json 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 new file mode 100644 index 0000000..0048dfe --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2/metrics.json @@ -0,0 +1,30 @@ +[ + { + "MetricExpr": "(stall_slot_frontend - cpu_cycles) / (5 * cpu_cycles)", + "PublicDescription": "Frontend bound L1 topdown metric", + "BriefDescription": "Frontend bound L1 topdown metric", + "MetricGroup": "TopDownL1", + "MetricName": "frontend_bound" + }, + { + "MetricExpr": "(1 - op_retired / op_spec) * (1 - (stall_slot - cpu_cycles) / (5 * cpu_cycles))", + "PublicDescription": "Wasted L1 topdown metric", + "BriefDescription": "Wasted L1 topdown metric", + "MetricGroup": "TopDownL1", + "MetricName": "wasted" + }, + { + "MetricExpr": "(op_retired / op_spec) * (1 - (stall_slot - cpu_cycles) / (5 * cpu_cycles))", + "PublicDescription": "Retiring L1 topdown metric", + "BriefDescription": "Retiring L1 topdown metric", + "MetricGroup": "TopDownL1", + "MetricName": "retiring" + }, + { + "MetricExpr": "stall_slot_backend / (5 * cpu_cycles)", + "PublicDescription": "Backend Bound L1 topdown metric", + "BriefDescription": "Backend Bound L1 topdown metric", + "MetricGroup": "TopDownL1", + "MetricName": "backend_bound" + } +] \ No newline at end of file