public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Andrew <nick@nick-andrew.net>
To: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	joe@perches.com, Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] printk: Remember the message level for multi-line	output
Date: Sun, 13 Apr 2008 21:34:53 +1000	[thread overview]
Message-ID: <20080413113453.GE29599@tull.net> (raw)
In-Reply-To: <20080413074007.GE20332@elte.hu>

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

  reply	other threads:[~2008-04-13 11:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-12 16:18 [PATCH] printk: Remember the message level for multi-line output Nick Andrew
2008-04-12 16:42 ` Nick Andrew
2008-04-13  7:40 ` Ingo Molnar
2008-04-13 11:34   ` Nick Andrew [this message]
2008-04-13 11:57     ` Nick Andrew

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=20080413113453.GE29599@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