I'm writing some code with printk [i'm printing while in kernel mode] , but because dmesg is too small I'm losing the first few printk's.
How can I increase the size of dmesg ?
thanks in advance for the help!
You need to set CONFIG_LOG_BUF_SHIFT
during compile time. The size of the buffer can not be modified in run time.
The size of the buffer is 2^CONFIG_LOG_BUF_SHIFT
bytes
You can use the log_buf_len
kernel parameter at boot time to set the kernel's printk()
ring buffer size.
See: https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt
(You mentioned Linux 2.4; I don't know whether log_buf_len
was present in Linux 2.4, which is very old.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With