Installing and Using Intel® VTune™ Amplifier XE 2011 with the Intel AppUp™ SDK Suite for MeeGo*

The Intel® VTune™ Amplifier XE with the Intel AppUp™ SDK Suite for MeeGo* available at http://appdeveloper.intel.com/meego-sdk-suite, provides information on code performance for users developing serial and multithreaded applications on the MeeGo* operating system for Intel® Architecture Processors, including Intel® Atom™ Processors. There is a Standalone GUI provided for both Windows* and Linux* Hosts. On the MeeGo Target system, you collect data using the command-line interface.

VTune Amplifier XE helps you analyze the algorithm choices and identify where and how your application can benefit from available hardware resources. Use the VTune Amplifier XE to locate or determine the following:

  • The most time-consuming (hot) functions in your application and/or on the whole system
  • Sections of code that do not effectively utilize available processor time
  • The best sections of code to optimize for sequential performance and for threaded performance
  • Synchronization objects that affect the application performance
  • Whether, where, and why your application spends time on input/output operations
  • The performance impact of different synchronization methods, different numbers of threads, or different algorithms
  • Thread activity and transitions
  • Hardware-related bottlenecks in your code

 

What is included

When you download Intel® VTune™ Amplifier XE 2011 package, you will receive a zip (l_amplxe_meego_2011.version.zip) file with four included files.

Two Primary Files

  • VTune_Amplifier_XE_Meego_2011_setup.exe
    This installer will install the VTune Amplifier XE GUI on the Windows* Operating System.
  • vtune_amplifier_xe_meego_2011.tar.gz
    This installer is used both for installing the VTune Amplifier XE GUI for the Linux* Host Operating System and the VTune Amplifier XE command Line on the MeeGo target Device which allows you to do hardware-based sampling using event-based sampling (EBS) and User-mode Sampling and Tracing.

Additional Files:

  • Readme.txt
  • sep34_ia32_meego_2011.tar.gz
    This is an alternate command-line hardware event-based sampling collector for Intel® VTune™ Amplifier XE 2011 on the MeeGo Target. This Guide does not cover usage and installation of SEP.  Included within the SEP package are several text files explaining the usage and installation of SEP.  After unpacking the package on the target system, please refer to the README.TXT file for details.

Installing Intel® VTune™ Amplifier XE 2011 for MeeGo

There are two steps to installing

  1. Install the GUI on the Windows* or Linux* Host Development System
  2. Install the Command Line on the MeeGo Target Device

Installing the GUI on the Windows* or Linux* Host Development System

Option 1) Install The GUI on the Windows* Host Development System

  1. Extract or copy VTune_Amplifier_XE_MeeGo_2011_setup.exe from l_amplxe_meego_2011.version.zip to a directory of your choice on the Windows Host System.
  2. Launch the installer, and proceed through the prompts

Option 2) Install The GUI on the Linux* Host Development System

  1. Extract or copy vtune_amplifier_xe_meego_2011.tar.gz from l_amplxe_meego_2011.version.zip to a directory of your choice on the Linux Host System.
    unzip  l_amplxe_meego_2011.version.zip
  2. Extract the tar file:
    tar –zxvf vtune_amplifier_xe_meego_2011.tar.gz
  3. Change to the extracted directory
    cd vtune_amplifier_xe_meego_2011
  4. Launch the installer and proceed through the prompts
    ./install.sh

Optional: For MeeGo analysis there is no need to install the event-based sampling driver on the Host. This option only work if you additionally have a license for using Intel VTune Amplifier XE for Windows or Linux. You can do a custom installation and deselect these options.

