summaryrefslogtreecommitdiffstats
path: root/kernel/printk/printk.c
diff options
context:
space:
mode:
authorArun KS <arunks.linux@gmail.com>2014-01-23 18:54:19 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 19:36:56 -0500
commit1d3fa370346d9d96ab0efb84e3312aed3aeb35ea (patch)
tree4ad8fe316cef1aa892651ba35c25d1c02d941533 /kernel/printk/printk.c
parentaaf07621b8bbfdc0d87e9e5dbf1af3b24304998a (diff)
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: Arun KS <getarunks@gmail.com> Signed-off-by: Arun 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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/printk/printk.c')
-rw-r--r--kernel/printk/printk.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index f8b41bddc6dc..b1d255f04135 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1595,10 +1595,13 @@ asmlinkage int vprintk_emit(int facility, int level,
1595 * either merge it with the current buffer and flush, or if 1595 * either merge it with the current buffer and flush, or if
1596 * there was a race with interrupts (prefix == true) then just 1596 * there was a race with interrupts (prefix == true) then just
1597 * flush it out and store this line separately. 1597 * flush it out and store this line separately.
1598 * If the preceding printk was from a different task and missed
1599 * a newline, flush and append the newline.
1598 */ 1600 */
1599 if (cont.len && cont.owner == current) { 1601 if (cont.len) {
1600 if (!(lflags & LOG_PREFIX)) 1602 if (cont.owner == current && !(lflags & LOG_PREFIX))
1601 stored = cont_add(facility, level, text, text_len); 1603 stored = cont_add(facility, level, text,
1604 text_len);
1602 cont_flush(LOG_NEWLINE); 1605 cont_flush(LOG_NEWLINE);
1603 } 1606 }
1604 1607