Intel® Inspector Help

Inspecting Embedded Software

Intel Inspector for Systems is a powerful tool for finding correctness errors in your code. Intel® System Studio, the new embedded software tool suite, includes Intel Inspector for Systems.

This example uses Yocto Project* version 1.2 as the embedded OS. This platform supports many Intel® board support packages (BSP’s). Yocto Project* version 1.2 also allows you to develop using a provided emulator, so you can work without running any physical embedded hardware.

Quick Steps

Here are the steps you can use to set up Intel Inspector for Systems on an embedded platform, and then perform analysis and data collection using the Yocto Project* emulator (runqemu).

  1. Set up your Yocto Project 1.2 environment

  2. Install Intel System Studio

  3. Cross-compile the tachyon sample application

  4. Start a QEMU emulator session

  5. Run an analysis to inspect the tachyon sample code

  6. Open your result in the Intel Inspector GUI

Set up a Yocto Project 1.2 environment

  1. Set up cross compiler

    Download the pre-built toolchain - which includes the runqemu script and support files - from:

    http://downloads.yoctoproject.org/releases/yocto/yocto-1.2/toolchain/

    1. The following toolchain tar file 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. Install this tar file on your Linux* development host in the root “/” directory, to create an installation area /opt/poky/1.2.

  2. Download the Pre-Built Linux* Kernel

    Download the pre-built Linux* kernel - *zImage-qemu<arch>.bin or vmlinux-qemu<arch>.bin - from:

    http://downloads.yoctoproject.org/releases/yocto/yocto-1.2/machines/qemu/

    Note

    These instructions assume the downloaded Linux kernel PATHname is: ~/yocto/bzImage-qemux86.bin

  3. Create a root file system on the target

    Create a root file system on your target that you can access from your development host and emulated session.

    1. From:

      http://downloads.yoctoproject.org/releases/yocto/yocto-1.2/machines/qemu/

      Download the tar file containing the root filesystem image:

      core-image-sato-sdk-qemux86.tar.bz2

    2. Run the script to sets up your cross-development environment:

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

    3. Create the file system directory:

      mkdir -p ~/yocto/file_system/

      Note

      The OpenEmbedded build system does not support file or directory names that contain spaces. Be sure that your Source Directory name does not contain spaces.

    4. Extract the root file system into the file system directory:

      runqemu-extract-sdk core-image-sato-sdk-qemux86.tar.bz2 ~/yocto/file_system/

Install Intel Inspector for Systems

Install Intel System Studio components on both the development and target systems.

  1. Install Intel System Studio on your Linux* host development system.

  2. Copy the Intel Inspector for Systems installation to the root file system you created on the target:

    cp inspector_<version>_for_systems ~/yocto/file_system/home/root

Cross-compile the tachyon sample code

  1. Build the tachyon sample application. The tachyon sample code is provided in the Intel Inspector samples directory.

  2. On your Linux* development host:

    1. cd ~/yocto

    2. Extract the tachyon sample from the tar file:

      tar xvzf /opt/intel/systems_studio_<version>/inspector_for_systems/samples/en/C++/tachon_insp_xe.tgz

    3. You will need to modify the tachyon sample as follows:

      1. In the top-level Makefile, comment out the line containing CXX.

      2. In 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
        		

  3. Perform the following commands in order:

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

    2. make

  4. Copy the tachyon binary and the libtbb.so file to:

    ~/yocto/file_system/home/yocto/test

Start a QEMU emulator session

Perform the following commands in order:

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

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

Run an analysis to inspect the tachyon sample code

  1. Login to the QEMU emulator session.

    cd /home/root/inspector_for_systems

  2. You should see the tachyon binaries and Inspector directory in the file system copied from above.

    source /home/root/inspector_for_systems/inspxe-vars.sh

  3. Run an Intel Inspector analysis.

    1. Create a working directory called test, and then change to that directory.

      cd test

    2. Perform a memory error analysis using the mi2 analysis type:

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

Tip

Use the command line help to see all the different types of analysis you can do with Intel Inspector: inspxe-cl –collect help

Open your result in the Intel Inspector GUI

View the result you just created on your Linux host. In this example, the directory is: ~/yocto/file_system/home/root/test/r000mi2.

  1. Run the script that sets your command line environment variables:

    source /opt/intel/system_studio_<version>/inspector_<version>_for_systems/inspxe-vars.sh

  2. Launch Intel Inspector from the command line, specifying the result directory r000mi2:

    inspxe-gui ~/yocto/file_system/home/root/test/r000mi2

The result opens in the GUI, where you can view and manage any detected memory problems.