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/kallsyms and /proc/modules files from a guest OS to a host file system to have KVM guest OS symbols resolved.
- Copy any guest OS’s modules of interests (vmlinux and any *.ko files) from a guest OS and save them to a [guest] folder on the host file system.
- Click theConfigure Analysis button on the VTune Profiler toolbar.
The Configure Analysis window opens.
- Make sure to select the Local Host target system in the WHERE pane and configure the required target type in the WHAT pane.
By default, the Launch Application target type is selected.
If you select the Attach to Process target type, specify the qemu-kvm process to attach to.
Alternatively, you may specify the PID of the qemu-kvm process. To determine the PID, enter:
$ ps aux | grep kvm
- In the Advanced section of the WHAT pane, select the Analyze KVM guest OS option and enter paths to the local copies of the guest /proc/kallsyms and /proc/modules files; for example:
- Click the Search Binaries button on the bottom right.
The Binary/Symbol Search dialog 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/vtune as a search directory:
- Click OK to save your changes.
- In the HOW pane, 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 the Start button at the bottom to run the analysis.
When you run the analysis, the VTune Profiler collects the data on both host and guest OS and displays merged statistics in the result. Guest OS modules have the [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:
In this mode, the VTune Profiler collects data only on the kernel space modules on the KVM guest OS. Data on user space modules shows up in the [Unknown] node and includes only high-level statistics.
Call stack data is not collected for this type of profiling.