Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4836480rdb; Tue, 12 Dec 2023 10:31:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWS0N3v/mnbsp5SgAiwzhWp7TLBzOZgfOAd1O8fK8Y0aExltFlPVHvZiWPB/tGWgUmrBFs X-Received: by 2002:a05:6a00:2da4:b0:6ce:8388:4c9e with SMTP id fb36-20020a056a002da400b006ce83884c9emr7658838pfb.45.1702405885014; Tue, 12 Dec 2023 10:31:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702405884; cv=none; d=google.com; s=arc-20160816; b=csKxngl5x9u8SW8fbG7mDGMKH1Z1H1sEs61dUfZz6EfuUAa2GRcJiu+xVUvv8xkXZ3 JakX+9t2ZwDkKXR7I34vB/7EeE3aDq7ogxIu5x6cMpHmsHbT394p/pPjAQsjL3+Z8fAm bgM5WU9JreqEMGQ0nglDVoxqBqREvMsZLZzO6i2QPOWYOJQ6RpAV5i5qTiWTdsucHg/S Qggm8aYCxW0DBQIu3KrtS6aK4pLaSFLkpSh4XC/pJiqDqESjS4nUIHEEp5BzYpOxcYqK la3VVdQx+/lFmdjoebCysxthR23/vlEOU46FaUkmEijLSoT+s0hTJWKRoP9fP3X8OJc7 UHHA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=prvSL9X5YqnsRdGiaJGdY6WsS1dZu+Uzbq3s5Jz41qg=; fh=foNEHlBf2TbFzwviXKxTqBDH39Gk3kaw9uPhT2szzAE=; b=aJIO1OZ987Gki7whxSCFdy2J+/nodA+EapWeAO2iTIEgJy2z14V2z32L97r2G6HlAh LpD+ikLVlr5U5zmVCtjWAiICEwm5V5N3v2A0K2NOZrJKqJFU8xQHRNJw70YGJChIsIfP OOZTYoaJWbi/H5y/WTFWYW6+7+qfvl/RuP8esYHdYgqm1Dfux23Ov9Zl//6LGZL0Fo6Z 1PdCVQWHqSSau/FHtPnoaUZXZ+vszuGrwFb2764MBSqBY9yzRd8SjTiDiKs9sZXoUhTS WeKHdg0LaStvJyqLoTo0p4vHNlxPZqE+gISjNWo3tzhKpkQhDyBZjWn1/QyRiQKoPkQt 7rDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id jc31-20020a056a006c9f00b006cded1e8135si8019125pfb.197.2023.12.12.10.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 10:31:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 2BED780AC5B5; Tue, 12 Dec 2023 10:31:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376568AbjLLSbH (ORCPT + 99 others); Tue, 12 Dec 2023 13:31:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232546AbjLLSbG (ORCPT ); Tue, 12 Dec 2023 13:31:06 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 94D29CA; Tue, 12 Dec 2023 10:31:12 -0800 (PST) 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 9E638FEC; Tue, 12 Dec 2023 10:31:58 -0800 (PST) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.26.141]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2B4653F762; Tue, 12 Dec 2023 10:31:11 -0800 (PST) Date: Tue, 12 Dec 2023 18:31:05 +0000 From: Mark Rutland To: Ian Rogers Cc: Namhyung Kim , "Liang, Kan" , Arnaldo Carvalho de Melo , 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> <07677ab2-c29b-499b-b473-f7535fb27a8c@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 12 Dec 2023 10:31:22 -0800 (PST) On Tue, Dec 12, 2023 at 10:00:16AM -0800, Ian Rogers wrote: > On Tue, Dec 12, 2023 at 9:23 AM Namhyung Kim wrote: > > > > On Tue, Dec 12, 2023 at 7:56 AM Liang, Kan wrote: > > > > > > > > > > > > On 2023-12-11 4:13 p.m., Arnaldo Carvalho de Melo wrote: > > > > 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. > > > > > > > > > > Yes, but for hybrid there is no single "cycles" event which can cover > > > all CPUs. > > > > Does that mean the kernel would reject the legacy "cycles" event > > on hybrid CPUs? > > I believe not. When the extended type isn't set on legacy cycles we > often have the CPU and from that can determine the PMU. The issue is > with the -1 any CPU perf_event_open option. As I was told, the PMU the > event is opened on in this case is the first one registered in the > kernel, on Intel hybrid this could be cpu_core or cpu_atom.. but IIRC > it'll probably be cpu_core. On ARM ¯\_(ツ)_/¯. On ARM it'll be essentially the same as on x86: if you open an event with type==PERF_EVENT_TYPE_HARDWARE (without the extended HW type pointing to a specific PMU), and with cpu==-1, it'll go to an arbitrary CPU PMU, whichever happens to be found by perf_init_event() when iterating over the 'pmus' list. If you open an event with type==PERF_EVENT_TYPE_HARDWARE and cpu!=-1, the event will opened on the appropriate CPU PMU, by virtue of being rejected by others when perf_init_event() iterates over the 'pmus' list. Mark.