You copied the Doc URL to your clipboard.

Profiling the Linux kernel

If you do not include the kernel in the images in the Capture & Analysis Options dialog box, the statistics generated by the kernel are not aligned with source code in the Analysis Reports. Before you can include the Linux kernel in the Program Images section of the Capture & Analysis Options dialog, you must build a version of vmlinux with kernel debug information enabled.

To profile the Linux kernel, follow these steps:


  1. Enter the following command to change a menu setting:

    make ARCH=arm CROSS_COMPILE=${CROSS_TOOLS}/bin/arm-linux-gnueabihf- menuconfig

  2. In the Kernel Hacking menu, select the Compile the kernel with debug info option. This enables CONFIG_DEBUG_INFO.
    This option is in addition to the required options described in the Required kernel configuration menu options reference topic.
  3. Enter the following command to build the image:

    make -j5 ARCH=arm CROSS_COMPILE=${CROSS_TOOLS}/bin/arm-linux-gnueabihf- uImage

    This creates a new vmlinux image.


    You can profile drivers using this method. Statically link the driver into the kernel image or add the module as an image in the Capture & Analysis Options dialog box.
  4. Optional: Enable kernel stack unwinding using either of the following methods:
    • Remove the comment tags that surround GATOR_KERNEL_STACK_UNWINDING in the Makefile and rebuild gator.ko.

    • Run the following command as root on the target after gatord has started:

      echo 1 > /sys/module/gator/parameters/kernel_stack_unwinding


    • This step is only required if you previously built gator.ko with kernel stack unwinding turned off.

    • Enabling kernel stack unwinding might trigger errors that appear at millisecond intervals during the capture session. If you experience this behavior, disable kernel stack unwinding.

  5. Open the Streamline Data view if it is not already open. Select Window > Show View > Other... and choose Streamline Data from the list of views.
  6. Open the Capture & Analysis Options dialog box.
  7. Click the Add ELF image... button in the Program Images section.
  8. Navigate to your vmlinux file and select it.
  9. Click OK
  10. Start a new capture session.