perf: Fix event cleanup across CPU hotplugs

Perf hardware events are generally tied to a particular CPU.
During the cleanup process perf_remove_from_context()
tries to execute the PMU related cleanup on the CPU that the
event is tied to. But if the CPU is offline, the cleanup is
not completed successfully at the PMU level, but the event
is freed (at the core level).

This fix is to collect the events that are approaching the release
when it's CPU is down. These zombie events are cleaned up when the
CPU is hotplugged on again.

Change-Id: I9ddf8f32cfcec4e0cb1c0910fb68b6db984d7553
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
4 files changed