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 currently recommend that you run Intel Inspector for Systems on your host and not on your embedded system. However, analyzing on an embedded system is possible. 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:
- Setting up a Yocto Project* 1.2 environment.
- Cross compilers
- Yocto Project* pre-built kernel
- File system to NFS mount from host
- Install Intel System Studio
- Copy installation to root file system created above.
- Cross compiling the tachyon sample application
- Build the application
- Copy to root file system created above.
- Start a QEMU emulator session
- Login to emulator
- cd /home/root
- Run an Intel Inspector for Systems on the tachyon sample code
- 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
- 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/- 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
- 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”
- Downloading the Pre-Built Linux* Kernel:
You can download the pre-built Linux* kernel (*zImage-qemu<arch>.bin OR vmlinux-qemu<arch>.bin).- http://downloads.yoctoproject.org/releases/yocto/yocto-1.2/machines/qemu/
- download: bzImage-qemux86.bi
- This article assumes this file is located ~/yocto/ bzImage-qemux86.bin
- http://downloads.yoctoproject.org/releases/yocto/yocto-1.2/machines/qemu/
- Create a file system
- from: http://downloads.yoctoproject.org/releases/yocto/yocto-1.2/machines/qemu/
- Download core-image-sato-sdk-qemux86.tar.bz2
- 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/ - This will create a root file system that you can access for your host and emulated session.
Install Intel® Inspector for Systems
- Install Intel® System Studio on your Linux* host.
- Copy the Intel Inspector for Systems installation to the file system you created above.
- cp inspector_for_systems ~/yocto/file_system/home/root
Cross compiling the tachyon sample code
- The tachyon sample code is provided as part of the Inspector for Systems release.
- On your Linux* host
- cd ~/yocto
- untar tachyon : tar xvzf /opt/intel/systems_studio_2013.0.xxx/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 the line containing CXX.
- 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
- source /opt/poky/1.2/environment-setup-i586-poky-linux
- e. make
- f. Copy the tachyon binary and the create libtbb.so file to ~/yocto/file_system/home/yocto/test
Start a QEMU emulator session
source /opt/poky/1.2/environment-setup-i586-poky-linux
runqemu bzImage-qemux86.bin ~/yocto/file_system/
Run Intel® Inspector for Systems on the tachyon sample code
- Login to the QEMU emulator session
- User root no password
- 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 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
- You can view the results you create above on you Linux host. You should see a directory ~/yocto/file_system/home/root/test/r000mi2.
- To view these results in Intel® Inspector for Systems on your Linux host
- Source /opt/intel/system_studio_2014.0.xxx/inspector_for_systems/inspxe-vars.sh
- inspxe-gui ~/yocto/file_system/home/root/test/r000mi2
- 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.