From patchwork Fri Jan 13 09:22:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 43112 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp172166wrt; Fri, 13 Jan 2023 01:32:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXu0xq8sifbnpfjC9bEc7CHP+nwKyv49wKU4nZM3Ia8TSDR65NeclmmewpQrKStH2B4/yOwt X-Received: by 2002:a17:902:7249:b0:194:6d4b:e1e2 with SMTP id c9-20020a170902724900b001946d4be1e2mr2104150pll.0.1673602336224; Fri, 13 Jan 2023 01:32:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673602336; cv=none; d=google.com; s=arc-20160816; b=aAT/obK4TQPnN0g57dkIRtvCimLTIN+5dI2x4oJ3vce1xWfEUxFhNjFvMUOfBlK4b7 2R5FXjBm6ByzJGE6JVuDIabiWH8qPy1NYgV1E9gP7OvyxHirKmqYT4kfn9pHcj/XJGlJ 5iBCunsFUZHjfe8QQeiJwQ7FsknrEmrGNryu1XDYJP4oAY86k2zhtxGELnOo0jXdCnsa 0pImpamX4dP7AVG516nkbyg7Z7Y0DiI10mCfAm1zoCT6qWvC9fMSEmqshYTPk7SbZTQ1 k+c2nSPODM1rYTbHOkoHkMT629trftIKy/YcKCUcNlg8mL1wFTAdk6z+CyYtMBoAH+EM OF5A== 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=I9xh8G5yzBEgDqtAandSbL5gLCBKy0p1Mz08TiPxD8g=; b=GT5l9EgdqmVo7foEr7Tvvtg6Car37zHTH3/0l+q2BB3BNmKZThGAcpo/URnfLAkREE 9kQqmWN7k7De9si6pkex3ioyQc3IN/BDfAp6OVUwhulzsyjQ75X7XFClV/Mi8p7fHDnq tsm1ztPKZVJbgoVMlXAJCd/bPBZJz2oeNucdaPoDPlqf6L7vfSYqneVaG7q29qP56ez3 QTljQ59+oNj1T6m2ww5Ht5FEiUZwGMiC9oUYLjoJXrhalCHc4kLw+eimj34gG6Gd5ANy J9poBDt/uFNinpV6+YBBN01Wj9iDJ3Q1b/lXFpVuBfImaAZYMFLJMbUxd1hWCujiKaPH jqgQ== 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 n64-20020a632743000000b004a7eeb8f937si11302530pgn.784.2023.01.13.01.32.03; Fri, 13 Jan 2023 01:32:16 -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 S234842AbjAMJ3H (ORCPT + 99 others); Fri, 13 Jan 2023 04:29:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232417AbjAMJ10 (ORCPT ); Fri, 13 Jan 2023 04:27:26 -0500 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07912431B7; Fri, 13 Jan 2023 01:22:46 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R511e4;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=21;SR=0;TI=SMTPD_---0VZUDRVM_1673601761; Received: from srmbuffer011165236051.sqa.eu95(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VZUDRVM_1673601761) by smtp.aliyun-inc.com; Fri, 13 Jan 2023 17:22: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 v7 8/9] perf vendor events arm64: Add PE utilization metrics for neoverse-n2-v2 Date: Fri, 13 Jan 2023 17:22:19 +0800 Message-Id: <1673601740-122788-9-git-send-email-renyu.zj@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1673601740-122788-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1673601740-122788-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,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?1754899243260796505?= X-GMAIL-MSGID: =?utf-8?q?1754899243260796505?= Add PE utilization related metrics. In cpu_utilization metric, if it is neoverse-n2 which slots are 5, the real stall_slot need to subtract the cpu_cycles according to the neoverse-n2 errata [0]. [0] https://documentation-service.arm.com/static/636a66a64e6cf12278ad89cb?token= Signed-off-by: Jing Zhang --- .../arch/arm64/arm/neoverse-n2-v2/metrics.json | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) 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 index afcdb17..3d6ac0c 100644 --- 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 @@ -160,5 +160,51 @@ "MetricGroup": "Branch", "MetricName": "branch_miss_pred_rate", "ScaleUnit": "100%" + }, + { + "MetricExpr": "instructions / CPU_CYCLES", + "BriefDescription": "The average number of instructions executed for each cycle.", + "MetricGroup": "PEutilization", + "MetricName": "ipc" + }, + { + "MetricExpr": "ipc / 5", + "BriefDescription": "IPC percentage of peak. The peak of IPC is 5.", + "MetricGroup": "PEutilization", + "MetricName": "ipc_rate", + "ScaleUnit": "100%" + }, + { + "MetricExpr": "INST_RETIRED / CPU_CYCLES", + "BriefDescription": "Architecturally executed Instructions Per Cycle (IPC)", + "MetricGroup": "PEutilization", + "MetricName": "retired_ipc" + }, + { + "MetricExpr": "INST_SPEC / CPU_CYCLES", + "BriefDescription": "Speculatively executed Instructions Per Cycle (IPC)", + "MetricGroup": "PEutilization", + "MetricName": "spec_ipc" + }, + { + "MetricExpr": "OP_RETIRED / OP_SPEC", + "BriefDescription": "Of all the micro-operations issued, what percentage are retired(committed)", + "MetricGroup": "PEutilization", + "MetricName": "retired_rate", + "ScaleUnit": "100%" + }, + { + "MetricExpr": "1 - OP_RETIRED / OP_SPEC", + "BriefDescription": "Of all the micro-operations issued, what percentage are not retired(committed)", + "MetricGroup": "PEutilization", + "MetricName": "wasted_rate", + "ScaleUnit": "100%" + }, + { + "MetricExpr": "OP_RETIRED / OP_SPEC * (1 - (STALL_SLOT if (#slots - 5) else (STALL_SLOT - CPU_CYCLES)) / (#slots * CPU_CYCLES))", + "BriefDescription": "The truly effective ratio of micro-operations executed by the CPU, which means that misprediction and stall are not included", + "MetricGroup": "PEutilization", + "MetricName": "cpu_utilization", + "ScaleUnit": "100%" } ]