3 ms·
Isn't `dmesg` just `journalctl -k` on operating systems with systemd enabled?
by makefu 8y ago
Isn't `dmesg` just `journalctl -k` on operating systems with systemd enabled?
- rwmj 8y agoIt's more like the opposite. journalctl -k displays the kernel messages, but with a considerable amount of extra overhead because it has to go though the journal daemon. https://github.com/systemd/systemd/blob/9afd5740391980fee5d89888fb206aed55fbaed7/src/journal/journalctl.c#L1431 https://github.com/systemd/systemd/blob/9afd5740391980fee5d8... https://github.com/systemd/systemd/blob/9afd5740391980fee5d89888fb206aed55fbaed7/src/journal/journald-kmsg.c#L377 https://github.com/systemd/systemd/blob/9afd5740391980fee5d8... Whereas dmesg reads the kernel messages directly from the kernel. https://github.com/karelzak/util-linux/blob/99c92a48205699707959bf1f7b6e0e35511c3d7b/sys-utils/dmesg.c#L1103 https://github.com/karelzak/util-linux/blob/99c92a4820569970...
- JNRowe 8y agoNot disputing your point, but some of that extra code does allow you to do cool things. Add a `-k -b=-{n}` to see a previous boot's dmesg, or filtering with `-k --until` for time filtering, &c. All with the same interface you're using to process your other logs too.