perf: add hotplug support
The change is a squash of the following four commits taken from msm-4.14: 1) commit <b02d7648fbd1> ("enable perf to continue across hotplug") Currently perf hardware, software and tracepoint events are deleted when a cpu is hotplugged out. This change restarts the events after hotplug. In arm_pmu.c most of the code for handline power collapse is reused for hotplug. This change supercedes commit 1f0f95c5fe9e ("perf: add hotplug support so that perf continues after hotplug") and uses the new hotplug notification method. 2) commit <9768e7af40d6> ("disable perf_event_read during hotplug") core.c should not allow perf_event_read access during hotplug. DCVS may try to read events during hotplug startup or shutdown. Set a flag to not allow access during hotplug. 3) commit <1fc690b7b8c6> ("perf: core: Avoid race condition when releasing perf-events") Before calling perf_event_release_kernel(), capture the perf's pmus_mutex lock to prevent the CPU from going offline during the operation. 4) commit <77257e46efea> ("perf: Manage CPU hotplug events at core level") the approach here is to achieve the hotplug management at the perf-core level. The idea is to detach the event from the context (perf_remove_from_context()), when the CPU is about to come down and re-attach it back (perf_install_in_context()), when the CPU comes back online. The approach involves removing the logic for maintaining zombie events (PERF_EVENT_STATE_ZOMBIE) and let the dormant list itself carry the events whose CPUs are offline. Change-Id: I3738bdcaae2d2199ba3fb68ce77f637d867c5c14 Signed-off-by:Raghavendra Rao Ananta <rananta@codeaurora.org> Signed-off-by:
Rishabh Bhatnagar <rishabhb@codeaurora.org>
Loading
Please register or sign in to comment