Question

In kernel 3.11.0, in the struct perf_event_attr, there are three members named exclude_hv/exclude_host/exclude_guest.

I know the exclude_host field is to exclude events generated by the host when running kvm. But what is the meaning of exclude_hv? Is it used in the Xen?
What is the mechanism in hardware that supports the function of exclude_host? As far as I know, in the performance monitoring select registers, there are no such bits that control the event counter to exclude events generated by the host.

Was it helpful?

Solution

This is a bit old but for those looking at the answer, as me:

exclude_hv: do not count events that occur in the hypervisor.

The distinction between events occurred in user space, kernel, hypervisor, host, etc is done in software. The kernel and/or hypervisor will retire and replace the event count and configuration on each change of context.

Here is an excellent description of perf_events, which is the kernel module that handles the performance counters.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top