Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp539203rwj; Fri, 23 Dec 2022 05:05:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXssS0gRWcKwCPAu0dk14ejZ53D0HmjJJ+WBPr0zNvM9748WVrTyY6vDgbRo0mLn5oGsckjJ X-Received: by 2002:a05:6a21:998a:b0:b0:1aa9:25bb with SMTP id ve10-20020a056a21998a00b000b01aa925bbmr14756692pzb.60.1671800740252; Fri, 23 Dec 2022 05:05:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671800740; cv=none; d=google.com; s=arc-20160816; b=KO+F8GkAcU+dbTRmaW41M8MSck4tOwDRc3BdsC2f0QXsdPPz6zR3Rnjn55G33HgcM4 uWIOaJuc9GhXQZbz5kGkk9PEAWziXA3fznkMImOa6jKrqfOtU/jSyUnL9nC+Ij+ia7QN H/ypbN2xzs/BrSQA1gHhg6ggOnfkGU2tTumZ82qUgc8BrHTfyNeDx+UrFdQjY6zyFq91 qYDccZA2Bd7E8zr9FMmSlaLzCt4wUKLbVmZrcuGcTFv5tBRF5wOScWoDrgWCwkmPT6jz PyCFSG/PBzk0gfE4YJ0JiF5n2StBUYMlDr7aO8AvliXqHAyP53jBxuYwF8Ht/57iheyD pltg== 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:message-id:date:subject :cc:to:from; bh=oU6vh2amfh+oK3hR8k+NMl0GQdC39EZxqufFc9KD+zM=; b=r/8xtZtoCBrxiFpfHuwE4iriZrv+Z7ux9idxzumOevXywvTE0LNh8sTzr9jovU1nhI 2Jr4GFGwuq5Ujx6TVhYiYvJDYULsNcHONpUXTrV4d2fnZEjSTUnZBbbY2/em0+l/TBFs Agd8VAppLFTCq1SrkRs00Dy9wdeJVJXW1j1JOXWSBStxD7N4EGdSVb1cWmXVIrJdTXOk 24dOS4O8yBT94O5/UNOdEUthmSMPIaJHmD/VoBhlpKIabxRqaMYrMn0sQSjUmgFXbmgk /wgaiixqlMyRyL8Vcbn3LnJCWRxwRkZBcOf8yMtdYMWRD8mpXovAp6uuO4rFhiZ1jl7t OjEw== 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 s73-20020a632c4c000000b00477a18e51e2si3530642pgs.141.2022.12.23.05.05.31; Fri, 23 Dec 2022 05:05:40 -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 S236217AbiLWMjs (ORCPT + 65 others); Fri, 23 Dec 2022 07:39:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235667AbiLWMjl (ORCPT ); Fri, 23 Dec 2022 07:39:41 -0500 Received: from out30-42.freemail.mail.aliyun.com (out30-42.freemail.mail.aliyun.com [115.124.30.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAC9B193EA; Fri, 23 Dec 2022 04:39:34 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R811e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=renyu.zj@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0VXwwMYd_1671799170; Received: from srmbuffer011165236051.sqa.eu95(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VXwwMYd_1671799170) by smtp.aliyun-inc.com; Fri, 23 Dec 2022 20:39:31 +0800 From: Jing Zhang To: John Garry , Ian Rogers , Xing Zhengjun , Will Deacon , James Clark , Mike Leach , Leo Yan Cc: 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 , Jing Zhang Subject: [PATCH v4 1/6] perf vendor events arm64: Add topdown L1 metrics for neoverse-n2 Date: Fri, 23 Dec 2022 20:37:20 +0800 Message-Id: <1671799045-1108027-2-git-send-email-renyu.zj@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1671799045-1108027-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1671799045-1108027-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 The formula of topdown L1 on neoverse-n2 is from ARM sbsa7.0 platform design document [0], D37-38. However, due to the wrong count of stall_slot and stall_slot_frontend on neoverse-n2, the real stall_slot and real stall_slot_frontend need to subtract cpu_cycles, so correct the expression of topdown metrics. Reference from ARM neoverse-n2 errata notice [1], D117. 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. Reference from ARM PMU guide [2][3]. [0] https://documentation-service.arm.com/static/60250c7395978b529036da86?token= [1] https://documentation-service.arm.com/static/636a66a64e6cf12278ad89cb?token= [2] https://documentation-service.arm.com/static/628f8fa3dfaf015c2b76eae8?token= [3] https://documentation-service.arm.com/static/62cfe21e31ea212bb6627393?token= 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..c126f1bc --- /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)", + "BriefDescription": "Frontend bound L1 topdown metric", + "MetricGroup": "TopdownL1", + "MetricName": "frontend_bound", + "ScaleUnit": "100%" + }, + { + "MetricExpr": "(1 - op_retired / op_spec) * (1 - (stall_slot - cpu_cycles) / (5 * cpu_cycles))", + "BriefDescription": "Bad speculation L1 topdown metric", + "MetricGroup": "TopdownL1", + "MetricName": "bad_speculation", + "ScaleUnit": "100%" + }, + { + "MetricExpr": "(op_retired / op_spec) * (1 - (stall_slot - cpu_cycles) / (5 * cpu_cycles))", + "BriefDescription": "Retiring L1 topdown metric", + "MetricGroup": "TopdownL1", + "MetricName": "retiring", + "ScaleUnit": "100%" + }, + { + "MetricExpr": "stall_slot_backend / (5 * cpu_cycles)", + "BriefDescription": "Backend Bound L1 topdown metric", + "MetricGroup": "TopdownL1", + "MetricName": "backend_bound", + "ScaleUnit": "100%" + } +] -- 1.8.3.1