From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74529C04A94 for ; Wed, 16 Aug 2023 09:17:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243229AbjHPJQf (ORCPT ); Wed, 16 Aug 2023 05:16:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243333AbjHPJQZ (ORCPT ); Wed, 16 Aug 2023 05:16:25 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0C91326AE; Wed, 16 Aug 2023 02:16:20 -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 E6EC11FB; Wed, 16 Aug 2023 02:17:00 -0700 (PDT) Received: from [10.57.2.104] (unknown [10.57.2.104]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 87ABE3F64C; Wed, 16 Aug 2023 02:16:16 -0700 (PDT) Message-ID: <02706043-3c81-324d-60a6-ce71a20dfe31@arm.com> Date: Wed, 16 Aug 2023 10:16:15 +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 v5 5/6] perf vendor events arm64: Update stall_slot workaround for N2 r0p3 Content-Language: en-US To: John Garry , linux-perf-users@vger.kernel.org, irogers@google.com, renyu.zj@linux.alibaba.com Cc: Will Deacon , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Suzuki K Poulose , Kan Liang , Kajol Jain , Nick Forrington , Eduard Zingerman , Sohom Datta , Rob Herring , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org References: <20230811144017.491628-1-james.clark@arm.com> <20230811144017.491628-6-james.clark@arm.com> <18140960-e8bd-a331-8322-db7254c43bdf@oracle.com> From: James Clark In-Reply-To: <18140960-e8bd-a331-8322-db7254c43bdf@oracle.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/08/2023 10:40, John Garry wrote: > On 11/08/2023 15:39, James Clark wrote: >> N2 r0p3 doesn't require the workaround [1], so gating on (#slots - 5) no >> longer works because all N2s have 5 slots. Add a new expression builtin >> that allows calling strcmp_cpuid_str() and comparing CPUIDs in metric >> formulas. >> >> In this case, the commented formula looks like this: >> >>    strcmp_cpuid_str(0x410fd493)        # greater than or equal to N2 r0p3 >>    | strcmp_cpuid_str(0x410fd490) ^ 1  # OR NOT any version of N2 >> >> [1]:https://urldefense.com/v3/__https://gitlab.arm.com/telemetry-solution/telemetry-solution/-/blob/main/data/pmu/cpu/neoverse/neoverse-n2-r0p3.json__;!!ACWV5N9M2RV99hQ!MaXDALyhn3HmfLdPUZRKTItKxg73C-qP4aTNAAdFwzjW5cFEBTHtD-VyqBzUTFbXMvABB-daDD01AfI7um_BtA$  Signed-off-by: James Clark >> --- >>   tools/perf/arch/arm64/util/pmu.c               | 18 +----------------- >>   .../arch/arm64/arm/neoverse-n2-v2/metrics.json |  8 ++++---- >>   tools/perf/pmu-events/metric.py                | 17 +++++++++++++++-- >>   tools/perf/util/expr.c                         | 18 ++++++++++++++++++ >>   tools/perf/util/expr.h                         |  1 + >>   tools/perf/util/expr.l                         |  1 + >>   tools/perf/util/expr.y                         |  8 +++++++- >>   tools/perf/util/pmu.c                          | 17 +++++++++++++++++ >>   tools/perf/util/pmu.h                          |  1 + >>   9 files changed, 65 insertions(+), 24 deletions(-) > > This patch looks ok, but I think that it would be better to separate out > the metrics.json change into a separate patch. > Yep I thought about doing that, I can change it in the next version. > Thanks, > John