We normally do cat /proc/kmsg or dmesg to see the kernel logs from user space.
I understand the dmesg is a circular buffer which copies from kmsg. But is kmsg also not a circular buffer?
What is the difference and relation between them?
We normally do cat /proc/kmsg or dmesg to see the kernel logs from user space.
I understand the dmesg is a circular buffer which copies from kmsg. But is kmsg also not a circular buffer?
What is the difference and relation between them?
Loosely speaking dmesg is a program that dumps /proc/kmsg. In addition, it provides some filtering capabilities to weed out logs that the user isn't interested in.
The output of /proc/kmsg can be directed to a file when collecting large amount of logs so that no logs are lost.
dmesg is circular buffer and previous logs get overwritten once the buffer is full.