lkml.org 
[lkml]   [2008]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] printk: Remember the message level for multi-line output
On Mon, Apr 14, 2008 at 12:26:34PM +0200, Ingo Molnar wrote:
> * Nick Andrew <nick@nick-andrew.net> wrote:
> > Yes, quite. The state of whether we're inside a line is retained
> > across calls to printk (from anywhere in the system) - this allows
> > code like this to usually do what you expect:
> >
> > printk(KERN_ERR "Error:");
> > for (i = 0; i < 16; ++i) {
> > printk(" %02x", i);
> > }
> > printk("\n");
> >
> > But in your example the first printk call contains a \n at the end of
> > the line and so upon entry to the second printk call the function
> > knows a new line is beginning.
>
> ok - i think your change is a good one.

Thank you.

> btw., we could also start emitting debug warnings that the printk is not
> conform. Something like:
>
> "INFO: the previous printk was done without a KERN_ annotation"

There are 20k+ instances of this in the codebase; we don't need a
runtime message to find them. If you annotate them all, that will
add up to 60k to the binary size. Perhaps it's best to retain the
default support.

Nick.
--
PGP Key ID = 0x418487E7 http://www.nick-andrew.net/
PGP Key fingerprint = B3ED 6894 8E49 1770 C24A 67E3 6266 6EB9 4184 87E7


\
 
 \ /
  Last update: 2008-04-14 13:05    [W:2.978 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site