]> 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, 5 Oct 2011 00:43:26 +0000 (11:43 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 13 Oct 2011 06:49:37 +0000 (17:49 +1100)
commitb181f79e6963d1e8fde0af7f3b068e95b49cbe53
treec8870bf148dfb08fefb55474ae8bf22032559227
parente700b67d8c42c7e48eca3b32cd3500e598e90c34
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 <akpm@google.com>
lib/dynamic_debug.c