Profiling the Linux kernel
If you do not include the kernel in the images in the capture 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 options dialog, you must build a version of
vmlinux with kernel debug information enabled.
To profile the Linux kernel, follow these steps:
- Enter the following command to change a menu setting: make ARCH=arm CROSS_COMPILE=$(CROSS_TOOLS}/bin/arm-linux-gnueabihf- menuconfig
- In the Kernel Hacking menu, enable the Compile the kernel with debug info option.
Enter the following command to build the image: make -j5 ARCH=arm
This creates a new
NoteYou can profile drivers using this method. Statically link the driver into the kernel image or add the module as an image in the capture options dialog box.
To perform kernel stack unwinding and module unwinding, edit the Makefile to enable
NoteUnless you build gator.ko with kernel stack unwinding specifically turned on, the data related to the kernel in the Call paths view appears flat. It does represent an accurate call hierarchy.
GATOR_KERNEL_STACK_UNWINDINGby removing the comment tags that surround it in the
NoteEnabling 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 Streamline Data view if it is not already open. Select Window > Show View > Other... and choose Streamline Data from the list of views.
- Click the Capture options button to open the Capture & Analysis dialog box.
- Click the Add ELF image... button in the Program Images section.
- Navigate to you vmlinux file and select.
- Click OK
- Start a new capture session.