Guest PMU
From KVM
Guest PMU (Performance Monitoring Unit) currently exists in the form of an out-of-tree patchset.
See the KVM Forum 2011 presentation about the state as of August 2011.
Current status
Version 2 Architectural PMU on Intel and AMD hosts is implemented and works.
TODO
Guest visible features
- Implement Version 3 Architectural PMU
- PEBS - Preceise Event Based Sampling - allows examining program state (problematic)
- BTS - Branch Trace Store - allows tracing program execution accurately (problematic)
Accuracy
- Do not pin perf_events. Schedule them as a group and scale PM counter value.
Performance
- Let a guest control MSR_CORE_PERF_GLOBAL_CTRL if there is no guest monitoring event on a host.
- Update the perf_event subsystem to make use of the PERF_GLOBAL_ENABLE MSR to speed up context switching, on both guest and host
- Check whether perf_event does unnecessary RMW operations on MSRs, which are significantly slow in a guest
- Add a paravirt batch MSR read/write facility, update perf to use it when available
- Change perf to use an ordinary interrupt instead of NMI when profiling only user space, or only a guest (reduces work in NMI context)
Git repositories
Guest PMU: git://github.com/avikivity/kvm.git