Skip to content

Commit 4979575

Browse files
pmladektorvalds
authored andcommitted
printk/kdb: handle more message headers
Commit 4bcc595 ("printk: reinstate KERN_CONT for printing continuation lines") allows to define more message headers for a single message. The motivation is that continuous lines might get mixed. Therefore it make sense to define the right log level for every piece of a cont line. This patch introduces printk_skip_headers() that will skip all headers and uses it in the kdb code instead of printk_skip_level(). This approach helps to fix other printk_skip_level() users independently. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]> Cc: Joe Perches <[email protected]> Cc: Sergey Senozhatsky <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Jason Wessel <[email protected]> Cc: Jaroslav Kysela <[email protected]> Cc: Takashi Iwai <[email protected]> Cc: Chris Mason <[email protected]> Cc: Josef Bacik <[email protected]> Cc: David Sterba <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 22c2c7b commit 4979575

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

include/linux/printk.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ static inline const char *printk_skip_level(const char *buffer)
3131
return buffer;
3232
}
3333

34+
static inline const char *printk_skip_headers(const char *buffer)
35+
{
36+
while (printk_get_level(buffer))
37+
buffer = printk_skip_level(buffer);
38+
39+
return buffer;
40+
}
41+
3442
#define CONSOLE_EXT_LOG_MAX 8192
3543

3644
/* printk's without a loglevel use this.. */

kernel/debug/kdb/kdb_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ int vkdb_printf(enum kdb_msgsrc src, const char *fmt, va_list ap)
697697
* Write to all consoles.
698698
*/
699699
retlen = strlen(kdb_buffer);
700-
cp = (char *) printk_skip_level(kdb_buffer);
700+
cp = (char *) printk_skip_headers(kdb_buffer);
701701
if (!dbg_kdb_mode && kgdb_connected) {
702702
gdbstub_msg_write(cp, retlen - (cp - kdb_buffer));
703703
} else {

0 commit comments

Comments
 (0)