VMware vSphere ESXi
VMware Workstation Pro
VMware Fusion Pro
The virtual PMCs are accessed in the same way as the PMCs of the underlying physical CPU. See the Intel 64 and IA-32 Architectures Software Developer's Manual and the AMD BIOS and Kernel Developer's Guide (BKDG) for details.
vSphere 7.0 - Activate Virtual CPU Performance Counters
vSphere 8.0 - Activate Virtual CPU Performance Counters
VMware Workstation Pro: Configuring Virtual Machine Processor Settings
VMware Fusion Pro: Set Advanced Processor Options
Option | Description |
vpmc.freezeMode=hybrid |
This is the default behavior. The instructions retired and branches retired events count guest instructions only. When the CPU executes hypervisor instructions, these events do not increment. All other events increment whenever the physical CPU executes either guest or hypervisor instructions on behalf of the virtual machine. When a virtual machine is not scheduled on a physical CPU, its virtual PMCs always stop incrementing. This way, metrics involving ratios of guest instructions can be used to calculate the cost of executing instructions on the virtual machine. For example, instructions per cycle (IPC) indicate the average number of guest instructions that can be retired per cycle that the physical CPU is used to execute the virtual machine. |
vpmc.freezeMode=guest |
All events increment only when guest instructions are directly executing on a physical CPU. When the hypervisor code is executing, no events increment. |
vpmc.freezeMode=vcpu |
All events increment while a physical CPU is being used to execute guest code or hypervisor code on behalf of the virtual machine. Events stop incrementing only while the virtual machine is descheduled. |
In some cases, a performance monitoring counter cannot be virtualized. This occurs when the host is already using the physical CPU performance counter for another use, as in the following cases:
When the virtual PMC feature is enabled, additional CPU compatibility checks are performed before a virtual machine can be migrated between hosts. The performance monitoring events of the source and destination CPUs must be compatible. The list of performance monitoring events must be the same on the source and destination CPUs. In general, two CPUs have compatible performance monitoring events if they belong to the same microarchitecture. See the Intel 64 and IA-32 Architectures Software Developer's Manual and the AMD BIOS and Kernel Developer's Guide (BKDG) for the list of performance monitoring events for each CPU. In addition, to successfully migrate a virtual machine, all counters that are available on the source CPU must also be available on the destination CPU.
You cannot enable Virtual Performance Monitoring Counters in a virtual machine that is using Enhanced vMotion Compatibility.