Installing the command line collector on the MeeGo Target Device

  1. Extract  vtune_amplifier_xe_meego_2011.tar.gz from l_amplxe_meego_2011.version.zip to a directory of your choice on the Host Development System.
    unzip l_amplxe_meego_2011.version.zip
  2. Extract the Command Line Installer directory (CLI_install) from the vtune_amplifier_xe_meego_2011.tar.gz
    Note: On Windows one method for doing this is to use gunzip and tar provided within the MADDE terminal:
    gunzip vtune_amplifier_xe_meego.tar.gz
    tar –xvf vtune_amplifier_xe_meego.tar
    Note: While you may copy/install all of the Intel VTune Amplifier XE 2011 for MeeGo (vtune_amplifier_xe_meego.tar.gz) which includes the Linux GUI to the MeeGo target, typically the display of a MeeGo Device will not support the required resolution for the standalone GUI, and this was not the usage model we designed our tool for.  Therefore to save space on the MeeGo target device it is advisable to not install the Intel VTune Amplifier XE GUI.
  3. Copy the Command Line Installer to the MeeGo Target
    Note: One Method for doing this is to use scp provided with most versions of Linux and with the MADDE terminal on Windows:
    scp –r vtune_amplifier_xe_meego_2011/CLI_install root@XX.XX.XX.XX:.
  4. Get to a terminal window on the MeeGo Target Device
    I recommend using a ssh client from the Host Development System (MADDE provided with the the MeeGo* SDK comes with a simple ssh client and so do most standard Linux distributions). But you can also launch a terminal directly on the Device, or use other 3rd party ssh clients.
    ssh root@XX.XX.XX.XX
  5. Launch the installer and proceed through the prompts
    CLI_install/install.sh
    Potential Issue: It is possible that during installation the sampling driver failed to install.

Intel VTune Amplifier XE has 2 collection technologies.

  • Hardware Event-based Sampling Analysis (lightweight-hotspots, Advanced Analysis types)
  • User-Mode Sampling and Tracing Analysis (hotspots, concurrency, and locks and waits)

Hardware Event Based Sampling Analysis requires the Sampling Driver to be installed into the Kernel, which is specific to the Kernel Version. The Installer comes with some prebuilt kernels for the MeeGo OS. If a prebuilt kernel is not available you have 2 choices:

  1. Do not install the Sampling Driver
    Note: User-Mode Sampling and Tracing Analysis  does not require this sampling driver and allows you to do most of the functionality of VTune Amplifier XE, including collecting hotspots, concurrency, and locks and waits.
  2. Build a sampling driver for your kernel
    This requires Kernel Sources for the kernel installed on the system, gcc, and make. The easiest way to get this is to use zypper on the MeeGo Device to install these packages. For example, if “uname –r” reports version “2.6.35.3-10.3-netbook”, then use the following zypper commands obtain the proper build environment your kernel:

zypper install kernel-netbook-devel-2.6.35.3-10.3

zypper install gcc

zypper install make

Now build and install the sampling driver,

cd /opt/intel/vtune_amplifier_xe/sepdk/src

./build-driver –ni -install-dir=../prebuilt

cd ../prebuilt

./insmod-sep3 -r -g myGroup

./boot-script -i -g myGroup

where “myGroup” is the name of the user group that can perform sampling on the system. To find which group you are a member of, type “/usr/bin/groups”.

For Advanced Users: If you are using a Linux Host, another option for creating a prebuilt driver is to, get the Kernel Sources for the MeeGo kernel onto the Linux Host, build the driver there, then copy the prebuilt driver to /opt/intel/vtune_amplifier_xe/sepdk/prebuilt


Preparing the Application and MeeGo* System for Analysis

Now that the Intel VTune Amplifier XE is installed on both the Host and the MeeGo Target, you will need to [optionally] prepare your binary and system so that you can see the functions & source in which your application is spending time.

Preparing The Application for Analysis

For best results, the application and the system must meet some criteria to get useful results from Amplifier XE.

Released/Optimized Build

This is fairly easy, switch Qt Creator to create a Released Build.

Note: Analyzing the Performance of an application compiled with no optimizations (debug) has a high probability of producing misleading results.

Symbols for your Application

Add the following options to your .pro file

QMAKE_CXXFLAGS+=-g
QMAKE_CFLAGS+=-g
QMAKE_STRIP=””

