]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dynamic_debug: use a single printk() to emit messages
authorJason Baron <jbaron@redhat.com>
Wed, 28 Sep 2011 00:50:37 +0000 (10:50 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 30 Sep 2011 04:53:36 +0000 (14:53 +1000)
commit32f6bd51ece0b25a9c01ba6b5374f538beab5dd9
tree99700addaddd0498929b3827797b55cdf1450279
parent2dc66ac42db33439ce8c7ab654c0aedc554f2edb
dynamic_debug: use a single printk() to emit messages

We were using KERN_CONT to combine messages with their prefix.  However,
KERN_CONT is not smp safe, in the sense that it can interleave messages.
This interleaving can result in printks coming out at the wrong loglevel.
With the high frequency of printks that dynamic debug can produce this is
not desirable.

So make dynamic_emit_prefix() fill a char buf[64] instead of doing a
printk directly.  If we enable printing out of function, module, line, or
pid info, they are placed in this 64 byte buffer.  In my testing 64 bytes
was enough size to fulfill all requests.  Even if it's not, we can match
up the printk itself to see where it's from, so to me this is no big deal.

[akpm@linux-foundation.org: convert dangerous macro to C]
Signed-off-by: Jason Baron <jbaron@redhat.com>
Cc: Greg KH <greg@kroah.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <>
lib/dynamic_debug.c