Re: [PATCH] dmesg: add --follow-new

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 31/05/2020 14.49, Sami Kerola wrote:
On Sat, 30 May 2020 at 15:08, Konstantin Khlebnikov
<khlebnikov@xxxxxxxxxxxxxx> wrote:
Option --follow-new (-W) works the same as --follow (-w) but initially
seeks to the end of kernel ring buffer, so it prints only new messages.
Useful for capturing kernel messages during actions without past log.

Hello Konstantin,

I wonder if it would be more useful to add '-n, --lines=[+]NUM' that
would be similar
to tail(1) option and argument. The --follow-new with an option that
lists NUM last
messages would be --lines=0

That said should --since and --until options similar to journalctl(1)
be considered
as well?


I don't see how this could be useful. If anybody interested in past
messages then showing whole buffer isn't a big deal - it's only few kb.
Anyway, without --follow this is simply 'dmesg | tail -n NUM'.

Implementation is also non-trivial - currently dmesg reads and prints
messages from /dev/kmsg in a loop. It doesn't know how many lines left.
/dev/kmsg doesn't support lseek with non-zero offset, only SET/DATA/END.



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux