Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the size of dmesg ? [linux 2.4]

Tags:

linux-kernel

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!

like image 866
Belgi Avatar asked Jan 19 '23 09:01

Belgi


2 Answers

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

like image 116
Kimvais Avatar answered Jan 24 '23 22:01

Kimvais


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.)

like image 42
Mark Seaborn Avatar answered Jan 24 '23 22:01

Mark Seaborn