Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11713656rwl; Tue, 3 Jan 2023 03:44:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXswfBzCJs+WtGeYqi9YsXbb1SAPDT6TqkeAW6zhcs2DADZkCuY5MkLDeQfwLMiKoy9CSsr9 X-Received: by 2002:a17:906:fad5:b0:847:410:ecf0 with SMTP id lu21-20020a170906fad500b008470410ecf0mr35267336ejb.20.1672746290698; Tue, 03 Jan 2023 03:44:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672746290; cv=none; d=google.com; s=arc-20160816; b=TbSTPkxM9Yx/w77s8oBM266MVKtzedlt77VIpS7asiMPgQat/J/u4YTTS8oF2Dq7nT BRSbL6i9kSH25Hbh15kXClAzA1wEZf0L2Vvd00IEjuXhOMKDO2hHRAnQu3QdRkgd/p3C yzyUf8Xuj9DvIeWccNsYrqF8B3AaXfQp+HCOx11omqOC6L4vkNPRHWSTgmvasM1gYcDY suevoACcZ5jIU7/NgfDOOMq4XkBKyTz84gWRjGWXV2WjR8pOhZnnuzWurTkAoeiK/iHO tEvceafm9v+tapSBKxGFF2FFwMhUb5minfCEX7fZtywgI2AFwMhSqHOh8jgQn6K7zvjW UgvA== 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=2YlUudIZJUEACTqV0rijkYYqpobSY0q+jkmSlPapKpo=; b=XR6ZyewiBkWkyARFbC0atms7KBkx4YfPvAv+8Z5TAq5dGiGDC/ycLVgOo9GTE2SNKU RRPdVSRHE6GQJrHZyyj7riuw5mM/8wtyPmDvTvjVexCgAk3SNNkhOEIDnTGly2aoLOu7 3oTQvJHCAOLM0QkoFRhIJZmFT4PePZ6TSRL/scKhI/TQK5IUxDqv9tcQ5o70Tr6sn4kb pUebCP/N4JqD0iFzjGwGvKtjRK3a98Sus0MO62zfuj/lmXHAK9hQar/ChuD1rx2AjdlC mWPHgisybjOHUX5SFGQLT1R6ZeOC6d8uPbT+5/iV4YmiN1r5CfNR6bXcEpiuHoq20vbJ 2Ndg== 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 jg25-20020a170907971900b007c11f2411e1si28418533ejc.815.2023.01.03.03.44.36; Tue, 03 Jan 2023 03:44:50 -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 S237027AbjACLkA (ORCPT + 61 others); Tue, 3 Jan 2023 06:40:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230437AbjACLj4 (ORCPT ); Tue, 3 Jan 2023 06:39:56 -0500 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E46FB7C; Tue, 3 Jan 2023 03:39:54 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R541e4;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=21;SR=0;TI=SMTPD_---0VYn6lcr_1672745990; Received: from srmbuffer011165236051.sqa.eu95(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VYn6lcr_1672745990) by smtp.aliyun-inc.com; Tue, 03 Jan 2023 19:39:51 +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 v5 1/6] perf vendor events arm64: Add topdown L1 metrics for neoverse-n2 Date: Tue, 3 Jan 2023 19:39:31 +0800 Message-Id: <1672745976-2800146-2-git-send-email-renyu.zj@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1672745976-2800146-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1672745976-2800146-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 Acked-by: Ian Rogers --- .../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