Advanced Customizations
ARM DUI 0482K
Copyright © 2010-2012 ARM. All rights reserved.
11-10
ID120712
Non-Confidential
11.4
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 To build a
version of the kernel that you use in profiling, 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.
Under Kernel Hacking, enable the
Compile the kernel with debug info
option.
3.
Insert the following command to build the image:
make -j5 ARCH=arm CROSS_COMPILE=${CROSS_TOOLS}/bin/arm-linux-gnueabihf- uImage
In the capture options dialog box, define the newly created
vmlinux
image in the Images section.
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 options dialog box.
11.4.1
Kernel stack unwinding
Unless 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.
To perform kernel stack unwinding and module unwinding, edit the Makefile to enable
GATOR_KERNEL_STACK_UNWINDING
and rebuild
gator.ko
. To do this, open the makefile in the editor
of your choice and remove the comment tags that surround the
GATOR_KERNEL_STACK_UNWINDING
command.
Note
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.
11.4.2
See also
Tasks
•
•
Customize reports using Annotate
•
Creating custom performance counters
Reference
•
•
.