Intel® VTune™ Amplifier

Using Debug Information

Intel® VTune™ Amplifier requires debug information for the binary files it analyzes. To obtain accurate performance data and enable source analysis, make sure to:

Debug Information for Kernel and System Libraries

For successful performance analysis of the kernel and system libraries, you need to download and install debug info packages available for your system version. After installing the Linux* operating system, the kernel is contained in vmlinux, or vmlinuz, or bzImage in /boot. Linux vendors typically release compressed kernel files stripped of symbols (vmlinuz or bzImage). vmlinux is the uncompressed Linux kernel, but it does not include debug information. So, by default the VTune Amplifier cannot retrieve kernel function information from these kernels and presents all hot addresses captured in the kernel as a unique function or module named [vmlinux].

However, some vendors have released special debug versions of their kernels that are suitable for performance analysis.

To download and install available debug kernel versions:

  1. Use the uname -r command to identify the running Linux kernel version.

  2. Download and install two RPMs matching your system: kernel-debug-debuginfo-*.rpm and kernel-debuginfo-common-*.rpm. To do this, use any of the following options:

    • Browse through the RPMs on your installation CDs or DVDs. For example, for SuSE Linux Enterprise* 9, 10, and 11 distros, SuSE provides "debug" kernel RPMs (kernel-debug-*.rpm) available on the install CD or from the website. After installing the RPM, the debug version of the kernel file is located under /boot/vmlinux-*-debug or under /boot/vmlinuz-*-debug. You need to manually uncompress this kernel file using the gunzip program.

    • Browse through the OS vendor FTP site and download the packages. For example: look at ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os to get packages for Redhat* Enterprise Server.

    • Look for other sources on the internet. For example, for Red Hat Enterprise* Linux 3, 4 and 5 distros, Red Hat provides debuginfo RPMs at http://people.redhat.com/duffy/debuginfo/. After installing the RPM, the debug version of the kernel file is located under /usr/lib/debug/boot (EL 3) or /usr/lib/debug/lib/modules (EL 4, 5).

  3. Use the following commands to install the RPMs:

    > rpm -ivh kernel-debuginfo-common-*.rpm
    > rpm -ivh kernel-debug-debuginfo-*.rpm

    For some operating systems, you can use yum to install packages directly, for example:

    > yum --enablerepo=rhel-debuginfo install kernel-debuginfo
  4. Verify that the packages have been installed, for example:

    > rpm -qa|grep kernel
  5. Modify the VTune Amplifier target properties and specify the path to the uncompressed kernel binary in the Binary/Symbol Search dialog box, for example: /usr/lib/debug/lib/modules/2.6.18-128.el5debug/.

Typically, to resolve symbols for the kernel module, the VTune Amplifier uses the System.map file created during the kernel build and shipped with the system by default. If the VTune Amplifier cannot find the System.map file, you may add it to the list of search directories in the Binary/Symbol Search dialog box when configuring your target properties.

To build the kernel with debug information:

  1. Configure the kernel sources.

  2. Edit the kernel source top-level Makefile and add the -g option to the following variables:

    CFLAGS_KERNEL := -g

    CFLAGS := -g

  3. Run make clean; make to create the vmlinux kernel file with debug information. Once a debug version of the kernel is created or obtained, specify that kernel file as the one to use during performance analysis.

As soon as the debug information is available for your kernel modules, any future analysis runs will display the kernel functions appropriately. To resolve the previously collected data against this new symbol information, update the project search directories and click the Re-resolve button to apply the changes.

Debug Information for Application Binaries

Compile your code using the -g option that usually produces debugging information in the DWARF format. If DWARF is not a default debugging information format for the compiler, use the -gdwarf-version option, for example: -gdwarf-2 or -gdwarf-3.

Note

VTune Amplifier supports two ways of specifying a separate debug info file for an ELF executable/library binary:

  • If an executable file in the ELF format contains a build ID and has a separate debug info file with the name generated by the build ID, the VTune Amplifier is able to find and validate the separate symbol file if proper search directories are set. While searching the symbol file, the VTune Amplifier checks the .build-id subdirectory of each search directory for a file named hh/hhhhhhhhhhh.debug where hh is the first 2 hexadecimal characters of build ID and hhhhhhhhhhh is the remaining part.

  • If an executable file contains a debug link (specified in the .gnu_debuglink section) with a name of separate debug info file, VTune Amplifier tries to find it.

Please refer to the Binutils documentation for more details on how to create separate debug info files and link them with an executable/library via debug link or build ID.

Check the Results

If your system and application modules have debug information, the VTune Amplifier is able to provide full-scale statistics on call stacks, source data, and so on. For example, you may use the Call Stack Mode on the filter toolbar to select the User/system functions option and view data on both user and system functions.

If the VTune Amplifier does not find debug information for the binaries, it statically identifies function boundaries and assigns hotspot addresses to generated pseudo names func@address for such functions, for example:

If a module is not found or the name of a function cannot be resolved, the VTune Amplifier displays module identifiers within square brackets, for example: [vmlinux].

If the debug information is absent, the VTune Amplifier may not unwind the call stack and display it correctly in the Call Stack pane. Additionally in some cases, it can take significantly more time to finalize the results for modules that do not have debug information.

See Also