linux/kernel/debug
Daniel Thompson f7d4ca8bbf kdb: Avoid printing KERN_ levels to consoles
Currently when kdb traps printk messages then the raw log level prefix
(consisting of '\001' followed by a numeral) does not get stripped off
before the message is issued to the various I/O handlers supported by
kdb. This causes annoying visual noise as well as causing problems
grepping for ^. It is also a change of behaviour compared to normal usage
of printk() usage. For example <SysRq>-h ends up with different output to
that of kdb's "sr h".

This patch addresses the problem by stripping log levels from messages
before they are issued to the I/O handlers. printk() which can also
act as an i/o handler in some cases is special cased; if the caller
provided a log level then the prefix will be preserved when sent to
printk().

The addition of non-printable characters to the output of kdb commands is a
regression, albeit and extremely elderly one, introduced by commit
04d2c8c83d ("printk: convert the format for KERN_<LEVEL> to a 2 byte
pattern"). Note also that this patch does *not* restore the original
behaviour from v3.5. Instead it makes printk() from within a kdb command
display the message without any prefix (i.e. like printk() normally does).

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Joe Perches <joe@perches.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2015-02-19 12:39:02 -06:00
..
kdb kdb: Avoid printing KERN_ levels to consoles 2015-02-19 12:39:02 -06:00
debug_core.c kdb: Fix off by one error in kdb_cpu() 2015-02-19 12:39:02 -06:00
debug_core.h kgdb/kdb: Fix no KDB config problem 2014-01-25 08:55:09 +01:00
gdbstub.c KGDB/KDB fixes and cleanups 2013-03-02 08:31:39 -08:00
Makefile kdb: core for kgdb back end (1 of 2) 2010-05-20 21:04:20 -05:00