Re: [Patch v3 3/7] perf/x86: Check if cpuc->events[*] pointer exists before accessing it

From: Andi Kleen
Date: Tue Aug 19 2025 - 23:41:55 EST


> event = cpuc->events[bit];
> + /*
> + * perf_event_overflow() called by below __intel_pmu_pebs_last_event()
> + * could trigger interrupt throttle and clear all event pointers of the
> + * group in cpuc->events[] to NULL. So need to re-check if cpuc->events[*]
> + * is NULL, if so it indicates the event has been throttled (stopped) and
> + * the corresponding last PEBS records have been processed in stopping
> + * event, don't need to process it again.
> + */
> + if (!event)
> + continue;

Then we silently ignore the overflow. Would be better to log at least an overflow
packet or something like that.

-Andi