From: "Vegard Nossum" <vegard.nossum@gmail.com>
To: "Joe Perches" <joe@perches.com>
Cc: holzheu@linux.vnet.ibm.com, LKML <linux-kernel@vger.kernel.org>,
"Rob Landley" <rob@landley.net>,
"Dick Streefland" <dick.streefland@altium.nl>
Subject: Re: [RFC] New kernel-message logging API
Date: Mon, 24 Sep 2007 18:43:09 +0200 [thread overview]
Message-ID: <19f34abd0709240943s13472c97ma7a4aff3a6089e8f@mail.gmail.com> (raw)
In-Reply-To: <1190647156.30132.92.camel@localhost>
On 9/24/07, Joe Perches <joe@perches.com> wrote:
> On Mon, 2007-09-24 at 11:22 +0200, Michael Holzheu wrote:
> > Together with the idea of not allowing multiple lines in the kprint_xxx
> > functions, that would go with our approach having message numbers to
> > identify a message.
>
> How does this equate/give message numbers?
Storing the format-string separately allows us to hash THAT instead of
the formatted (ie. console output) message. Since this will never
change from message to message, it can be looked up in a table or
whatever and allow user-space to do translations without for example
regular expressions.
I'm pretty sure this *would* be possible to do with existing printk(),
but I'm betting it also wouldn't look very nice (i.e. hackery).
> > If you do it like that, you can't support "%s", since then you would
> > store only the pointer and not the whole string. I think, that we can't
> > live without %s.
>
> long long would not work either.
>
> Perhaps it's better to scan the format string or indirect the
> printk formatting logic.
The idea was to not use snprintf() for the stored message, but have a
printf-like function that instead writes the output of each format
specifier to its own string (ie. each argument produces a new char*
object). Also needed would be an additional function that reads the
format string but uses the stored arguments.
This turned out to be slightly harder than I assumed at first, though
it's of course not impossible. The downside of this approach is of
course the need to maintain normal vsnprintf() and new functions side
by side, with little possibility of reusing the format parsing of
vsnprintf().
I will follow up with some code to demonstrate as soon as I can.
Vegard
next prev parent reply other threads:[~2007-09-24 16:48 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-22 19:27 Vegard Nossum
2007-09-23 0:13 ` Joe Perches
2007-09-23 0:40 ` Kyle Moffett
2007-09-23 0:47 ` Joe Perches
2007-09-23 3:43 ` Kyle Moffett
2007-09-23 8:39 ` Vegard Nossum
2007-09-23 8:45 ` Jan Engelhardt
2007-09-23 9:20 ` Vegard Nossum
2007-09-23 9:38 ` Jan Engelhardt
2007-09-23 19:23 ` Joe Perches
2007-09-23 19:25 ` Joe Perches
2007-09-23 1:05 ` Miguel Ojeda
2007-09-25 5:27 ` Vegard Nossum
2007-09-25 17:24 ` Miguel Ojeda
2007-09-23 20:05 ` Rob Landley
2007-09-24 9:22 ` Michael Holzheu
2007-09-24 15:19 ` Joe Perches
2007-09-24 16:43 ` Vegard Nossum [this message]
2007-09-24 17:00 ` Joe Perches
2007-09-24 20:37 ` Vegard Nossum
2007-09-25 1:18 ` Rob Landley
2007-09-24 23:51 ` Rob Landley
2007-09-25 0:10 ` Joe Perches
2007-09-25 1:46 ` Rob Landley
2007-09-25 8:57 ` Michael Holzheu
2007-09-24 18:26 ` Jesse Barnes
2007-09-25 4:58 linux
2007-09-25 6:54 ` Joe Perches
2007-09-25 7:50 ` linux
2007-09-25 8:06 ` Vegard Nossum
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=19f34abd0709240943s13472c97ma7a4aff3a6089e8f@mail.gmail.com \
--to=vegard.nossum@gmail.com \
--cc=dick.streefland@altium.nl \
--cc=holzheu@linux.vnet.ibm.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rob@landley.net \
/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
all inboxes | Powered by JetHome®