Appendix: how to debug the linux kernel – Digilent Embedded Linux User Manual
Page 17

Using Zynq with Linux
www.digilentinc.com
page 17 of 23
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
APPENDIX: How to Debug the Linux Kernel
Things may go wrong during your development
– the kernel may panic and become dead without any
notice during boot; there may be no messages that appear on your terminal; the kernel may say
“Oops” at any time; or your system does not work as you expect. If you believe a bug in the Kernel
source is responsible for an error,
you may file a bug report to us via the email link on our Developer’s
Before filing a bug report, Digilent Inc. recommends that you do some debugging yourself to try and
locate the problem. We encourage our users to file a bug-fix patch if you can locate and solve any
problems with the software.
This appendix section presents some easy ways to debug the kernel.
Debugging Support in Kernel
The kernel provides debugging support in its configuration settings that allow you to print out more
detailed messages and information about bugs in the software. Debugging support is generally not
enabled on deployment, because designers try to optimize the kernel for speed of execution,
especially on embedded systems with limited computing resources.
Table 1 presents a list of commonly used debugging support configurations that you should consider
to enable during your development:
Name
Menu Location
Description
CONFIG_DEBUG_DRI
VER
Device Driver ->
Generic Driver Options
Input a Y here if you want the Driver core to produce a
bunch of debug messages to the system log. Choose
this selection if you are having a problem with the driver
core and want to see more of what is happening.
CONFIG_DEBUG_DRV
RES
Device Driver ->
Generic Driver Options
This option enables kernel parameter devres.log. If
set to non-zero, devres.log debug messages are
printed. Select this if you are having a problem with
devres.log or want to debug resource management
for a managed device.
CONFIG_DEBUG_KER
NEL
Kernel Hacking
Input Y here if you are developing drivers or trying to
debug and identify kernel problems
CONFIG_DEBUG_BUG
VERBOSE
Kernel Hacking
Input Y here to make BUG() panics output the file name
and line number of the BUG() call as well as the EIP
and Oops trace.
CONFIG_DEBUG_INF
O
Kernel Hacking
If you type Y here the resulting kernel image will include
debugging info resulting in a large kernel image. This
adds debug symbols to the kernel and modules, and is
needed if you intend to use kernel crashdump or binary
object tools like crash, kgdb, LKCD, gdb etc on the
kernel. Say Y here only if you plan to debug the kernel.
CONFIG_EARLY_PRI
NTK
Kernel Hacking->
Kernel Low-level debugging
functions
Say Y here if you want to have an early console using
kernel low-level debugging functions. Add
earlyprintk to your kernel parameter to enable this
console.
Table 1. Common Debugging Support Configurations