Power analysis is provided by the VTune Amplifier for Systems only. To analyze applications on Linux* target systems, run the CPU Sleep States or CPU Frequency analysis types from the VTune Amplifier GUI or CLI installed on the Linux or Windows* host. To analyze applications on Android* devices, use the Intel Energy Profiler (SoCWatch/WuWatch) to run the analysis directly on the device. You can view collected data either in the text-only mode on the device or import and view the data in the VTune Amplifier GUI nstalled on the host system.
Configuring the Basic Software Environment
To compile the power analysis driver, the target system must have the following software installed:
C compiler that was used to build the kernel and that is capable of compiling programs with anonymous structs/unions, for example, GCC* 2.96 or later.
Tools needed to build a C-based program, for example, GNU* make tool, native assembler, linker.
System headers, for example,
In addition, the kernel version must be 2.6.32 or later and must be configured with the following options enabled:
You can verify these options by checking the kernel config file (for example,
/usr/src/linux/.config). Normally, these tools are installed, and kernel options are enabled, by default. However, administrators may remove/disable them from deployment systems, such as servers or embedded systems.
Configuring the Kernel Development Environment
Linux distributions based on kernel 2.6 * Red Hat Enterprise* Linux 6: Install the
kernel-*-devel-*.rpmthat is appropriate for the running kernel (on the third install CD)
Red Hat Fedora* Core 12 and later: Download and install the
kernel-*-devel-*.rpmthat is appropriate for the running kernel from http://download.fedora.redhat.com/pub/fedora/linux/ or by using YUM:
$ yum install kernel-devel
Novell* SuSE Linux Enterprise Server* 10, 11 and Novell OpenSuSE*11.x: Install the
kernel-source-*-`uname -m`.rpmthat is appropriate for the running kernel
Red Flag* 5.x: Install the
kernel-*-devel-*.rpmthat is appropriate for the running kernel (on second install CD)
Debian* 5.x and Ubuntu* 10.x: Install the GCC and kernel development environment via:
$ apt-get update
$ apt-get install build-essential
$ apt-get install linux-headers-`uname -r` 4
For kernels or Linux distributions not mentioned above, you need to set up the kernel build environment manually. This involves configuring the kernel sources (and hence kernel headers) to match the running kernel on the target system. For 2.6-based kernels, the kernel sources can be configured as follows:
# boot into the kernel you wish to build driver for # and make sure the kernel source tree is placed in #/usr/src/linux-`uname -r` # cd /usr/src/linux-`uname -r` vi Makefile # set EXTRAVERSION to a value corresponding to `uname -r` make mrproper cp /boot/config-`uname -r` .config make oldconfig make prepare make scripts
Once the configuration completes, make sure that
/usr/src/linux-`uname -r`/include/linux/version.h or in
/usr/src/linux-`uname -r`/include/linux/utsrelease.h matches
Building and (Re)Loading the Driver
Once the standard development tools and proper kernel development environment are installed, you can build and load the driver:
To perform these steps, make sure you have root or sudo permissions.
# build the driver: cd /path/to/powerdk/src/ ./build-driver # unload previously loaded driver from the kernel (if any): cd /path/to/powerdk/src/ ./rmmod-apwr2 # load the driver into the kernel: cd /path/to/powerdk/src/ sudo ./insmod-apwr2 # autoload the driver at boot time: cd /path/to/powerdk/src/ ./boot-script -g users -d /path/to/pre-built-drivers
If any errors occur during the building or loading of the driver, this may indicate a mismatch between the kernel sources and the running kernel. For load issues, check the
/var/log/messages file or the output of