Intel® Inspector Help
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.
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).
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/
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
Install this tar file on your Linux* development host in the root “/” directory, to create an installation area /opt/poky/1.2.
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/
These instructions assume the downloaded Linux kernel PATHname is: ~/yocto/bzImage-qemux86.bin
Create a root file system on your target that you can access from your development host and emulated session.
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
Run the script to sets up your cross-development environment:
source /opt/poky/1.2/environment-setup-i586-poky-linux
Create the file system directory:
mkdir -p ~/yocto/file_system/
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.
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 System Studio components on both the development and target systems.
Install Intel System Studio on your Linux* host development system.
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
Build the tachyon sample application. The tachyon sample code is provided in the Intel Inspector samples directory.
On your Linux* development host:
cd ~/yocto
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
You will need to modify the tachyon sample as follows:
In the top-level Makefile, comment out the line containing CXX.
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
Perform the following commands in order:
source /opt/poky/1.2/environment-setup-i586-poky-linux
make
Copy the tachyon binary and the libtbb.so file to:
~/yocto/file_system/home/yocto/test
Perform the following commands in order:
source /opt/poky/1.2/environment-setup-i586-poky-linux
runqemu bzImage-qemux86.bin ~/yocto/file_system/
Login to the QEMU emulator session.
cd /home/root/inspector_for_systems
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
Run an Intel Inspector analysis.
Create a working directory called test, and then change to that directory.
cd test
Perform a memory error analysis using the mi2 analysis type:
inspxe-cl –no-auto-finalize –collect mi2 ../tachyon_find_hotspots
Use the command line help to see all the different types of analysis you can do with Intel Inspector: inspxe-cl –collect help
View the result you just created on your Linux host. In this example, the directory is: ~/yocto/file_system/home/root/test/r000mi2.
Run the script that sets your command line environment variables:
source /opt/intel/system_studio_<version>/inspector_<version>_for_systems/inspxe-vars.sh
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.