PAPITopics:PAPI on KVM
From PAPIDocs
Jump to: navigation, search

KVM provides a virtual PMU (Performance Measurement Unit) to guest operating systems, given your system meets the requirements below.

Requirements

  1. Host must be running Linux Kernel 3.3 or higher.
  2. Qemu-kvm must be version 1.2.5 or higher.
  3. Intel CPU
  4. VM must be booted with -cpu host

Linux Kernel

Support for performance counters inside KVM guests was introduced by a patch incorporated into the 3.3 Linux Kernel. PAPITopics:Virtual PAPI Performance as well as PAPITopics:Steal Time on Virtual Machines tests were run in linux kernel 3.6. Your results may vary depending on linux kernel version.

Qemu-kvm

Qemu-kvm 1.2.5 is the earliest known version to support performance counters. Note, not all linux distribution repositories contain a sufficiently up-to-date version of qemu-kvm. Recent versions of Qemu-kvm may be downloaded from the Qemu Download Page.

CPU

Virtual PMU support currently exists only for Intel CPUs. Hopefully AMD support will be available soon.

Parameters

The guest OS must be booted with the -cpu host flag. This ensures that the virtual CPU model replicates the CPU model of the host machine. This is required for supporting performance events.

Installing PAPI

Pick up a tarball from our download page. Please refer to README.txt and INSTALL.txt in the root directory for instructions on compiling PAPI on your system. Note that no special flags should be required for running on the virtual machine. Proceed with building as if on a bare metal machine.