User Guide

Intel® VTune™ Profiler User Guide

ID 766319
Date 12/16/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

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:

  1. Prepare your system for analysis:
    1. Copy the /proc/kallsyms and /proc/modules files from a guest OS to a host file system to have KVM guest OS symbols resolved.
    2. 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.
  2. Click theConfigure Analysis button on the VTune Profiler toolbar.

    The Configure Analysis window opens.

  3. 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

  4. 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:

  5. Click the Search Binaries button on the bottom right.

    The Binary/Symbol Search dialog box opens.

  6. 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:

  7. Click OK to save your changes.
  8. 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.
  9. 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:

Limitations

  • 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.

See Also