From Fedora Project Wiki
No edit summary
(Minor edits to correct style and mention that the CONFIG_BOOT_PRINTK_DELAY option has to be enabled when building the Linux kernel.)
 
Line 1: Line 1:
= What does early mean exactly? =
= What does early mean exactly? =
For the purposes of this wiki, 'early' means before userspace comes up. Once userspace is available, there are many more options for saving the kernel panics. This can also be used for panics that happen while initializing
For this article, ''early'' means before userspace comes up. Once userspace is available, there are many more options for saving the kernel panics, and this can also be used for panics that happen while initializing.


= Getting more information =
= Getting more information =
A common situation is to see the tail end of a kernel panic but not enough of it. You can add options to the kernel command line to see what else is going on.
A common situation is to see the tail end of a kernel panic but not enough of it. You can add options to the kernel command line to see what else is going on.


First, you need to get the lpj (loops per jiffie) of your system:
First, you need to get the `lpj` (''loops per jiffie'') of your system:


<pre>
<pre>
Line 12: Line 12:
</pre>
</pre>


The lpj from this example is 2693655. Your lpj will probably be different.
The `lpj` value from this example is `2693655`. Your `lpj` will probably be different.


Append the following to the kernel command line of the kernel you want to debug
Append the following to the kernel command line of the kernel you want to debug:
<pre>
<pre>
lpj=<value you extracted> loglevel=7 boot_delay=<delay in ms>
lpj=<value you extracted> loglevel=7 boot_delay=<delay in ms>
</pre>
</pre>


For details: lpj sets the loops per jiffie. This is used to have delays early. loglevel=7 ensures all kernel messages get printed. bootdelay=$value adds a delay after each kernel message. The result is that all kernel messages should be printed out at a rate that can be read. You will have to experiment with the value for bootdelay, try starting with 50 and adjust it up or down depending on your needs.
For details: `lpj` sets the ''loops per jiffie'' - this is used to have delays early. `loglevel=7` ensures all kernel messages get printed. `boot_delay=<delay in ms>` adds a delay after each kernel message. The result is that all kernel messages should be printed out at a rate that can be read. You will have to experiment with the value for `boot_delay`. Try starting with 50 and adjusting it up or down, depending on your needs.


'''NOTE''' using bootdelay will slow down your system bootup. You may see a long delay before the kernel messages come out. Be patient!
'''NOTE''' using `boot_delay` requires the kernel to be built with the `CONFIG_BOOT_PRINTK_DELAY` option ''enabled'', and using this kernel boot parameter will significantly slow down your system startup. You may see a long delay before the kernel messages come out. Be patient!

Latest revision as of 17:47, 23 January 2023

What does early mean exactly?

For this article, early means before userspace comes up. Once userspace is available, there are many more options for saving the kernel panics, and this can also be used for panics that happen while initializing.

Getting more information

A common situation is to see the tail end of a kernel panic but not enough of it. You can add options to the kernel command line to see what else is going on.

First, you need to get the lpj (loops per jiffie) of your system:

$ dmesg | grep lpj
[    0.000062] Calibrating delay loop (skipped), value calculated using timer frequency.. 5387.31 BogoMIPS (lpj=2693655)

The lpj value from this example is 2693655. Your lpj will probably be different.

Append the following to the kernel command line of the kernel you want to debug:

lpj=<value you extracted> loglevel=7 boot_delay=<delay in ms>

For details: lpj sets the loops per jiffie - this is used to have delays early. loglevel=7 ensures all kernel messages get printed. boot_delay=<delay in ms> adds a delay after each kernel message. The result is that all kernel messages should be printed out at a rate that can be read. You will have to experiment with the value for boot_delay. Try starting with 50 and adjusting it up or down, depending on your needs.

NOTE using boot_delay requires the kernel to be built with the CONFIG_BOOT_PRINTK_DELAY option enabled, and using this kernel boot parameter will significantly slow down your system startup. You may see a long delay before the kernel messages come out. Be patient!