Thread (52 messages) 52 messages, 8 authors, 2025-08-27

Re: [PATCH 19/19] perf: Garbage-collect event_init checks

From: Robin Murphy <robin.murphy@arm.com>
Date: 2025-08-19 13:25:51
Also in: amd-gfx, dmaengine, dri-devel, imx, intel-gfx, intel-xe, linux-alpha, linux-amlogic, linux-arm-msm, linux-cxl, linux-fpga, linux-iommu, linux-mips, linux-perf-users, linux-pm, linux-riscv, linux-rockchip, linux-s390, linux-sh, linuxppc-dev, lkml, loongarch, sparclinux

On 13/08/2025 6:01 pm, Robin Murphy wrote:
[...]
quoted hunk ↗ jump to hunk
diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
index 297ff5adb667..98ffab403bb4 100644
--- a/arch/x86/events/intel/uncore.c
+++ b/arch/x86/events/intel/uncore.c
@@ -731,24 +731,11 @@ static int uncore_pmu_event_init(struct perf_event *event)
  	struct hw_perf_event *hwc = &event->hw;
  	int ret;
  
-	if (event->attr.type != event->pmu->type)
-		return -ENOENT;
-
  	pmu = uncore_event_to_pmu(event);
  	/* no device found for this pmu */
  	if (!pmu->registered)
  		return -ENOENT;
  
-	/* Sampling not supported yet */
-	if (hwc->sample_period)
-		return -EINVAL;
-
-	/*
-	 * Place all uncore events for a particular physical package
-	 * onto a single cpu
-	 */
-	if (event->cpu < 0)
-		return -EINVAL;
Oopsie, I missed that this isn't just the usual boilerplate as the 
comment kind of implies, but is also necessary to prevent the 
uncore_pmu_to_box() lookup going wrong (since the core code won't reject 
a task-bound event until later). I'll put this back with an updated 
comment for v2 (and double-check everything else again...), thanks LKP!

Robin.

  	box = uncore_pmu_to_box(pmu, event->cpu);
  	if (!box || box->cpu < 0)
  		return -EINVAL;
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help