Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2605028rdb; Fri, 8 Dec 2023 13:09:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHrY9fvhTml2LCsz83XhdUlXq3za8Dt2Sm93R/s6YkmM5DuX/41Z6XAN/rUEpsfmwadJ2bb X-Received: by 2002:a05:6a20:7d93:b0:18f:f637:99d1 with SMTP id v19-20020a056a207d9300b0018ff63799d1mr737376pzj.57.1702069783804; Fri, 08 Dec 2023 13:09:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702069783; cv=none; d=google.com; s=arc-20160816; b=tlEN9JMmabV/lZS/Arsz3u5pDz1GJUL39ohgAtw2YQQzepjCy19563WylAjN8s5idt D5VRP8HTWziR/MTdnBmLkoMSeqwTcLw1kIGAhu6j9FxklhD5g5cC/LF6bbbkLReAGrht XT+jfpVHn7FcXnL25P/aj8A4FHIJ+ZcTVNbMfdedJld/3GHvsj3PblhFNX2c6OntQoof 0UP+4L4hAkadR2WPbqVg7G/a01sz9s9WnTfPpyFWDGaCVMwaIN46v/YV1IRxQw/wcMNQ TMlZjO6w9aTuWiYnGxTQ1dWsXU+v4T67MGzAKtjSjVaSFO01Alc+H8CPDaK/wl8yDmXD w0jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=46efbU48F6ODbzQwhx6hXSYLEVApLyKOl2PUe62TFLY=; fh=V97FFFi5RmpdUikarEoLTJWoOplAC1MpM9MGOX1xMoI=; b=HguWCHK13P/JyZAPCmuHUutJPhUbvDxD3PYm1nsR+AOuB3C6LOxKqeDZfONp8Np9X9 goBEhqeOMJseedkEgSmRVbjsvtVnORCnNMdVwEYUpYNN2ZR2tlkWYpwDfIxaUd40qEyJ Otvcui0O0z1P8Pe4vMXZGdC3pQX81VNM6p1mHeetqBLA+GmF5RgzumXgWYcFyy8Y10fU ynlaWjuG+5T3kubeCzzoD+F1BvQHNjdh1MK7ASI7UTYsQJuLC6lPcztlwpadOqQTxgWb WeO5OyAoPfxlz0rncUS866sYjiYyuWQH6w2XfbqgPZK4z8V5G+Lkq4fQMHi4sERCcwI+ iB3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="N/9O9tL/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id kb4-20020a17090ae7c400b002871b0b4a11si2240264pjb.61.2023.12.08.13.09.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 13:09:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="N/9O9tL/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 4BB0783593B0; Fri, 8 Dec 2023 13:09:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574769AbjLHVJL (ORCPT + 99 others); Fri, 8 Dec 2023 16:09:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbjLHVJH (ORCPT ); Fri, 8 Dec 2023 16:09:07 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4494A193; Fri, 8 Dec 2023 13:09:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702069754; x=1733605754; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=/SGOKoA+Swz5M7d9MFKFLrftb660oNkZR5QqizVC2Sk=; b=N/9O9tL/walmMZXDf8xP9cXNMH5vAy8Cb5YB5Ts7Plecqb/AcKxeZiLh 4j0Ob6wllnMjmZ51yDdpdEUlCyHr0caqFEZ+PekikWcznDZKXkdrjaNfP wvah0O9IAzcNadby7bVw8m3tKEmkpAoJRE/LZ4/mSkkZbIw8hl4XPpvSF 7Yr3QVmOEBxe4qR+nUBoVRrVfxdhBcKBHYS4wnTBWtqHx3y/GGoHBliPm +7pCRBB4MKFCGNWaH7SxNK9U7PYT36boEBhSgLloVBDX+lytcdYmcOdNR 31h4YrVR0YX50l6brVKNLFIwvRfGcC5OFMjRUrruegC/YuWXkRRR8ddfv w==; X-IronPort-AV: E=McAfee;i="6600,9927,10918"; a="7791999" X-IronPort-AV: E=Sophos;i="6.04,261,1695711600"; d="scan'208";a="7791999" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2023 13:09:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10918"; a="772261155" X-IronPort-AV: E=Sophos;i="6.04,261,1695711600"; d="scan'208";a="772261155" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by orsmga002.jf.intel.com with ESMTP; 08 Dec 2023 13:09:13 -0800 From: kan.liang@linux.intel.com To: acme@kernel.org, irogers@google.com Cc: namhyung@kernel.org, mark.rutland@arm.com, maz@kernel.org, marcan@marcan.st, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Kan Liang Subject: [PATCH] perf top: Use evsel's cpus to replace user_requested_cpus Date: Fri, 8 Dec 2023 13:08:55 -0800 Message-Id: <20231208210855.407580-1-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 pete.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 (pete.vger.email [0.0.0.0]); Fri, 08 Dec 2023 13:09:41 -0800 (PST) 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 --- 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