perf/core: Change to POLLERR for pinned events with error

Commit:

f4b07fd62d4d11d5 ("perf/core: Use POLLHUP for pinned events in error")

started to emit POLLHUP for pinned events in an error state.

But the POLLHUP is also used to signal events that the attached task is
terminated. To distinguish pinned per-task events in the error state
it would need to check if the task is live.

Change it to POLLERR to make it clear.

Suggested-by: Gabriel Marin <gmx@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250422223318.180343-1-namhyung@kernel.org

authored by Namhyung Kim and committed by Ingo Molnar 0db61388 bc337235

+2 -2
+2 -2
kernel/events/core.c
··· 3943 3943 perf_event_set_state(event, PERF_EVENT_STATE_ERROR); 3944 3944 3945 3945 if (*perf_event_fasync(event)) 3946 - event->pending_kill = POLL_HUP; 3946 + event->pending_kill = POLL_ERR; 3947 3947 3948 3948 perf_event_wakeup(event); 3949 3949 } else { ··· 6075 6075 6076 6076 if (unlikely(READ_ONCE(event->state) == PERF_EVENT_STATE_ERROR && 6077 6077 event->attr.pinned)) 6078 - return events; 6078 + return EPOLLERR; 6079 6079 6080 6080 /* 6081 6081 * Pin the event->rb by taking event->mmap_mutex; otherwise