Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4245907rdb; Mon, 11 Dec 2023 13:13:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoLk2YFOyXaywJ6JbCJPwBexgg9hmvNi3x9m/1E8BNW46URlsJHD2KnjO3EnOvBkVv9dlE X-Received: by 2002:a17:902:7ec1:b0:1d0:6297:150a with SMTP id p1-20020a1709027ec100b001d06297150amr4468426plb.47.1702329209557; Mon, 11 Dec 2023 13:13:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702329209; cv=none; d=google.com; s=arc-20160816; b=CX3av9X5VEv45Fl9dAlw/3D1+wvuBxFlm2vCe4Kh2tDLOhCoSGhCMzvn/YNNg+T2Qy HVTP+9ms4MTFVFVYLmKonbRQLx02+Q896Kq7xqXraP8J2fuwA31eTbyUk6NfxfV/l32e a/GYYEO+/dPwVDXr1Yww6Bfk9yD4AvxM2uoO5FbaV+LArqeUYb5kj6uYLgimMNcY8EJt Zfm3ZZ0L7TN7wZ/C3ltPWltH0jIlNBbZL1E5VzDIhJYHnnqvu5of40fX0+wbJ5mtHxzd t1ym11ytxE6Px4W4qjRans6xV7DU5Rd/FiQrT1+H7lwl3vrxRl71QmH4ubO+C7eoBRVJ YJvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dfZAOpKtPEkVw1NAGwe5mjRc2OYqLbY9kWw9Qo1WmzU=; fh=Vrx/vmMqmnlY7Vxs5gXVs1187ma/ziuk7ZEejz7YPR4=; b=DVZ9acdVH34AGQK+4+VWcQAtJCWe7dFr558Tay/gwM0iP9SM6Kr43MLZ+2pxDyYHFl Df270e9P6TAf+NzVghnvRp+3eEh8oZjVXOgW5YPFfWRwTD0ophkJWptkhYaspkYBFOAQ c6hjRmLMx3pxP8edpHHN0M3Nb9B/dG/DjA91zqERvONb3qZeQpwVrxQSLbBDLCh9KQKW FajdC3O1ywgir6uRa4ShqinQAiAXj6zwFEAhZt18oX/zyLMgCaRprKp7bUvifH+wzY8x p74hId6yvenXGecMcZpRoBL2U9BrsAO+NNjbiL9QIhGVgMggEbFGYP2iq9yRb5C8Cyzl V9xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V0gyCbUm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id z16-20020a170903019000b001cc2853bfe6si6875391plg.192.2023.12.11.13.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 13:13:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V0gyCbUm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id F1AD7805003E; Mon, 11 Dec 2023 13:13:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344826AbjLKVNI (ORCPT + 99 others); Mon, 11 Dec 2023 16:13:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229663AbjLKVNH (ORCPT ); Mon, 11 Dec 2023 16:13:07 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAE3CCF for ; Mon, 11 Dec 2023 13:13:13 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 566BDC433C8; Mon, 11 Dec 2023 21:13:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702329193; bh=cKsZJJjh0zgXBpBkaqIeqMSNNR6XLiEhaKhcou5UHqw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V0gyCbUmW0AGexABCR8rMe7FoBLbN90HmT64c5DOHxC9vI/6rIE56Tm1jDi+m8xIX iGWuf3dayc3CQjuTtJJwpqyiHM5CPzVdnXc+ESEqecf6dD5jjYWxkLlr+CAhOZ+Rhk RK8vyqnmURqT53wDP0Csa4GxOGHBvPDd936X+jGUlEWvAvozfPRVeXej3mHu0Rh/Gu SSLIQGtRChXQ4utFlw2Vw39EUbyu6ib+HCq9+HuKQGR964nvJ1cqGDM6E98CvammSd 1CIh76Q/z1MTB7JduV41NVHj1r0m0NhuD6x5ZGL3dEgx64YFzi7TDjIIrH9UX7nUbJ G8jjgDi/cG1tg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id CF8F4403EF; Mon, 11 Dec 2023 18:13:10 -0300 (-03) Date: Mon, 11 Dec 2023 18:13:10 -0300 From: Arnaldo Carvalho de Melo To: kan.liang@linux.intel.com Cc: irogers@google.com, namhyung@kernel.org, mark.rutland@arm.com, maz@kernel.org, marcan@marcan.st, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH] perf top: Use evsel's cpus to replace user_requested_cpus Message-ID: References: <20231208210855.407580-1-kan.liang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231208210855.407580-1-kan.liang@linux.intel.com> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 11 Dec 2023 13:13:27 -0800 (PST) Em Fri, Dec 08, 2023 at 01:08:55PM -0800, kan.liang@linux.intel.com escreveu: > From: Kan Liang > > perf top errors out on a hybrid machine > $perf top > > Error: > The cycles:P event is not supported. > > The user_requested_cpus may contain CPUs that are invalid for a hybrid > PMU. It causes perf_event_open to fail. ? All perf top expects is that the "cycles", the most basic one, be collected, on all CPUs in the system. > The commit ef91871c960e ("perf evlist: Propagate user CPU maps > intersecting core PMU maps") already intersect the requested CPU map > with the CPU map of the PMU. Use the evsel's cpus to replace > user_requested_cpus. > The evlist's threads is also propagated to evsel's threads in > __perf_evlist__propagate_maps(). Replace it as well. Thanks, but please try to add more detail to the fix so as to help others to consider looking at the patch. - Arnaldo > Reported-by: Arnaldo Carvalho de Melo > Closes: https://lore.kernel.org/linux-perf-users/ZXNnDrGKXbEELMXV@kernel.org/ > Signed-off-by: Kan Liang > --- > tools/perf/builtin-top.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c > index ea8c7eca5eee..cce9350177e2 100644 > --- a/tools/perf/builtin-top.c > +++ b/tools/perf/builtin-top.c > @@ -1027,8 +1027,8 @@ static int perf_top__start_counters(struct perf_top *top) > > evlist__for_each_entry(evlist, counter) { > try_again: > - if (evsel__open(counter, top->evlist->core.user_requested_cpus, > - top->evlist->core.threads) < 0) { > + if (evsel__open(counter, counter->core.cpus, > + counter->core.threads) < 0) { > > /* > * Specially handle overwrite fall back. > -- > 2.35.1 > -- - Arnaldo