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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 13/08/2025 6:01 pm, Robin Murphy wrote:
[...]
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;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux