Skip to Content
Linux Kernel in a Nutshell
book

Linux Kernel in a Nutshell

by Greg Kroah-Hartman
December 2006
Intermediate to advanced
202 pages
8h 29m
English
O'Reilly Media, Inc.
Content preview from Linux Kernel in a Nutshell

Kernel debugging

A wide range of different kernel options can help in debugging what is going on within the kernel. Following is a list of some of the more common ones that can be useful for discovering new things about how the kernel works, or help find potential problems within the current kernel source code.

Kernel log timestamps

The kernel outputs a wide range of messages to its log file. These messages can be seen by looking at the system log file (usually located in /var/log/messages), or by running the dmesg command.

Sometimes it is useful to see exactly when those messages were created. dmesg, however, does not put any timestamps on the events it shows, and the time resolution of /var/log/messages is only to the nearest second. You can configure the kernel to assign each message a timestamp that is accurate down to the smallest measurable kernel time value (usually in the microsecond range.)

To enable timestamp options on kernel messages:

Kernel hacking
    [*] Show timing information on printks

Magic SysRq keys

The SysRq key on the keyboard can be used to control the kernel in a number of different ways while the kernel is running, or after it has crashed.

To enable this option:

Kernel hacking
    [*] Magic SysRq key

For a full description of the different actions that can be triggered by this option, please see the file Documentation/sysrq.txt in the kernel source tree.

Debug Filesystem

A RAM-based filesystem can be used to output a lot of different debugging information. This filesystem ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Kernel Development, Third Edition

Linux Kernel Development, Third Edition

Robert Love

Publisher Resources

ISBN: 0596100795Supplemental ContentErrata