From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 63DC5CD128A for ; Wed, 10 Apr 2024 15:34:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9Cn2nkVdZE6y6UKTjjLUCRm06+P92oYFd2cmxnhPfPk=; b=cvuTt6T8CR8MvO zsMiS6u4/6xgsRBosaSZoah7RjhGZmCAUQh3vqOFa9Z4qEU32HtsBU4N9QDm2kap/7B8JBSIrWSKS CpzqLJVx7cy26RyybuQTHvzeBFTaaufssXTYncCBbzCKHDitajl3nbaaHAL4NPDS1KVC/tIMfrZtG ESGuHjuS2PRptCast94cFYquFUS39AwgCbY16OhuqnpnMDRIurBkDcn83SkLVRN+4RtgjjWFc0DdO s1Ut+iqLXGe12zMG7rwbVC3CP1gA1mDqdt5y+wCyF4sPLQuAPRYUHipfNSemHjQCssVjOGqizL2lf xhDpf6Hoe4TIeX7Eb54Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruZy3-00000007o2Y-1vtZ; Wed, 10 Apr 2024 15:34:31 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruZy0-00000007o1c-0AL9 for linux-arm-kernel@lists.infradead.org; Wed, 10 Apr 2024 15:34:29 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id DE04ECE281F; Wed, 10 Apr 2024 15:34:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88590C433F1; Wed, 10 Apr 2024 15:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712763265; bh=HnzozCvOS1q27gnKJVvpU7CHZz9gMEPBCAW7+Cc7CVs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CVbAmK+8SUeJoukHHawbCIya8ngLTbHf6Eg59RFqOJ5x5ulWk3u8qtRwZwRJAd+nh GpLmyqE2v9zegDypKQ1HJ83rAh/j+CAsf3CbVAiS2QtmmaFFBK/7CO1cGrgW9F6DrN oPc9Yk/dWpQglCJT9OU9dfkTjIfrcGHwwjo/x1phTjufzt5dkl/zpZQ/Zzaqtcx7Di 7JHxqPh3rsy6LSxAjjHdJDjCJfmZwXuYvgwlWp8HUf54Y+TNs8/pnzvMkmcCZPiexG 4BE7eDFabQGKPAShg6pUZR23tNxa0Pfd3sNx5uOrmiyGfWjj8gMM/J4ThnUk+etzA5 9QY4KWuUWa0KQ== Date: Wed, 10 Apr 2024 16:34:19 +0100 From: Will Deacon To: Yicong Yang Cc: mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, jonathan.cameron@huawei.com, prime.zeng@hisilicon.com, linuxarm@huawei.com, yangyicong@hisilicon.com Subject: Re: [PATCH 1/2] perf: arm_pmu: Only show online CPUs in device's "cpus" attribute Message-ID: <20240410153419.GA25171@willie-the-truck> References: <20240410095833.63934-1-yangyicong@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240410095833.63934-1-yangyicong@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240410_083428_283845_99593F40 X-CRM114-Status: GOOD ( 15.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 10, 2024 at 05:58:32PM +0800, Yicong Yang wrote: > From: Yicong Yang > > When there're CPUs offline after system booting, perf will failed: > [root@localhost ~]# /home/yang/perf stat -a -e armv8_pmuv3_0/cycles/ > Error: > The sys_perf_event_open() syscall returned with 19 (No such device) for event (cpu-clock). > /bin/dmesg | grep -i perf may provide additional information. > > This is due to PMU's "cpus" is not updated and still contains offline > CPUs and perf will try to open perf event on the offlined CPUs. > > Make "cpus" attribute only shows online CPUs and introduced a new > "supported_cpus" where users can get the range of the CPUs this > PMU supported monitoring. > > Signed-off-by: Yicong Yang > --- > drivers/perf/arm_pmu.c | 24 +++++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) Hmm. Is the complexity in the driver really worth it here? CPUs can be onlined and offlined after the perf_event_open() syscall has been executed, so this feels like something userspace should be aware of and handle on a best-effort basis anyway. Does x86 get away with this because CPU0 is never offlined? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel