Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4317193rdb; Mon, 11 Dec 2023 16:03:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFf+qHRLuRbApJbROOKzUShnHaT1s2v69up0H++Gdl9MVhIitO1dxY33qyZkcygJlxuuF2O X-Received: by 2002:a17:902:a9c4:b0:1cf:e19e:2505 with SMTP id b4-20020a170902a9c400b001cfe19e2505mr2573905plr.61.1702339385017; Mon, 11 Dec 2023 16:03:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702339385; cv=none; d=google.com; s=arc-20160816; b=U0yuBIz862tvbqVYG+VvmDUhQHqCyVhFu23E6ORrtZysuILWi3Q7e92fp1d1NCAcnG 8waKRxnXKw3/scCBqjPWcIn6qpnTb1Om3YE8Sa516vTT1LRO8kgo9Q16p3GXiDBRMInk M9no23uI3DcjwmwNHHpi8sznvmSxs1uGAYbZxtazrl4w0gdf4KjcNHepBhjJZtmATQ1i SLzf5XC4Uv+Bcv3Yxgq8CrKGXzu/29aR01g8nLQczxLLKPMvAXV7UglOw1wKjjbUDOvA 9TgpTy2YkAVhnGOWppWW9ESEV6qSg/D8jUpkCGXuIZqfrfxXb/STEQ59gbRxj9QMXOJA gfWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=TCwQNpqZrXvaI88937wdWL6JeEYRSB0xftnhNA8w9QY=; fh=9LBCitPwfG5y88nHvDLdiBbMUQd7MlH9AEwhWwmKvJk=; b=qMk7+p+SDpiKYcQcWQg8Q+J7vy85vktjmewoQZY2qfzt6BnIGZ4mgCone9D3Qh7bzL 8mKf78+ABBd16hIta/85zOvGw8rFdSFpDurGNpYPDOQ2B6Jwo2dsZTq7OIhzKaD9oMMo WuzHagOQIiYTZ58bO5acCrJ1tYC06eitDhkI6E5yRc8KGKaTWJlRx2RgoLAQiZ5rtg9N RyZzlKZlP9mXxroxD/xSCfDF0Opupd9drSjv8NeDE2s2j0kMyycW9APDZstYjjNwumtn ve7zoyiUlMWCzyFJku/6DJKZ7YFHmCtNCl6aZKPtK5AcQkKeFyy2WqagLlEzphLYojOe 1ZGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=rppBubB+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id m6-20020a170902db0600b001cfa204ce2asi6940915plx.328.2023.12.11.16.03.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 16:03:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=rppBubB+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B3270809B741; Mon, 11 Dec 2023 16:02:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345163AbjLLACp (ORCPT + 99 others); Mon, 11 Dec 2023 19:02:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbjLLACo (ORCPT ); Mon, 11 Dec 2023 19:02:44 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E82889B for ; Mon, 11 Dec 2023 16:02:50 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-50bf09be81bso692e87.1 for ; Mon, 11 Dec 2023 16:02:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702339369; x=1702944169; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TCwQNpqZrXvaI88937wdWL6JeEYRSB0xftnhNA8w9QY=; b=rppBubB+vlXIEBJ/2FSZ6guPqgsw/qF/wohWUFDkAFMDRVvam5Y5CDyY9n6H6LaC+K gln4lgDa5S1vPDVtb+FBTGK1xEfceR6v2TkgEOtxFmsRvz+bjQfOTvXzdfe/s/3fJqVt nBTjuX4Q03GD8gimwR3flcox1Ckm2Eiqdh7RBtchmFlRZTizHprOrf/VmXWCbxzAgpXj y0skzmS4Hh2NhQm5DuYS7FtFDqwRCIcfiEoRNgjvKvdqgXKh8CqyqieZdyex8m4zF8Yr F7jv0B6WzJIduZU7smQbz56gxFGD/XbcjSTz2hTrdO+X7ceWTzBTO02ZASSgwv8NGJxh rKSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702339369; x=1702944169; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TCwQNpqZrXvaI88937wdWL6JeEYRSB0xftnhNA8w9QY=; b=qCSYQbYQ8411kmA1LfAjNksMxqi5XYNLm4zLPHF4ikHxPF7ZskkApHSgjYvRneArOg S2eQ3GePOjzYC3Yyjmjjc/r6XB5TJA9MNNnMtq/7GDk20PNkNvZH9o55iOjKRbDNDEgq cFKSn6ly30KdD9ZyLObnT/2rFGrpVtopgIyCqdrZf/yeljodHbutpTU96uRk/T6zNCMT cfJeaI2qOulHb2o5A7jz1Bol8YbnHx0k3PBZm9jLcDnFhRiQdKNc87TIclSKe5IqAEaa oQCROH541iUNn8UGNUCq1FavgAfXpk1b9ZTRJUzCt8M9CgL0FvtY3h8GRsAt004WgkYF X+tA== X-Gm-Message-State: AOJu0YzAUobLU4lRYjz4Y4ECLY4wQupALoLSp0e43JbSymP58VkjfbVv 1rdcMktxqvZ6Z+1hqQFUAjOIc2UN94hcD1wkjgeQDL4H/cTn23vXRNYBy4ku/Fc= X-Received: by 2002:a05:6512:539:b0:50c:e19:b658 with SMTP id o25-20020a056512053900b0050c0e19b658mr220203lfc.1.1702339368975; Mon, 11 Dec 2023 16:02:48 -0800 (PST) MIME-Version: 1.0 References: <20231208210855.407580-1-kan.liang@linux.intel.com> In-Reply-To: <20231208210855.407580-1-kan.liang@linux.intel.com> From: Ian Rogers Date: Mon, 11 Dec 2023 16:02:37 -0800 Message-ID: Subject: Re: [PATCH] perf top: Use evsel's cpus to replace user_requested_cpus To: kan.liang@linux.intel.com Cc: acme@kernel.org, namhyung@kernel.org, mark.rutland@arm.com, maz@kernel.org, marcan@marcan.st, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Mon, 11 Dec 2023 16:02:59 -0800 (PST) On Fri, Dec 8, 2023 at 1:09=E2=80=AFPM wrote: > > 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. > > 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. > > Reported-by: Arnaldo Carvalho de Melo > Closes: https://lore.kernel.org/linux-perf-users/ZXNnDrGKXbEELMXV@kernel.= org/ > Signed-off-by: Kan Liang Sorry I missed top doing the evlist__create_maps calls: https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tr= ee/tools/perf/builtin-top.c?h=3Dperf-tools-next#n1761 so it is right that the only divergence from record: https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tr= ee/tools/perf/builtin-record.c?h=3Dperf-tools-next#n1362 and stat: https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tr= ee/tools/perf/util/stat.c?h=3Dperf-tools-next#n797 So this is the right fix I believe. Reviewed-by: Ian Rogers Thanks, Ian > --- > 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 >