util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: kerolasa@gmail.com, util-linux <util-linux@vger.kernel.org>
Subject: Re: [PATCH] dmesg: add --follow-new
Date: Mon, 1 Jun 2020 09:53:25 +0200	[thread overview]
Message-ID: <20200601075325.ufmficzg5u57ocek@ws.net.home> (raw)
In-Reply-To: <1d1e123b-d107-78c2-e76c-c5be3dcdf89e@yandex-team.ru>

On Sun, May 31, 2020 at 03:18:47PM +0300, Konstantin Khlebnikov wrote:
> 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.

IMHO good idea.

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

It does not seem use-friendly ;-) I guess type "-W" is pretty 
straightforward.
	
> > That said should --since and --until options similar to journalctl(1)
> > be considered
> > as well?

 --since '1 hour ago' would be nice, but I have doubts it's will so
 easy to implement due to crazy timestamps in the log.

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

 Yes.

    Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


  reply	other threads:[~2020-06-01  7:53 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
2020-06-01  7:53     ` Karel Zak [this message]
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=20200601075325.ufmficzg5u57ocek@ws.net.home \
    --to=kzak@redhat.com \
    --cc=kerolasa@gmail.com \
    --cc=khlebnikov@yandex-team.ru \
    --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).