mirror of
https://github.com/torvalds/linux.git
synced 2026-11-26 16:33:17 +00:00
perf_events: Disable events when we detach them
If we leave the event in STATE_INACTIVE, any read of the event after the detach will increase the running count but not the enabled count and cause funny scaling artefacts. Signed-off-by: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
committed by
Ingo Molnar
parent
6c2bfcbe58
commit
2e2af50b1f
@@ -294,6 +294,8 @@ list_del_event(struct perf_event *event, struct perf_event_context *ctx)
|
||||
if (event->group_leader != event)
|
||||
event->group_leader->nr_siblings--;
|
||||
|
||||
event->state = PERF_EVENT_STATE_OFF;
|
||||
|
||||
/*
|
||||
* If this was a group event with sibling events then
|
||||
* upgrade the siblings to singleton events by adding them
|
||||
|
||||
Reference in New Issue
Block a user