Commit b2e74a26 authored by Stephane Eranian's avatar Stephane Eranian Committed by Ingo Molnar

perf_events: Fix read() bogus counts when in error state

When a pinned group cannot be scheduled it goes into error state.

Normally a group cannot go out of error state without being
explicitly re-enabled or disabled. There was a bug in per-thread
mode, whereby upon termination of the thread, the group would
transition from error to off leading to bogus counts and timing
information returned by read().

Fix it by clearing the error state.
Signed-off-by: default avatarStephane Eranian <>
Acked-by: default avatarPeter Zijlstra <>
Cc: Paul Mackerras <>
LKML-Reference: <>
Signed-off-by: default avatarIngo Molnar <>
parent 4d795fb1
......@@ -338,7 +338,16 @@ list_del_event(struct perf_event *event, struct perf_event_context *ctx)
event->state = PERF_EVENT_STATE_OFF;
* If event was in error state, then keep it
* that way, otherwise bogus counts will be
* returned on read(). The only way to get out
* of error state is by explicit re-enabling
* of the event
if (event->state > PERF_EVENT_STATE_OFF)
event->state = PERF_EVENT_STATE_OFF;
* If this was a group event with sibling events then
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment