Saturday, 27 June 2009

Getting more out of your kernel oops message.

A Kernel Oops message provides a range of debugging information: register dump, process state, and stack trace too. Sometimes the stack dump can be fairly long and the first lines can scroll off the top of a 25 line Virtual Console. To capture more of the oops message, try the following:

chvt 1
consolechars -f /usr/share/consolefonts/Uni1-VGA8.psf.gz

This switches to an 8 pixel high font, doubling the number of rows to 50.

Sometimes this is not sufficient, a stack dump may still scroll the top of the Oops message off the console. One trick I use is to rebuild the kernel with the stack dump removed, just to capture the initial Oops information. To do this, modify dump_stack() in arch/x86/kernel/dumpstack_*.c and comment out the call to show_trace(). It's a hack, but it works!

No comments:

Post a comment