linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: mingo@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/7] x86 dumpstack: fix printing of stack dump loglevels
Date: Wed, 07 Oct 2009 17:35:19 +0100	[thread overview]
Message-ID: <4ACCC347.4000404@tuffmail.co.uk> (raw)
In-Reply-To: <alpine.LFD.2.01.0910070731080.3432@localhost.localdomain>

Linus Torvalds wrote:
> On Wed, 7 Oct 2009, Alan Jenkins wrote:
>   
>> Changing printk() to accept loglevels in the middle of the string again
>> would be non-trivial.  Let's accept this limitation and simply split the
>> above code into two separate calls to printk().
>>     
>
> Actually, let's just drop the log_lvl printout in the middle.
>
> And to do that, let's clean up printk() a bit further - just make it say 
> "if there is no loglevel, use the previous loglevel". That's going to 
> simplify _all_ kinds of multi-line code.
>   

I think its more of a special case.  It's most useful where we output a
multi-line hexdump (or some other sort of array).  I think that's just
stack dumps (albeit potentially one for each architecture).  Is there
really anything else?  If not, I would lean against doing this.

None of the other architectures seem to set any loglevel in
dump_stack(), so this would change their behaviour.  I.e. dump_stack()
would print with the current loglevel, whatever that is.  That's a neat
behaviour and we could simplify x86 to match.  But it seems less simple
overall.  This one arch function would rely implicitly on the new, not
immediately obvious behaviour of printk().

> As far as I can tell, that's a oneliner: make 'current_log_level' be a 
> 'static' variable.
>
> Wouldn't that be much simpler for everybody?
>
> (And yes, if you mix multi-line messages that are printed as separate 
> printk's and with different loglevels, output will be confused. But quite 
> frankly, it will be confused regardless)
>   

It is more obvious that there is confusion when you see "<0>" in the
middle of a line though :-).

Regards
Alan

  reply	other threads:[~2009-10-07 16:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-07  8:39 printk: fix loglevels as used by x86 stack dump code Alan Jenkins
2009-10-07  8:39 ` [PATCH 1/7] printk: clean up return value Alan Jenkins
2009-10-07 13:55   ` Joe Perches
2009-10-07 15:36   ` Linus Torvalds
2009-10-07 16:25     ` Alan Jenkins
2009-10-07 16:36     ` Joe Perches
2009-10-07 16:57       ` Alan Jenkins
2009-10-07 17:42         ` Joe Perches
2009-10-07  8:39 ` [PATCH 2/7] kmsg: no need to limit the return value of printk Alan Jenkins
2009-10-07  8:39 ` [PATCH 3/7] printk: move the printing of the loglevel tag into a separate function Alan Jenkins
2009-10-07  8:39 ` [PATCH 4/7] printk: remove redundant test Alan Jenkins
2009-10-07  8:39 ` [PATCH 5/7] printk: fix printk(KERN_EMERG) followed by printk("emergency message\n") Alan Jenkins
2009-10-07  8:39 ` [PATCH 6/7] x86 dumpstack: fix printing of stack dump loglevels Alan Jenkins
2009-10-07 14:36   ` Linus Torvalds
2009-10-07 16:35     ` Alan Jenkins [this message]
2009-10-07  8:39 ` [PATCH 7/7] x86 dumpstack: fix log level of the first line in the stack dump Alan Jenkins

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=4ACCC347.4000404@tuffmail.co.uk \
    --to=alan-jenkins@tuffmail.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).