Re: [PATCH] printk: Remember the message level for multi-line output

From: Nick Andrew
Date: Sun Apr 13 2008 - 07:35:19 EST


On Sun, Apr 13, 2008 at 09:40:07AM +0200, Ingo Molnar wrote:
> > Restructure the logic so the processing of the leading 3 characters of
> > each input line is in one place, regardless whether printk_time is
> > enabled.
>
> hm, i'm not sure about the change itself (printks are often random, so
> the output to the console would depend on printk ordering), but the
> combined effect seems to be a nice cleanup that reduces the linecount:

As I understand the code, if a single call to printk() includes multiple
lines of text then those lines will be contiguous in the console output.

So if one thread does printk(KERN_ERR "aaaaa\nbbbbb\n") and another
does printk(KERN_ERR "ccccc\n") then it's not possible for the buffer
to contain "<3>aaaaa\n<3>ccccc\n<3>bbbbb\n".

On the other hand, multiple calls to printk won't necessarily have
contiguous output. This affects code like arch/blackfin/kernel/traps.c
as I described in another thread which behaves like it's the only one
doing printk().

> > 1 files changed, 27 insertions(+), 34 deletions(-)
>
> so how about splitting it into two, first the code restructuring then a
> small add-on that does your feature? Does this make sense to you? This
> way, even if the feature ends up not being applied, we'll have your nice
> cleanup :-)

Can do.

Nick.
--
PGP Key ID = 0x418487E7 http://www.nick-andrew.net/
PGP Key fingerprint = B3ED 6894 8E49 1770 C24A 67E3 6266 6EB9 4184 87E7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/