Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5783961rwb; Wed, 9 Aug 2023 09:04:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfIrKFI5J2loLlLx9ON1BTvJImNsRCwBR0Z97svdHvWl8LZZzk72rCy/HHO1PU8rnKQzyR X-Received: by 2002:a05:6402:2d6:b0:522:b876:9ef5 with SMTP id b22-20020a05640202d600b00522b8769ef5mr3722962edx.8.1691597053469; Wed, 09 Aug 2023 09:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691597053; cv=none; d=google.com; s=arc-20160816; b=Hqu6tJbbXacHzM3aj4SX9MyRuTSDsBn7J6BTocix0hNGoQTWBs8vXDt93BVuwo6Qjn u4PpBB3ZR4o6J2S4Ka88zyYfuI5WhRlV9UCTpSGv76+bEgdWCccxkahYQml5obBljyBF P+jDAvwK0bpn/MGNAnHAzXT4wiyCli5AHb9AcZU7RWJJFoAbVDtt/2COc+kvgdz4QlLN pYs+npNniBHbLQIl3g6ALcsL1QWoEpM3eyhp7hrYlhhYJoHBqJsZfIhKiWffzR329krX dL6sE4SYs05AoE+l6U4t0iXPcCV7smy8Nu2INyO1sUffMt3eHctwTCX+zj9YMV4hng9i AQTA== 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=1qKnwxE5mSSTbYgNTINzXyJBsM9MopwUShip7oVBceY=; fh=gonZXy07QZxE6PHHczuhn3njU2XO7EJzvPNJGhhVB/Y=; b=BkA9UCu8AyPQSMdC4kmRkDi9AGQGcqBhv/Z4mIeTmIOPRsCbAMysJKJS/nMQkImOU5 7DdQM9rygFTjaIcVldiLthYTgIHTMhV1xQ6drBUi7Uue8jmuk+Izw8MTa/sDEyQfdvNa FXeGnMVf75oSMfc7WIAg/IDkLEgAJ70ncEzPOz6w8GP2b2KCOowur3L/ji9hP5mPv3PQ 9QvAYzTxORB8G7gIK336B8i28f6SgjgjVhNOM+AfxGKdVQ/ikJ6yelwGv3TvGxhpaKNH FsVtNbjZlx9fxyT0S5bNcY7jGRHB1DDI39G0myTJUzKia9iVycOoMpckYkS/j9sCOy2V lS8w== 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 n22-20020a056402515600b005233d7e345esi3862997edd.289.2023.08.09.09.03.33; Wed, 09 Aug 2023 09:04:13 -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 S233512AbjHIPOv (ORCPT + 99 others); Wed, 9 Aug 2023 11:14:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231211AbjHIPOu (ORCPT ); Wed, 9 Aug 2023 11:14:50 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5D124D1; Wed, 9 Aug 2023 08:14:49 -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 4BAD9D75; Wed, 9 Aug 2023 08:15:31 -0700 (PDT) Received: from [10.57.1.30] (unknown [10.57.1.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 893FD3F59C; Wed, 9 Aug 2023 08:14:45 -0700 (PDT) Message-ID: <88350646-50c9-b7a6-9fe6-47b6b0a31f49@arm.com> Date: Wed, 9 Aug 2023 16:14:44 +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 v4 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 , Kajol Jain , Kan Liang , Nick Forrington , Eduard Zingerman , Rob Herring , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org References: <20230807142138.288713-1-james.clark@arm.com> <20230807142138.288713-6-james.clark@arm.com> <6b3d8f28-9a38-d544-e396-706022f2e5f5@oracle.com> <80e089f6-12ab-b33c-d299-3f762e3a8d4f@oracle.com> From: James Clark In-Reply-To: <80e089f6-12ab-b33c-d299-3f762e3a8d4f@oracle.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,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 09/08/2023 14:54, John Garry wrote: > On 09/08/2023 14:06, James Clark wrote: >>> "MetricExpr": "(op_retired / op_spec) * (1 - (stall_slot if >>> (cpuid_less_than(410fd493)) else (stall_slot - cpu_cycles)) / (#slots * >>> cpu_cycles))" >>> >>> I'm currently figuring out how cpuid_less_than() would be implemented >>> (I'm no great python wrangler), but it would be along the lines of what >>> Ian added for "has_event" in >>> https://urldefense.com/v3/__https://lore.kernel.org/linux-perf-users/20230623151016.4193660-1-irogers@google.com/__;!!ACWV5N9M2RV99hQ!PlOppEWtIj9jDW2Zlon0zRZVpzPTzPvm5Ho5NnRIN0vD78iFcEzMEAtsrW_MrRPiW84XhWpbhc3seQcmLu-BfQ$  >>> Thanks, >>> John >> Yeah it looks like it could be done that way. Also, the way I added it, >> it doesn't have access to the PMU type, it just does a generic >> pmu__find_core_pmu() so won't work very well for heterogeneous systems. > > I haven't been keeping a close eye on the hybrid PMU support, but AFAIK > metrics for hybrid arm64 system, i.e. bL, aren't supported - maybe that > has changed. The gating for bL support was in pmu__find_core_pmu() > returning NULL for a hybrid system. > Yes we're not currently publishing any metrics for hybrid systems, so in this case for N2 and V2 it's not needed. But it would be good to try to future proof it if possible. Although I don't know how the metrics currently react on hybrid systems, it's also something I have to take a look at. >> >> If we're going to do a deeper modification of the expression parser like >> with has_event() it might be possible to pass in the actual CPU ID that >> the metric is running on which would be better. >> >> I'll have a look. > > Thanks. I was playing with this yesterday, but I was making slow > progress. I was essentially following the has_event example, but the > argument type causes an issue, in that has_event expected an event name, > while we want to pass a hex string. > > If you could check this then that would be great. > > Thanks, > John >