Move per-CPU logic from inside individual monitors to the main
monitoring framework by adding cpu_start() and cpu_stop() callback
functions to the cpuidle_monitor structure.
This refactoring allows the framework to handle per-CPU scheduling
and gives higher priority to fork_it operations as mentioned in
the TODO. Individual monitors now only need to implement per-CPU
initialization and cleanup logic without managing the CPU iteration
themselves.
Changes made:
- Add cpu_start()/cpu_stop() function pointers to cpuidle_monitor struct
- Update monitoring framework to call per-CPU callbacks for each CPU
- Refactor cpuidle_sysfs and mperf monitors to use new callback pattern
- Maintain backward compatibility for monitors without per-CPU callbacks
This addresses the TODO item: "Add cpu_start()/cpu_stop() callbacks
for monitor -> This is to move the per_cpu logic from inside the
monitor to outside it."
Signed-off-by: Rohan Lambture <rohanlambture13@xxxxxxxxx>
---