How to use Intel® Inspector for Systems

Background

Intel® System Studio is the new embedded software tool suite and includes Intel® Inspector for Systems. This article will explain the steps you need to follow to run Inspector for Systems on an embedded platform.

Overview

We will use Yocto Project* version 1.2 as an example. This platform supports many Intel board support packages (BSP’s) and it also allows you to work without running any physical embedded hardware by letting you develop via an emulator that they provide. The following steps explain how to setup an application and then run an Intel® Inspector for Systems collection on it via the Yocto Project* emulator(runqemu).  Here are the steps we will take to run our collection:

  1. Setting up a Yocto Project* 1.2 environment.
    1. Cross compilers
    2. Yocto Project* pre-built kernel
    3. File system to NFS mount from host
  2. Install Intel System Studio
    1. Copy installation to root file system created above.
  3. Cross compiling the tachyon sample application
    1. Build the application
    2. Copy to root file system created above.
  4. Start a QEMU emulator session
    1. Login to emulator
    2. cd /home/root
  5. Run an Intel Inspector for Systems on the tachyon sample code
  6. On your Linux* host open the Inspector for Systems  results and view results in the Inspector for systems GUI

Setting up a Yocto Project* 1.2 environment

  1. Download the pre-built toolchain, which includes the runqemu script and support files
    download from: http://downloads.yoctoproject.org/releases/yocto/yocto-1.2/toolchain/
    1. The following tool chain tarball is for a 32-bit development host system and a 32-bit target architecture: poky-eglibc-i686-i586-toolchain-gmae-1.2.tar.bz2
    2. You need to install this tar ball on your Linux* host in the root “/” directory. This will create an installation area “/opt/poky/1.2”
  2. Downloading the Pre-Built Linux* Kernel:
    You can download the pre-built Linux* kernel (*zImage-qemu<arch>.bin OR vmlinux-qemu<arch>.bin).
    1.   http://downloads.yoctoproject.org/releases/yocto/yocto-1.2/machines/qemu/
      1. download: bzImage-qemux86.bi
      2. This article assumes this file is located ~/yocto/ bzImage-qemux86.bin
  3. Create a file system
    1. from: http://downloads.yoctoproject.org/releases/yocto/yocto-1.2/machines/qemu/
    2. Download core-image-sato-sdk-qemux86.tar.bz2
    3. source /opt/poky/1.2/environment-setup-i586-poky-linux 
      mkdir -p ~/yocto/file_system/
      runqemu-extract-sdk core-image-sato-sdk-qemux86.tar.bz2  ~/yocto/file_system/
    4. This will create a root file system that you can access for your host and emulated session.

Install Intel® Inspector 2013 for Systems

  1. Install Intel® System Studio on your Linux* host.
  2. Copy the Intel Inspector for Systems installation to the file system you created above.
    1. cp inspector_for_systems ~/yocto/file_system/home/root

Cross compiling the tachyon sample code

  1. The tachyon sample code is provided as part of the Inspector for Systems release.
  2. On your Linux* host      
    1. cd ~/yocto
    2. untar tachyon : tar xvzf /opt/intel/systems_studio_2013.0.xxx/inspector_for_systems/samples/en/C++/tachon_insp_xe.tgz
    3. You will need to modify the tachyon sample as follows:
    4. In the top level Makefile:  Comment the line containing CXX.
    5. The the lower level Makefile.gmake ('tachyon/common/gui/Makefile.gmake') Add the following lines:
UI = x
EXE = $(NAME)$(SUFFIX)
CXXFLAGS += -I$(OECORE_TARGET_SYSROOT)/X11
LIBS += -lpthread -lX11
#LIBS += -lXext
CXXFLAGS += -DX_NOSHMEM
  1. source /opt/poky/1.2/environment-setup-i586-poky-linux 
  2. e.      make
  3. f.        Copy the tachyon binary and the create libtbb.so file to ~/yocto/file_system/home/yocto/test

 

Start a QEMU emulator session

  1. source /opt/poky/1.2/environment-setup-i586-poky-linux 

  2. runqemu bzImage-qemux86.bin ~/yocto/file_system/

 

Run Intel® Inspector for Systems on the tachyon sample code

  1. Login to the QEMU emulator session
    1. User root no password
    2. cd /home/root/inspector_for_systems
  2. You should see the tachyon binaries and inspector directory in the file system copied from above.
  3. source /home/root/inspector_for_systems/inspxe-vars.sh
  4. Run an Inspector collection:

Create directory test; cd test

inspxe-cl –no-auto-finalize –collect mi2 ../tachyon_find_hotspots

Note: the above will perform a level 2 memory checking analysis.

Run inspxe-cl –collect help to see some other collections you can do.

On your Linux* host: Open the Inspector for Systems results

  1. You can view the results you create above on you Linux host. You should see a directory ~/yocto/file_system/home/root/test/r000mi2.
  2. To view these results in Intel® Inspector for Systems  on your Linux host
    1.  Source /opt/intel/system_studio_2014.0.xxx/inspector_for_systems/inspxe-vars.sh
    2.  inspxe-gui ~/yocto/file_system/home/root/test/r000mi2
    3. You should see the following results similar to the following:

 

Summary

Intel Inspector for Systems is a powerful tool for finding correctness errors in your code.  

Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.