Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp1297341rdb; Wed, 16 Aug 2023 07:36:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5Z0dX7IhHxzFZ+XSYJHr3rLXwCRlQLpvyMXcvFlvjldGDca+wyNlV2h06rqzvw/xqYXSE X-Received: by 2002:a05:6402:1a53:b0:522:38cb:d8cb with SMTP id bf19-20020a0564021a5300b0052238cbd8cbmr1716236edb.20.1692196580230; Wed, 16 Aug 2023 07:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692196580; cv=none; d=google.com; s=arc-20160816; b=rNoJ8NYCalCKfP0XAoiV9ypv3cNGfDGotqxVS2XWGKnpCcdtZky5KtyTxBnwHxss5Q +b4TFyvPDJK/dTXGn01BYQDm1wCSj8uBddMgZB/Ksb4ZM7L2+s87iHXuroLv33CDb0gb eP9EaxJyITrKCSWb0B1HFpcnBBP7ZOlLAdk5m5i4Pw1iCpzwYuEPFeuVVZwHBkJOBkJt P5X7uaf+tjpJmwi25w+UEWa9o8WVrlH9mV+sFE7Wl1nj48W7UGHuhMtMeeXGRt5zwZna vczVcSLe4yWIlmBsneC1BvTdecLlXk5mNBrmhCcmdDSdSFsM4vW/SQAoGyc2DNTG4o2c +LUw== 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=ue+5fHvrdS2gBr7rYyekKbm7lD1pX80hfdlC+G2reZs=; fh=s6T/eZZO41zqLwSFX/tOOKztAdn9CTXnbg++oScbKfE=; b=zJbj+d50jw/lZqwYeUX9+7v2ZyQonbB800Mj42dW2HnlxjXbw9zxI2PSumm4oddpiL uaEO+hujM9JgS+UdUqaZeugd5WjsWVVbVp5I7nF6XLEjMUNE9duZvIYqq1GU1Vp+61RY hrqdsSTYuPLArMOzad4GyyHs7ziEIplilyRKvofTtloIHyW8JCtcZxebH6tWkaOSe4lA 28bFoCU0RoBumt/VGkxElXnSetGExFMT2nnM3C1rML1EjOk6uTB6oxvB5qToGlNe3Ekr p5HVdSWjvTPSc6nQ/v0VqV5IDDlL4XtA+53WzipHcrkkHIZFGM8bTd7ndwM0IZtzp/7+ R6Yg== 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 j3-20020aa7c0c3000000b0052570b380fdsi3465496edp.420.2023.08.16.07.35.55; Wed, 16 Aug 2023 07:36:20 -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 S243160AbjHPJQe (ORCPT + 99 others); Wed, 16 Aug 2023 05:16:34 -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 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED 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 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