From patchwork Fri Dec 8 21:08:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liang, Kan" X-Patchwork-Id: 176037 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5721671vqy; Fri, 8 Dec 2023 13:09:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGAJdda2MuSBiFm8DmvPBRdBIiGqLrqNkATx5sbIFwRZsNLcX8j7QGNJNGKKy852kHU/xeo X-Received: by 2002:a17:90a:6881:b0:288:79f3:8075 with SMTP id a1-20020a17090a688100b0028879f38075mr658436pjd.13.1702069780268; Fri, 08 Dec 2023 13:09:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702069780; cv=none; d=google.com; s=arc-20160816; b=Nop6REQ3jPSunckkNRTcdGWTM28O+3I/KslznXrD0Ki2cU4gnXfnIN6sthLnMvyG2W 92tAVwkLMEAy8FLoxxDWsXp5aLvjH6As/gd0KNSZ7DwS1ZTh5AhHlA+ZtJWIRXAy4Jbq m3pvBxHo51Jgo4UOCgSKhgKaVQ2lH/v82ppBLpV5WUoNZgzmmpzct7Nmvxm2O8aIQcIj T0Ozrms0dwBqXoCoU1BAlG2DPz0oO+x4tMwHZWllkdCh5aBR3uaJAVUfHlqAlkp24x6T sKBmQqXme7TRDkT1xr4sgerqcJKEnmUXnUxGnwE7MMYD1UYONSQOFRI9dLh5CqSjoeNc HNuw== 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 Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id gl13-20020a17090b120d00b002868ad0a84bsi3457203pjb.37.2023.12.08.13.09.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 13:09:40 -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 B959883593BA; Fri, 8 Dec 2023 13:09:37 -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 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:37 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784749521742265544 X-GMAIL-MSGID: 1784749521742265544 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 Reviewed-by: Ian Rogers Signed-off-by: Arnaldo Carvalho de Melo Tested-by: Kan Liang Signed-off-by: Arnaldo Carvalho de Melo Tested-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.