Skip to content

Commit

Permalink
printk: remember the message level for multi-line output
Browse files Browse the repository at this point in the history
printk(KERN_ALERT "Danger Will Robinson!\nAlien Approaching!\n");

At present this will result in one message at ALERT level and one
at the current default message loglevel (e.g. WARNING). This is
non-intuitive.

Modify vprintk() to remember the message loglevel each time it
is specified and use it for subsequent lines of output which do
not specify one, within the same call to printk.

Signed-off-by: Nick Andrew <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
nickandrew authored and KAGA-KOKO committed May 24, 2008
1 parent ac60ad7 commit 0915930
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ static char printk_buf[1024];
asmlinkage int vprintk(const char *fmt, va_list args)
{
int printed_len = 0;
int current_log_level = default_message_loglevel;
unsigned long flags;
int this_cpu;
char *p;
Expand Down Expand Up @@ -710,7 +711,6 @@ asmlinkage int vprintk(const char *fmt, va_list args)
*/
for (p = printk_buf; *p; p++) {
if (new_text_line) {
int current_log_level = default_message_loglevel;
/* If a token, set current_log_level and skip over */
if (p[0] == '<' && p[1] >= '0' && p[1] <= '7' &&
p[2] == '>') {
Expand Down

0 comments on commit 0915930

Please sign in to comment.