diff options
-rw-r--r-- | kernel/perf_event.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index f8c7939c57cf..0b9ca2d834dd 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -338,7 +338,16 @@ list_del_event(struct perf_event *event, struct perf_event_context *ctx) | |||
338 | event->group_leader->nr_siblings--; | 338 | event->group_leader->nr_siblings--; |
339 | 339 | ||
340 | update_event_times(event); | 340 | update_event_times(event); |
341 | event->state = PERF_EVENT_STATE_OFF; | 341 | |
342 | /* | ||
343 | * If event was in error state, then keep it | ||
344 | * that way, otherwise bogus counts will be | ||
345 | * returned on read(). The only way to get out | ||
346 | * of error state is by explicit re-enabling | ||
347 | * of the event | ||
348 | */ | ||
349 | if (event->state > PERF_EVENT_STATE_OFF) | ||
350 | event->state = PERF_EVENT_STATE_OFF; | ||
342 | 351 | ||
343 | /* | 352 | /* |
344 | * If this was a group event with sibling events then | 353 | * If this was a group event with sibling events then |