util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
To: kerolasa@gmail.com
Cc: util-linux <util-linux@vger.kernel.org>
Subject: Re: [PATCH] dmesg: add --follow-new
Date: Sun, 31 May 2020 15:18:47 +0300	[thread overview]
Message-ID: <1d1e123b-d107-78c2-e76c-c5be3dcdf89e@yandex-team.ru> (raw)
In-Reply-To: <CAG27Bk3Tvybn0ToQdBNu9O-=Ap70+APKqLCCT-4cTxx-vFiFqw@mail.gmail.com>

On 31/05/2020 14.49, Sami Kerola wrote:
> On Sat, 30 May 2020 at 15:08, Konstantin Khlebnikov
> <khlebnikov@yandex-team.ru> 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.

  reply	other threads:[~2020-05-31 12:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30 14:07 [PATCH] dmesg: add --follow-new Konstantin Khlebnikov
2020-05-31 11:49 ` Sami Kerola
2020-05-31 12:18   ` Konstantin Khlebnikov [this message]
2020-06-01  7:53     ` Karel Zak
2020-06-01  7:56 ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1d1e123b-d107-78c2-e76c-c5be3dcdf89e@yandex-team.ru \
    --to=khlebnikov@yandex-team.ru \
    --cc=kerolasa@gmail.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).