Commit 1d3fa370 authored by Arun KS's avatar Arun KS Committed by Linus Torvalds

printk: flush conflicting continuation line

An earlier newline was missing and current print is from different task.
In this scenario flush the continuation line and store this line
seperatly.

This patch fix the below scenario of timestamp interleaving,
   [   28.154370 ] read_word_reg : reg[0x 3], reg[0x 4]  data [0x 642]
   [   28.155428 ] uart disconnect
   [   31.947341 ] dvfs[cpufreq.c<275>]:plug-in cpu<1> done
   [   28.155445 ] UART detached : send switch state 201
   [   32.014112 ] read_reg : reg[0x 3] data[0x21]

[akpm@linux-foundation.org: simplify and condense the code]
Signed-off-by: default avatarArun KS <getarunks@gmail.com>
Signed-off-by: default avatarArun KS <arun.ks@broadcom.com>
Cc: Joe Perches <joe@perches.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Kay Sievers <kay@vrfy.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent aaf07621
...@@ -1595,10 +1595,13 @@ asmlinkage int vprintk_emit(int facility, int level, ...@@ -1595,10 +1595,13 @@ asmlinkage int vprintk_emit(int facility, int level,
* either merge it with the current buffer and flush, or if * either merge it with the current buffer and flush, or if
* there was a race with interrupts (prefix == true) then just * there was a race with interrupts (prefix == true) then just
* flush it out and store this line separately. * flush it out and store this line separately.
* If the preceding printk was from a different task and missed
* a newline, flush and append the newline.
*/ */
if (cont.len && cont.owner == current) { if (cont.len) {
if (!(lflags & LOG_PREFIX)) if (cont.owner == current && !(lflags & LOG_PREFIX))
stored = cont_add(facility, level, text, text_len); stored = cont_add(facility, level, text,
text_len);
cont_flush(LOG_NEWLINE); cont_flush(LOG_NEWLINE);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment