Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2497582rwl; Fri, 6 Jan 2023 07:14:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXtJSJhiu0rymzE2Hw8qg5e62gs4egIePsq/M4WEliJzTVzgbQCYG5cPw1navEn5uvYtlRV7 X-Received: by 2002:a17:907:c386:b0:81e:8988:71ac with SMTP id tm6-20020a170907c38600b0081e898871acmr50395307ejc.24.1673018078621; Fri, 06 Jan 2023 07:14:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673018078; cv=none; d=google.com; s=arc-20160816; b=hpu0mK28ub8LGU0GQAx3xYeGtrAGy3opMrWqcRMDSVfuua9nJ6CFo+YnMAZlAnPTfc zLcMQJMvTQu3lKY9WkvnAwGT/Di14y44p6nRiCU1btDkL32p0vIYh/jmgXDW1OuwHdX7 MktIFcdgLGNIKJLuV6x1V4HehfTFXPkIJtdW2bIOxYqpE65BRSHWfXeguVoeMjXzl2ii HxviWxU4FAES5epZoz1pveSmwuBCiT3Wz0WCum8HlFERHzExWkPjHflOSIiYeBl1+C9a HxJqork4+/aS2B9t3QAkDm3Cl2gQ+uCBULoZV1aVWy7CLE9K8XkYNRSysll45uaNweMt MjKQ== 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=X5jRvAK7VbpQRqVbW/ks3uht0qIUu+P6LvgW0plCnfA=; b=zcGi43kUq1OfGJs3xeQCI4MmG5XINnrBPcOGHr7Zfv3OQ/fXXTNM4wm8tTHZL8/Y6q fV3z8WAdyhX2aaj83ZaKy52GYrp2zmJ4oWM6zClKnJ6wTQUzFI5KPDshIw0GbnZWqDCT WSmOZy8sIDAIrWUVDf3pZR1SoZWU4fVjVxbXsG6l/glGJakzkGvdDB5Ef7w5yi2OQyGM Gz8bz1wEB74/F2K7hDhA5bXLrD7qKE01p8+hSR+Z5rmX6Tb/vdeRae+GmPNGbl5oTBv2 dLMKX1kOh0BL/ZinnY64+hfXP9eUR7Maf5v2qMuhtT2ytrOF1ZfVRKiTkoey1oMJdITS HhnA== 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 r10-20020a05640251ca00b0048db0687dbasi2068184edd.262.2023.01.06.07.14.23; Fri, 06 Jan 2023 07:14:38 -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 S234811AbjAFPGI (ORCPT + 56 others); Fri, 6 Jan 2023 10:06:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234982AbjAFPFt (ORCPT ); Fri, 6 Jan 2023 10:05:49 -0500 Received: from out30-44.freemail.mail.aliyun.com (out30-44.freemail.mail.aliyun.com [115.124.30.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 214F35E0BE; Fri, 6 Jan 2023 07:05:46 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=renyu.zj@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0VZ-UXmq_1673017540; Received: from srmbuffer011165236051.sqa.eu95(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VZ-UXmq_1673017540) by smtp.aliyun-inc.com; Fri, 06 Jan 2023 23:05:41 +0800 From: Jing Zhang To: John Garry , Ian Rogers Cc: 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 , Jing Zhang Subject: [PATCH v6 2/7] perf vendor events arm64: Add topdown L1 metrics for neoverse-n2-v2 Date: Fri, 6 Jan 2023 23:05:24 +0800 Message-Id: <1673017529-1429208-3-git-send-email-renyu.zj@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1673017529-1429208-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1673017529-1429208-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,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 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 overwrite the "MetricExpr" for neoverse-n2. Reference from ARM neoverse-n2 errata notice [0], D117. Since neoverse-n2/neoverse-v2 does not yet support topdown L2, metric groups 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 [1][2]. [0] https://documentation-service.arm.com/static/636a66a64e6cf12278ad89cb?token= [1] https://documentation-service.arm.com/static/628f8fa3dfaf015c2b76eae8?token= [2] https://documentation-service.arm.com/static/62cfe21e31ea212bb6627393?token= Signed-off-by: Jing Zhang Acked-by: Ian Rogers --- .../arch/arm64/arm/neoverse-n2-v2/metrics.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/arm/neoverse-n2-v2/metrics.json diff --git a/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2-v2/metrics.json b/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2-v2/metrics.json new file mode 100644 index 0000000..4e7417f --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/arm/neoverse-n2-v2/metrics.json @@ -0,0 +1,17 @@ +[ + { + "ArchStdEvent": "FRONTEND_BOUND", + "MetricExpr": "((stall_slot_frontend) if (#slots - 5) else (stall_slot_frontend - cpu_cycles)) / (#slots * cpu_cycles)" + }, + { + "ArchStdEvent": "BAD_SPECULATION", + "MetricExpr": "(1 - op_retired / op_spec) * (1 - (stall_slot if (#slots - 5) else (stall_slot - cpu_cycles)) / (#slots * cpu_cycles))" + }, + { + "ArchStdEvent": "RETIRING", + "MetricExpr": "(op_retired / op_spec) * (1 - (stall_slot if (#slots - 5) else (stall_slot - cpu_cycles)) / (#slots * cpu_cycles))" + }, + { + "ArchStdEvent": "BACKEND_BOUND" + } +] -- 1.8.3.1