Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3091339rdb; Tue, 29 Aug 2023 05:20:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAfFMwEspZqxuy1N5rLuVSLaBvRSyjI3SbvMU+yT6R3h+N++SnnGW1aimknIYm1EixuKxQ X-Received: by 2002:a17:903:447:b0:1b8:971c:b7b7 with SMTP id iw7-20020a170903044700b001b8971cb7b7mr27550239plb.56.1693311619215; Tue, 29 Aug 2023 05:20:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693311619; cv=none; d=google.com; s=arc-20160816; b=aWTuudnglYih9YmkPuITELdDO4BJ+JKdAbuY7Ffuf3Qu1tA4BkddjZ2scCVgUmDpfn PxS9IWFzkEhYh4HQ7QK3SdHfiihwucbNT4axswPxQFoFKRYkNcxHxuGULBvI4SYy4/Dn 5qU35MfX9V2S5T8/M+Jk9mB5OR+O689no0eOTkKQcz0AM112IGU5fp3rDU0Y8J5kpxrk y1x+TPtDT1PYGcUgQasCNexNOlThUpljYk5HOeS2b0X4u0vC73+f+5nm/svJ8WepYcFo 33ULCyIds+rh/Q9aGTs262ogvpteIJ5afh5BnXtdtKLBlJnJ7pwfBRlaUC5K8aQa8R1H 3UUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=RTeCca0JoN7U96E7CJpgcEBC5vBTDShDl00UJcEiHQ8=; fh=xzsKvlJZ/NxLVlP8uXTlHhnVg7DTPfxqT2Mn2PX/6mc=; b=LdUDRo+Z8BrmsZjrjnzJNbCuy5M82i/v9+Ow3dfV05qLkn9UglA/s2LegPJmCsHNZ1 Xv2Asxb4HTT1irhMKWN34Sl3GiJyvc1oNV/OW2ZCtpXoTehA/4xysZvUArnArKzp6N66 trODQZEWnPX8J6ZOunk17w/aznrRfc09E5Ao/n0uXa63CLvf93RIXJx9gKRKrrk+6HA5 sfxjUJPKPQqxNoMN4JjPKXn4gikyRDqBxxnRGX0z+eFdvVgXG8bURYdo/4BOgvIq5IIx n0y9URSeruNMdGoGWl0XsNcmrJUK1g5xwrveNZDD7DDXZZCapfLGlpThUXPrZpiqBRW9 JCFw== 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=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x1-20020a170902a38100b001bda1941a8esi1219574pla.582.2023.08.29.05.20.00; Tue, 29 Aug 2023 05:20:19 -0700 (PDT) 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=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232892AbjH2Kqy (ORCPT + 99 others); Tue, 29 Aug 2023 06:46:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232025AbjH2Kq0 (ORCPT ); Tue, 29 Aug 2023 06:46:26 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 879481AA; Tue, 29 Aug 2023 03:46:23 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A246D2F4; Tue, 29 Aug 2023 03:47:02 -0700 (PDT) Received: from [192.168.1.3] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 154D03F738; Tue, 29 Aug 2023 03:46:20 -0700 (PDT) Message-ID: <1299e1ff-2543-6ee5-dc32-bc098bd6bfe1@arm.com> Date: Tue, 29 Aug 2023 11:46:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v2] perf vendor events arm64: Add AmpereOne metrics Content-Language: en-US To: Ilkka Koskinen , John Garry , Ian Rogers , Arnaldo Carvalho de Melo Cc: Will Deacon , Mike Leach , Leo Yan , Peter Zijlstra , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Ingo Molnar , Dave Kleikamp , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org References: <20230826192352.3043220-1-ilkka@os.amperecomputing.com> From: James Clark In-Reply-To: <20230826192352.3043220-1-ilkka@os.amperecomputing.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 On 26/08/2023 20:23, Ilkka Koskinen wrote: > This patch adds AmpereOne metrics. The metrics also work around > the issue related to some of the events. > > Signed-off-by: Ilkka Koskinen > --- > .../arch/arm64/ampere/ampereone/metrics.json | 396 ++++++++++++++++++ > 1 file changed, 396 insertions(+) > create mode 100644 tools/perf/pmu-events/arch/arm64/ampere/ampereone/metrics.json > > diff --git a/tools/perf/pmu-events/arch/arm64/ampere/ampereone/metrics.json b/tools/perf/pmu-events/arch/arm64/ampere/ampereone/metrics.json > new file mode 100644 > index 000000000000..b623d8a9e3dc > --- /dev/null > +++ b/tools/perf/pmu-events/arch/arm64/ampere/ampereone/metrics.json > @@ -0,0 +1,396 @@ [...] > + { > + "MetricExpr": "STALL_SLOT_BACKEND / (CPU_CYCLES * 4)", > + "BriefDescription": "Fraction of slots backend bound", > + "MetricGroup": "Default;TopDownL1", > + "MetricName": "backend_bound", > + "ScaleUnit": "100%" > + }, Hi Ilkaa, For these topdown metrics, as long as they are the same as the standard one you can remove anything that is duplicated. This might make it easier to make changes across all the topdown metrics in the future and have consistent descriptions across CPUs. For example this backend_bound one could look like this: { "ArchStdEvent": "backend_bound", } This assumes that you have the slots sysfs file available, otherwise you could leave only the formula in. We also decided to make the units for the topdown metrics "percent of slots" as we thought more specificity in the units was clearer. Thanks James > + { > + "MetricExpr": "1 - (retired_fraction + slots_lost_misspeculation_fraction + backend_bound)", > + "BriefDescription": "Fraction of slots frontend bound", > + "MetricGroup": "Default;TopDownL1", > + "MetricName": "frontend_bound", > + "ScaleUnit": "100%" > + }, > + { > + "MetricExpr": "(OP_SPEC - OP_RETIRED) / (CPU_CYCLES * 4)", > + "BriefDescription": "Fraction of slots lost due to misspeculation", > + "MetricGroup": "Default;TopDownL1", > + "MetricName": "slots_lost_misspeculation_fraction", > + "ScaleUnit": "100%" > + }, > + { > + "MetricExpr": "OP_RETIRED / (CPU_CYCLES * 4)", > + "BriefDescription": "Fraction of slots retiring, useful work", > + "MetricGroup": "Default;TopDownL1", > + "MetricName": "retired_fraction", > + "ScaleUnit": "100%" > + }, > + {