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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 5C541CA0EFA for ; Tue, 26 Aug 2025 13:08:16 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4cB7JG506vz3dT8; Tue, 26 Aug 2025 23:08:14 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2001:8b0:10b:1236::1" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1756213694; cv=none; b=l4d14sh3co1v4wvOWI7IirXeq7U3DwsXsNVpDvP6zVIbY+doRqidWtF59M8FpVELBjXyek+OdezYwsBLGUXmIDGFYMWlzboNehOdi8ggUFOqpKaClW09K8EsZ+vkpRO4r0edaLKannxIZqvfCMf46hpBE119ZsgMfSWakGEu6tRMDpANJevALoEjCoxnFd0kBm5WCLkjOfXHB7KL+L3sq91dAW3DN9zIGdAQIRRwYumL/BUufQHB5nS55oHeIy7he+pq7rJk3KnTVhTxiADuF8DHfyw+NRdWmHStghqUaYarY/Otv54rhVtQECDss5t+Rfxd4t4M23AcsgQR1ajwQw== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1756213694; c=relaxed/relaxed; bh=1anwaqC6FtBZhv/AdRsioHe6z7ff2/NtObpshRSmtXo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RgxcwI1NYyyDRyW46rZBsu9CN52ny7TvyBeFD9JdtmIX9M/aIe9x6vJd3e1sRXM10o/OduHIVxA6y0gcU8oQYuWn9QmOBabL0hVa3c/xIJXTnOwN7dE0qcUXo+KZvY7xEzvKhnaYx0BJ1MkNPdYieQU6SvqRboF+zjl8XHUB0DveuV01eidRHR9pk/6U372foB7W82xWR7rcH44fsOd1t2s4d190nS1Ai+u1na5UD4JwtvBaxpoJyRCb3vOkewfKaZ9WxeUlCsqIkE2P+6uhwLweQRHdIi5QB6PDbp8HT1eqf8Ysxh3Zz6rmV6HiAVcN5ENCZBA17qP4qxpTgqIyqQ== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=tTA/3PiA; dkim-atps=neutral; spf=none (client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=peterz@infradead.org; receiver=lists.ozlabs.org) smtp.mailfrom=infradead.org Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=tTA/3PiA; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=peterz@infradead.org; receiver=lists.ozlabs.org) Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4cB7JG077Fz3dSv for ; Tue, 26 Aug 2025 23:08:13 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=1anwaqC6FtBZhv/AdRsioHe6z7ff2/NtObpshRSmtXo=; b=tTA/3PiAJQSpvqwn9JBse0zv8x XpRRlvytBaU8d04FPgmaRAhvvZSqAROIZ/4ezjLoE6WsNdrr9/VlG41rEHCWsnk6JH8UsrGv5T5LT zWsAXDZBYt6RN2vrodVyAq1DmmcYAol3ljF/QPWtrzgIrZdA+eDohdH+O3MOT2cIfR3SAL6oZFxxT a0buqH4Cjn32e+/T6hw9u+ioPisD3zaMrQKEyQ6W0w6+Ct9SXam4tKJBvFWH9AMfHquCJRKF+Zp4I PdyzFVdx3HFHpHhkOPtwcc+TPPHK59R640Wqk+YmnwDvNpXZJgmWLR1JQJ9jnUMah3B3H6sSqGhBU hjKnAxuQ==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1uqtPC-00000002GIP-3rVi; Tue, 26 Aug 2025 13:08:07 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id DB2A63002C5; Tue, 26 Aug 2025 15:08:06 +0200 (CEST) Date: Tue, 26 Aug 2025 15:08:06 +0200 From: Peter Zijlstra To: Robin Murphy Cc: mingo@redhat.com, will@kernel.org, mark.rutland@arm.com, acme@kernel.org, namhyung@kernel.org, alexander.shishkin@linux.intel.com, jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com, kan.liang@linux.intel.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-csky@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-pm@vger.kernel.org, linux-rockchip@lists.infradead.org, dmaengine@vger.kernel.org, linux-fpga@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, coresight@lists.linaro.org, iommu@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-cxl@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH 16/19] perf: Introduce positive capability for sampling Message-ID: <20250826130806.GY4067720@noisy.programming.kicks-ass.net> References: X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Aug 13, 2025 at 06:01:08PM +0100, Robin Murphy wrote: > Sampling is inherently a feature for CPU PMUs, given that the thing > to be sampled is a CPU context. These days, we have many more > uncore/system PMUs than CPU PMUs, so it no longer makes much sense to > assume sampling support by default and force the ever-growing majority > of drivers to opt out of it (or erroneously fail to). Instead, let's > introduce a positive opt-in capability that's more obvious and easier to > maintain. > > diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h > index 4d439c24c901..bf2cfbeabba2 100644 > --- a/include/linux/perf_event.h > +++ b/include/linux/perf_event.h > @@ -294,7 +294,7 @@ struct perf_event_pmu_context; > /** > * pmu::capabilities flags > */ > -#define PERF_PMU_CAP_NO_INTERRUPT 0x0001 > +#define PERF_PMU_CAP_SAMPLING 0x0001 > #define PERF_PMU_CAP_NO_NMI 0x0002 > #define PERF_PMU_CAP_AUX_NO_SG 0x0004 > #define PERF_PMU_CAP_EXTENDED_REGS 0x0008 > @@ -305,6 +305,7 @@ struct perf_event_pmu_context; > #define PERF_PMU_CAP_EXTENDED_HW_TYPE 0x0100 > #define PERF_PMU_CAP_AUX_PAUSE 0x0200 > #define PERF_PMU_CAP_AUX_PREFER_LARGE 0x0400 > +#define PERF_PMU_CAP_NO_INTERRUPT 0x0800 So NO_INTERRUPT was supposed to be the negative of your new SAMPLING (and I agree with your reasoning). What I'm confused/curious about is why we retain NO_INTERRUPT?