This article describes how to install Intel VTune performance analyzer for linux on Moblin system. In this tutorial, we use Intel VTune performance analyzer for linux version 9.1, and moblin 2.0 final version for netbook.
1. Install and set up moblin OS.
a. Download the moblin 2.0 OS from http://moblin.org/downloads , I use the moblin image from http://mirrors.kernel.org/moblin/releases/2.0/images/moblin-2.0-final-20090924-001.img
This is the Moblin 2.0 final version for netbooks. You may try to download a more recent OS version. The steps described in this article should be similar for more recent moblin OS.
b. Install OS on a netbook. After the OS installed successfully, you also need to install some other tools.
First, make sure your yum is working. It’s very convenient to install moblin software tools by yum.
Second, use yum to install gcc, make etc moblin tools. For example, use command ‘yum install gcc’ to install gcc in your moblin system.
Finally, during this tutorial, you may find the error that xxx is not installed. In this case, just use ‘yum install xxx’ to install the required software tools.
2. Install VTune
Now we will install VTune version 9.1 on Moblin. Goto VTune installation folder, run command:
$ ./install
Follow the installation message and install the VTune.
During the installation, it will report that the current distribution of Linux on your system is not validated. This is not a problem, input Yes to proceed with the install.
You don’t need to change any options during installation, you can use the default setting. Select 1 “Start installation” for next step.
Most likely, you will find the following messages during the final installation:
…
Please wait …
EntireX DCOM for Linux* component is being installed…
EntireX DCOM for Linux* component was successfully installed.
The Vtune™ Performance Analyzer Driver Kit component is being installed…
Searching a pre-built driver … FAILED
Building the driver for your kernel … FAILED
Installing sampling driver boot script … OK
Loading the driver … FAILED
…
According to the message, the VTune driver for Moblin is failed. This is fine. We will build the driver manually later. Press enter to finish the installation.
3. Build Moblin kernel
To build the VTune driver, we need the moblin kernel source. You can get the moblin kernel source package from http://repo.moblin.org/moblin/development/core/source/ . We use kernel-2.6.30.3-4.1.moblin2.src.rpm in this tutorial. Please make sure your kernel source is same as your OS kernel version.
a. Extract the rpm, the kernel source will be extract to rpmbuild folder. For example, in my system, the rpm package is located in /home/moblin/Download. The kernel source is extracted to /home/moblin/rpmbuild
$ rpm –ivh kernel-2.6.30.3-4.1.moblin2.src.rpm
b. Build the kernel
$ cd rpmbuild/SPECS
$ rpmbuild –bb ./kernel.spec
Normally, the kernel will be built successfully. Please refer to the http://moblin.org for the issues with kernel build. If the build is failed, ignore the error messages, you may still be able to continue for the next steps.
After this step, you will find the kernel source build environment in folder /home/moblin/rpmbuild/BUILD/kernel-2.6.30/linux-2.6.30
c. Set the build and source link. In folder /lib/modules/2.6.30.3-4.1.moblin2-netbook, there are two links, build and source. You need to reset it to the correct directory.
$ cd /lib/modules/2.6.30.3-4.1.moblin2-netbook
$ ln –s /home/moblin/rpmbuild/BUILD/kernel-2.6.30/linux-2.6.30 build
$ ln –s /home/moblin/rpmbuild/BUILD/kernel-2.6.30/linux-2.6.30 source
4. Build VTune driver
Now we will build the VTune driver manually.
a. goto VTune driver build directory.
$ cd /opt/intel/vtune/vdk/src
b. remove –Werror in Makefile.in
$ vi Makefile.in
Search “-Werror”, you will find lines:
DEBUG_FLAGS = -Werror
RELEASE_FLAGS = -Werror
This option is to treat warning as error during compilation. Just remove –Werror, otherwise, the build will be failed.
c. Build the VTune driver for moblin
$ ./build-driver
Use default setting during build.
C compiler to use: /usr/bin/gcc
Make command to use: /usr/bin/make
Kernel source directory: /lib/modules/2.6.30.3-4.1.moblin2-netbook/source
d. Normally the build will be successful. You can find the VTune driver file vtune_drv-x32-2.6.30.3-4.1.moblin2-netbooksmp.ko in the current folder. In some cases, if there are problems in your kernel source tree, the configuration will be failed. For example, if the configuration reports that the version.h is not found, you need to check if the version.h is in the kernel source folder /home/moblin/rpmbuild/BUILD/kernel-2.6.30/linux-2.6.30/include/linux. If it is not there, you may need to rebuild the kernel.
e. Load the driver.
$ ./insmod-vtune
It will report that the driver is loaded successfully.
5. A simple sampling test.
Now let’s have a simple test for the VTune. You can write a simple test.c to generate a simple test file for execution. Please note that you need root access for the sampling.
a. add VTune bin path to PATH.
$ export PATH=$PATH:/opt/intel/vtune/bin
b. run vtl
$ vtl activity –c sampling –app a.out run
VTune will report that the activity was successfully created and the sampling data was successfully collected. You can use vtune for performance analysis now. Enjoy.
6. Use VTserver for performance analysis.
You may try to use vtlec for Eclipse GUI based performance analysis. However it may be failed to lunch on moblin system. A better solution is to use VTserver. You can connect to VTserver from your other window machine, run the application remotely and get the performance data.
a. start up the VTserver
$ vtserver
b. connect to the server from window machine.
Open Intel VTune performance analyzer on your windows machine. Click Activity->New Activity, select Sampling Wizard for example. Set up user:password@host-ip in Remote Target Configuration. Set the application to launch, for example, /home/moblin/test and click finish. The application /home/moblin/test will be executed on Moblin and the sampling data will be collected to your windows machine for performance analysis.
c. For more information, please refer to the VTune documents.
Install Intel VTune performance analyzer for Linux on Moblin system
For more complete information about compiler optimizations, see our Optimization Notice.
