From: Nick Andrew <nick@nick-andrew.net>
To: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
joe@perches.com
Subject: Re: [PATCH 2/2] printk: Remember the message level for multi-line output
Date: Mon, 14 Apr 2008 21:03:16 +1000 [thread overview]
Message-ID: <20080414110316.GJ29599@tull.net> (raw)
In-Reply-To: <20080414102634.GA20649@elte.hu>
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
next prev parent reply other threads:[~2008-04-14 11:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-13 11:53 [PATCH 1/2] printk: Refactor processing of line severity tokens Nick Andrew
2008-04-13 11:54 ` [PATCH 2/2] printk: Remember the message level for multi-line output Nick Andrew
2008-04-13 12:26 ` [PATCH 1/2] printk: Refactor processing of line severity tokens Nick Andrew
2008-04-14 7:58 ` Ingo Molnar
2008-04-13 12:27 ` [PATCH 2/2] printk: Remember the message level for multi-line output Nick Andrew
2008-04-14 8:03 ` Ingo Molnar
2008-04-14 10:12 ` Nick Andrew
2008-04-14 10:26 ` Ingo Molnar
2008-04-14 11:03 ` Nick Andrew [this message]
2008-04-14 11:43 ` Johannes Weiner
2008-04-14 12:21 ` Ingo Molnar
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=20080414110316.GJ29599@tull.net \
--to=nick@nick-andrew.net \
--cc=akpm@linux-foundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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
Powered by JetHome