linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: Greg KH <gregkh@suse.de>
Cc: Tim Bird <tim.bird@am.sony.com>,
	linux-embedded <linux-embedded@vger.kernel.org>,
	linux kernel <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>, john stultz <johnstul@us.ibm.com>,
	Brian Swetland <swetland@google.com>,
	Lennart Poettering <lennart@poettering.net>
Subject: Re: RFC: android logger feedback request
Date: Thu, 22 Dec 2011 05:12:55 +0100	[thread overview]
Message-ID: <CAPXgP10ikqHFn41wc1HPsKHyaC7fe1WGC2eHqs-hdRaZ7XCTLw@mail.gmail.com> (raw)
In-Reply-To: <20111222034717.GB14174@suse.de>

On Thu, Dec 22, 2011 at 04:47, Greg KH <gregkh@suse.de> wrote:
> On Wed, Dec 21, 2011 at 06:12:39PM -0800, Tim Bird wrote:
>> > Again, please see what we are already doing in the kernel and userspace,
>> > I think a lot of the above is already implemented.
>>
>> I don't know what systemd has got going on in user-space.  I'm looking
>> at a very recent kernel, and I see no support for multiple log channels,
>> or an optimized open/write path.
>
> How is the existing syslog read path not "optimized"?  What kind of
> speed and numbers are we talking about here?
>
> Oh, and you do know about the userspace printk tty driver, right?  What
> about using that combined with the existing syslog system call?
>
> systemd doesn't use it, but I know of a few embedded systems that are
> already using it today, and I think it might solve the android issues
> already.

We would like to have for the general Linux use case is a kmsg, that
supports structured data, but looks the same as it looks today to
current and legacy tools.

We would like to have every printk that does not start with a
KERN_CONT to create a record in the kmsg buffer. This record would
carry directly a timestamp, the log facility and the log level and a
reference to the usual human readable string.

The current kmsg prefixing of the timestamp would be a runtime switch,
and just added when the records are traversed, instead of the current
buffer printing.

In addition to this common data, every record can carry a
'dictionary', which basically looks like a process environment, means
KEY=value pairs. The additional data can carry all the stuff that is
needed for structured logging and provides the base for machine
readable log information.

We don't want to separate multiple stores to avoid ordering problems
when the messages need to be merged from the multiple streams on the
receiver side.

I think this is theoretically all possible with the current kmsg,
without breaking anything. The current interfaces would iterate over
the record list and print out the human readable parts and skip the
metadata, instead of just copying a linear byte stream. To tools, it
could look the same as it is currently. It's just that the ring buffer
is not a byte- but a record-buffer.

Advanced tools could get a new interface or switch the old interface
to pipe out the structured data too.

In the systemd journal, we have an ASCII-like stream format that
carries out structured data and is binary data capable.

If we want to think about any next generation logging, I'm convinced,
we need to support records, structured data and binary data; anything
else is unlikely worth to change the current stuff.

Kay

  reply	other threads:[~2011-12-22  4:12 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-21 22:59 RFC: android logger feedback request Tim Bird
2011-12-21 23:19 ` Greg KH
2011-12-22  0:18   ` john stultz
2011-12-22  0:27     ` Greg KH
2011-12-22  0:47       ` john stultz
2011-12-22  1:09         ` john stultz
2011-12-22  0:42     ` Tim Bird
2011-12-22  0:49       ` john stultz
2011-12-22  1:00         ` john stultz
2011-12-22  0:36   ` Tim Bird
2011-12-22  0:51     ` Greg KH
2011-12-22  1:32       ` Tim Bird
2011-12-22  1:47         ` Greg KH
2011-12-22  2:12           ` Tim Bird
2011-12-22  3:44             ` Kay Sievers
2011-12-22  3:45             ` Greg KH
2011-12-22  3:47             ` Greg KH
2011-12-22  4:12               ` Kay Sievers [this message]
2011-12-22  4:22                 ` Brian Swetland
2011-12-22  4:43                   ` Kay Sievers
2011-12-22  4:47                   ` david
2011-12-22  4:58                     ` Brian Swetland
2011-12-22  5:07                       ` david
2011-12-22  5:21                       ` david
2011-12-22 13:40                   ` Lennart Poettering
2011-12-22  4:49                 ` david
2011-12-22  2:34           ` Kay Sievers
2011-12-22  1:20     ` NeilBrown
2011-12-22  1:49       ` Greg KH
2011-12-22  2:14       ` Tim Bird
2011-12-22  2:34       ` Brian Swetland
2011-12-22  3:49         ` Greg KH
2011-12-22  4:36           ` Kay Sievers
2011-12-22  5:01         ` david
2011-12-22  4:52       ` david
2011-12-22  5:06         ` Brian Swetland
2011-12-22  5:14           ` david
2011-12-22  5:25             ` Brian Swetland
2011-12-22  6:09               ` Greg KH
2011-12-23 15:22                 ` Alan Cox
2011-12-23 16:29                   ` Greg KH
2011-12-22  7:05           ` NeilBrown
2012-01-06 20:56             ` Tim Bird
2012-01-06 21:20               ` Greg KH
2012-01-06 22:41                 ` Tim Bird
2012-01-06 23:17                   ` Greg KH
2012-01-06 23:35                   ` Greg KH
2011-12-22 14:59       ` Arnd Bergmann
2011-12-22 15:13         ` Kay Sievers
2011-12-22  4:42     ` david
2011-12-22  0:59 ` David Brown
2011-12-29  0:39 ` Andrew Morton
2012-01-04 15:34   ` Geunsik Lim

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=CAPXgP10ikqHFn41wc1HPsKHyaC7fe1WGC2eHqs-hdRaZ7XCTLw@mail.gmail.com \
    --to=kay.sievers@vrfy.org \
    --cc=arnd@arndb.de \
    --cc=gregkh@suse.de \
    --cc=johnstul@us.ibm.com \
    --cc=lennart@poettering.net \
    --cc=linux-embedded@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swetland@google.com \
    --cc=tim.bird@am.sony.com \
    /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).