Symbols are required so that you can see the functions & source lines in which your application is spending time, and so that Intel VTune Amplifier XE can find the source code for those functions.

Note: Later during the Analysis Phase – you will need the “exact” binary and Source code in which you performed Analysis on the Host Development System. Rebuilding or Changing Source lines after you perform analysis – can alter the binary so that it is not the exact binary/source. This can result in Intel VTune Amplifier XE being unable to show you the source code or disassembly. You may want to make a backup copy of the binary/sources that you are about to do analysis on.

Enabling Intel® Threading Building Blocks for Intel VTune Amplifier XE

If using Intel Threading Building Blocks in your application add the following line to your Project file:

DEFINES += TBB_USE_THREADING_TOOLS

The VTune Amplifier XE recognizes all types of Intel TBB synchronization objects.  If you assign a meaningful name to an object you create in the source code, the VTune Amplifier XE recognizes and represents it in the Result tab.  For performance reasons, this functionality is not enabled by default in Intel TBB headers.  To make the user-defined objects visible to the VTune Amplifier XE, add the above define to your project file and recompile.

Preparing the Target System for Analysis

Acquiring Symbols for any OS components in which your application spends time.

Intel® VTune™ Amplifier XE can only show you source lines if the samples it collects are are in a binary which has symbols.  If your application does not spend much time in binaries supplied by the OS (examples: libc, libm, codecs, video driver, etc), then it is not necessary to complete this step.  The easiest way to provide these symbols is downloading all symbols for the entire OS onto your MeeGo Device using the following commands:

zypper mr -e core-debuginfo 

zypper install *debuginfo*

This will install ~9GB worth of Symbols onto your target device.

Another option is to install just the symbols for packages that your binary will use, or that you are interested in: Example – if you know that your application will spend a lot of time in libm calling sin you could download those symbols only:

zypper install  `rpm -qf --queryformat "%{NAME}" /lib/libm.so.6`-debuginfo

Put the Released Application with Symbols onto the MeeGo Target Device

This can be done many ways, the most common way will be to run the application from within Nokia’s Qt Creator. Choose Build: run from within Nokia’s Qt Creator. This packages your application and installs it onto the target device. Additionally, it runs your application (a nice check before the next step of running VTune Amplifier XE to collect Data on your Application).


Collecting Performance Data

Collecting performance data involves the following steps:

  • Get to a terminal window on the MeeGo Target Device
    I recommend using a ssh client from the Host Development System (MADDE provided with the the MeeGo* SDK comes with a simple ssh client and so do most standard Linux distributions). But you can also launch a terminal directly on the Device, or use other 3rd party ssh clients.

    ssh root@XX.XX.XX.XX

  • [Optional] make it easier to launch Intel VTune Amplifier XE
    source /opt/intel/vtune_amplifier_xe_2011/amplxe-vars.sh
  • Collect Data
    amplxe-cl -collect hotspots -- myapp parameters 
    Note: this will create a results directory… something like: r00#hs

 

  • Copy the results back to the Host
    I recommend using a scp client from the Host Development System (MADDE provided with the the MeeGo* SDK comes with a simple scp client). But there are many tools on the market to accomplish this task.

    from within a MADDE terminal on the host
    scp -r root@XX.XX.XX.XX:path-to-results-on-host/r000hs /path-on-host-system/
  • Open the results file on the Host
    Launch Intel® VTune™ Amplifier XE and Open the Results via File:Open:Result…

Using the GUI

Now that you have opened the results you should see something similar to the following:

One last step – when you drill down into a function. You may see a prompt similar to the following:

You will need to supply the path and location to that file. If the binary it is asking for is your application it will be in the following locations:

  • If you have not rebuilt your application, Qt Creator will have 1 copy of the binary on the Host system, in the project directory
  • The binary will also be on the target system and can be copied to the Host System through the same scp mechanism as used for the results file described in the previous chapter.
  • If you made a backup of the binary/source like described earlier in this document you can use that

After you point Intel VTune Amplifier XE to the binary you will be able to drill into your source:

0