Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4401283rwb; Mon, 16 Jan 2023 23:47:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXtXv3VxJzbtmJL4fpl8ed7AJU3xSXhYStwnNhaansP9TCYnDypMKIjHruKRUXmvSmf00z96 X-Received: by 2002:a05:6a00:278d:b0:56b:f51d:820a with SMTP id bd13-20020a056a00278d00b0056bf51d820amr2450345pfb.7.1673941643126; Mon, 16 Jan 2023 23:47:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673941643; cv=none; d=google.com; s=arc-20160816; b=he/jsoj4910IptjxmLnQhaURoG3YTuFtVPOEy6wB2I5QGuUKYGW3aXlO2MK4Mp+an6 pIuWBe9jXov3H7YpBB7JhXR1WGMho7YStL+4OMuglQBytkl4bQe3tJCTn8dT3UyRlkS0 rO3E8vDsbMmaNduCFQjHO3XZjuRq65CbkG4q+aq18VULSW8uduLeiwOruwKXbxCBOXOX jRnerkaTU3pkHbBrzTc1g9TGAW9AfjmTwG+OR/n4LzGgH6rJGMQe446sZf9wgE7UIRFy eVIexQEL86XbA8TNBCvQn0v7epBmW5KgiipmkmyGu2lUjRHi+aCGxEIIGY1xgaGNIUZE /26A== 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=7Zl1XGGMtvtceYYbi/k7uvrO5SmkJdh2tM9l6b3BJ+0=; b=Y7qE5H6Pg764v8VW/mXMYGgpjA6x/SWtyfOpeyDbdUtOh5U5gGYIYMBzyn5AhbnQIQ WVGHpj7zusCmn2Lzn592PE5RAr5lkm2WxvSnFC9mUaijmW37H4IlymTzrtA9YemYB9GX +oVlwjL6v/FiNIVIw6L6k6ZY/Lq+otdPiK5JXqS0vzRWb+l6v4IFx++yjniBr05qHOdh rB0ciQCjtZ0OqYcSE7c0wtwJ++Jzhf//EO9UvKAq1Bb3P002AMvhzQKuEox62yOsLO0z FVGitkN8yu4hNxitVGHT4F4UNJsjKHIK7WpHot9MUSzHU9cix+3nyOPuKHdpi1b044wJ auqQ== 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 cp8-20020a056a00348800b0056771c032f4si29630504pfb.28.2023.01.16.23.47.17; Mon, 16 Jan 2023 23:47: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 S235783AbjAQHaf (ORCPT + 49 others); Tue, 17 Jan 2023 02:30:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235841AbjAQHaE (ORCPT ); Tue, 17 Jan 2023 02:30:04 -0500 Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6E3122DC1; Mon, 16 Jan 2023 23:30:01 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R351e4;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_---0VZm6e5a_1673940596; Received: from srmbuffer011165236051.sqa.eu95(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VZm6e5a_1673940596) by smtp.aliyun-inc.com; Tue, 17 Jan 2023 15:29:56 +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 v8 8/9] perf vendor events arm64: Add PE utilization metrics for neoverse-n2-v2 Date: Tue, 17 Jan 2023 15:29:32 +0800 Message-Id: <1673940573-90503-9-git-send-email-renyu.zj@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1673940573-90503-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1673940573-90503-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 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 Reviewed-by: John Garry Acked-by: Ian Rogers --- .../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%" } ] -- 1.8.3.1