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:
- Navigate to the kernel build directory.
Enter the following command to enable you to change
make ARCH=arm CROSS_COMPILE=<
In the Kernel Hacking
menu, select the Compile the kernel with debug
info option. This enables the
CONFIG_DEBUG_INFOkernel option.The options described in Required kernel configuration menu options must also be enabled.
Enter the following command to build the image:
make -j5 ARCH=arm CROSS_COMPILE=<
cross_compiler_directory>/bin/arm-linux-gnueabihf- uImageResults: This creates a new vmlinux image.
NoteYou can profile a driver by either statically linking it into the kernel image or by adding the module as an image in the Capture & Analysis Options dialog box.
Enable kernel stack unwinding using either of the following
Remove the comment tags that surround
GATOR_KERNEL_STACK_UNWINDINGin the Makefile and rebuild gator.ko.
Run the following command as root on the target after
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.
- Open the Capture & Analysis Options dialog box.
- Click the Add ELF image... button in the Program Images section.
- Navigate to your vmlinux file and select it.
- Click OK
- Start a new capture session.