Re: [RFC] New kernel-message logging API

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Joe Perches <joe@...>
Cc: <holzheu@...>, LKML <linux-kernel@...>, Rob Landley <rob@...>, Dick Streefland <dick.streefland@...>
Date: Monday, September 24, 2007 - 12:43 pm

On 9/24/07, Joe Perches <joe@perches.com> wrote:

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


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
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] New kernel-message logging API, Vegard Nossum, (Sat Sep 22, 3:27 pm)
Re: [RFC] New kernel-message logging API, Jesse Barnes, (Mon Sep 24, 2:26 pm)
Re: [RFC] New kernel-message logging API, Michael Holzheu, (Mon Sep 24, 5:22 am)
Re: [RFC] New kernel-message logging API, Joe Perches, (Mon Sep 24, 11:19 am)
Re: [RFC] New kernel-message logging API, Michael Holzheu, (Tue Sep 25, 4:57 am)
Re: [RFC] New kernel-message logging API, Rob Landley, (Mon Sep 24, 7:51 pm)
Re: [RFC] New kernel-message logging API, Joe Perches, (Mon Sep 24, 8:10 pm)
Re: [RFC] New kernel-message logging API, Rob Landley, (Mon Sep 24, 9:46 pm)
Re: [RFC] New kernel-message logging API, Vegard Nossum, (Mon Sep 24, 12:43 pm)
Re: [RFC] New kernel-message logging API, Joe Perches, (Mon Sep 24, 1:00 pm)
Re: [RFC] New kernel-message logging API, Vegard Nossum, (Mon Sep 24, 4:37 pm)
Re: [RFC] New kernel-message logging API, Rob Landley, (Mon Sep 24, 9:18 pm)
Re: [RFC] New kernel-message logging API, Rob Landley, (Sun Sep 23, 4:05 pm)
Re: [RFC] New kernel-message logging API, Miguel Ojeda, (Sat Sep 22, 9:05 pm)
Re: [RFC] New kernel-message logging API, Vegard Nossum, (Tue Sep 25, 1:27 am)
Re: [RFC] New kernel-message logging API, Miguel Ojeda, (Tue Sep 25, 1:24 pm)
Re: [RFC] New kernel-message logging API, Joe Perches, (Sat Sep 22, 8:13 pm)
Re: [RFC] New kernel-message logging API, Vegard Nossum, (Sun Sep 23, 4:39 am)
Re: [RFC] New kernel-message logging API, Joe Perches, (Sun Sep 23, 3:25 pm)
Re: [RFC] New kernel-message logging API, Jan Engelhardt, (Sun Sep 23, 4:45 am)
Re: [RFC] New kernel-message logging API, Joe Perches, (Sun Sep 23, 3:23 pm)
Re: [RFC] New kernel-message logging API, Vegard Nossum, (Sun Sep 23, 5:20 am)
Re: [RFC] New kernel-message logging API, Jan Engelhardt, (Sun Sep 23, 5:38 am)
Re: [RFC] New kernel-message logging API, Kyle Moffett, (Sat Sep 22, 8:40 pm)
Re: [RFC] New kernel-message logging API, Joe Perches, (Sat Sep 22, 8:47 pm)
Re: [RFC] New kernel-message logging API, Kyle Moffett, (Sat Sep 22, 11:43 pm)