From: Greg Kroah-Hartmann <greg@kroah.com>
To: Kay Sievers <kay@vrfy.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] printk: support structured and multi-facility log messages
Date: Wed, 4 Apr 2012 17:31:42 -0700 [thread overview]
Message-ID: <20120405003142.GA27595@kroah.com> (raw)
In-Reply-To: <CAPXgP13mvFNphitrtXnsj+c3+GYvSPU=2-HgtKbHGhmz-CE68g@mail.gmail.com>
On Wed, Apr 04, 2012 at 11:14:25PM +0200, Kay Sievers wrote:
> On Wed, Apr 4, 2012 at 23:05, Greg Kroah-Hartmann <greg@kroah.com> wrote:
> > On Wed, Apr 04, 2012 at 09:59:14PM +0200, Kay Sievers wrote:
>
> >> - Output of dev_printk() is reliably machine-readable now. In addition
> >> to the printed plain text message, it creates a log dictionary with the
> >> following properties:
> >> SUBSYSTEM= - the driver-core subsytem name
> >> DEVICE=
> >> b12:8 - block dev_t
> >> c127:3 - char dev_t
> >> n8 - netdev ifindex
> >> +sound:card0 - subsystem:devname
> >
> > I like this a lot, thanks for doing this.
> >
> > Is there somewhere in Documentation/ABI that we can document this
> > interface so that people know what it is, what is defined, and how to
> > use it?
>
> It's the notation udev uses to identify its devices internally. I just
> added the above description to the source code so far. If we agree on
> that, or some other scheme, we should definitely copy that into the
> ABI docs. Along with a description of the semantics of the chardev
> regarding open() poll() and seek().
Ok, that sounds good. I like the description, and implementation, so I
have no objections to this patch, I'd be glad to queue it up through my
tree to get testing in linux-next now if you want.
> >> - Support for multiple concurrent readers of /dev/kmsg, with read(),
> >> seek(), poll() support. Output of message sequence numbers, to allow
> >> userspace log consumers to reliably reconnect and reconstruct their
> >> state at any given time. After open("/dev/kmsg"), read() always
> >> returns *all* buffered records. If only future messages should be
> >> read, SEEK_END can be used. In case records get overwritten while
> >> /dev/kmsg is held open, or records get faster overwritten than they
> >> are read, the next read() will return -EPIPE and the current reading
> >> position gets updated to the next available record. The passed
> >> sequence numbers allow the log consumer to calculate the amount of
> >> lost messages.
> >
> > I just noticed that 'tail -f' doesn't seem to work on /dev/kmsg, should
> > it? Or does it need to do something else to get "just the new ones"?
>
> Yeah, 'tail' might not work, it expects a regular file. This is a
> chardev and it has not the regular file semantics which 'tail'
> expects; 'cat' should work fine. 'Real' tools will just use poll() to
> know when to get new messages out of the file descriptor.
Ah, you are right, I forgot about the "real file" stuff with tail, the
device node never gets updated with a timestamp.
thanks,
greg k-h
next prev parent reply other threads:[~2012-04-05 0:31 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-04 19:59 [PATCH] printk: support structured and multi-facility log messages Kay Sievers
2012-04-04 21:05 ` Greg Kroah-Hartmann
2012-04-04 21:14 ` Kay Sievers
2012-04-05 0:31 ` Greg Kroah-Hartmann [this message]
2012-04-04 21:16 ` richard -rw- weinberger
2012-04-04 21:20 ` Kay Sievers
2012-04-04 23:51 ` Joe Perches
2012-04-05 0:33 ` Greg Kroah-Hartmann
2012-04-05 0:40 ` Joe Perches
2012-04-05 7:46 ` Kay Sievers
2012-04-05 8:08 ` Sam Ravnborg
2012-04-05 8:35 ` Kay Sievers
2012-04-05 11:44 ` Joe Perches
2012-04-05 8:38 ` Joe Perches
2012-04-05 8:44 ` Kay Sievers
2012-04-05 15:05 ` Ingo Molnar
2012-04-05 15:25 ` Kay Sievers
2012-04-05 17:18 ` Ingo Molnar
2012-04-05 17:09 ` Linus Torvalds
2012-04-05 17:53 ` Linus Torvalds
2012-04-13 13:42 ` Stijn Devriendt
2012-04-05 19:47 ` Kay Sievers
2012-04-06 1:12 ` Joe Perches
2012-04-06 1:31 ` Linus Torvalds
2012-04-06 3:43 ` Joe Perches
2012-04-06 18:35 ` Kay Sievers
2012-04-08 0:47 ` Joe Perches
2012-04-08 1:02 ` Joe Perches
2012-04-10 17:21 ` Joe Perches
2012-04-11 11:39 ` Eric W. Biederman
2012-04-07 0:26 ` Jiri Kosina
2012-04-07 0:59 ` Joe Perches
2012-04-07 1:14 ` Jiri Kosina
2012-04-07 1:51 ` Joe Perches
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=20120405003142.GA27595@kroah.com \
--to=greg@kroah.com \
--cc=kay@vrfy.org \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.