Profile KVM Kernel Modules from the Host
If you are a system developer and interested in the performance analysis of a guest Linux* system including KVM modules, consider using this usage mode:

- Prepare your system for analysis:
- Copy the/proc/kallsymsand/proc/modulesfiles from a guest OS to a host file system to have KVM guest OS symbols resolved.
- Copy any guest OS’s modules of interests (vmlinuxand any*.kofiles) from a guest OS and save them to a[guest]folder on the host file system.
- Click theConfigure Analysisbutton on theVTunetoolbar.ProfilerTheConfigure Analysiswindow opens.
- Make sure to select theLocal Hosttarget system in theWHEREpane and configure the required target type in theWHATpane.By default, theLaunch Applicationtarget type is selected.If you select theAttach to Processtarget type, specify theqemu-kvmprocess to attach to.Alternatively, you may specify the PID of theqemu-kvmprocess. To determine the PID, enter:$ ps aux | grep kvm
- In theAdvancedsection of theWHATpane, select theAnalyze KVM guest OSoption and enter paths to the local copies of the guest/proc/kallsymsand/proc/modulesfiles; for example:
- Click theSearch Binariesbutton on the bottom right.TheBinary/Symbol Searchdialog box opens.
- Add a local path to a[guest]folder where all modules copied from the guest OS reside.For example, if your[guest]folder is located in/home/vtune, specify/home/vtuneas a search directory:
- ClickOKto save your changes.
- In theHOWpane, select a required analysis type.For KVM guest OS profiling, you may choose analysis types using Perf*-based EBS data collection: Hotspots (hardware event-based sampling mode), System Overview, or configure your own custom analysis.
- Click theStartbutton at the bottom to run the analysis.
When you run the analysis, the
VTune
collects the data on both host and guest OS and displays merged statistics in the result. Guest OS modules have the
Profiler
[guest]
postfix in the grid. For example:

Focus on the
Platform
tab to analyze your code performance on the guest OS and correlate this data with CPU, GPU, power, hardware event metrics and interrupt count at each moment of time. If you enabled the
kvm Ftrace event collection for your target, you can also monitor the statistics for KVM kernel module:

Limitations
- In this mode, theVTunecollects data only on the kernel space modules on the KVM guest OS. Data on user space modules shows up in theProfiler[Unknown]node and includes only high-level statistics.
- Call stack data is not collected for this type of profiling.