diff options
author | Kay Sievers <kay@vrfy.org> | 2012-07-07 22:16:46 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2012-07-07 22:16:46 +0200 |
commit | d96e983d573dbe13fbd6df77cae4f78afd665cee (patch) | |
tree | c42d974adcf6e8958369b1d0d755ba30a928b311 | |
parent | 84086010c19ee24301fd8924875bf618da231edf (diff) | |
download | patches-d96e983d573dbe13fbd6df77cae4f78afd665cee.tar.gz |
add changelog
-rw-r--r-- | kmsg-merge-cont.patch | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/kmsg-merge-cont.patch b/kmsg-merge-cont.patch index 98e4914..dd12aec 100644 --- a/kmsg-merge-cont.patch +++ b/kmsg-merge-cont.patch @@ -1,5 +1,16 @@ -diff --git a/kernel/printk.c b/kernel/printk.c -index f02f1f5..fe9fd52 100644 +From: Kay Sievers <kay@vrfy.org> +Subject: kmsg: merge continuation records while printing + +Sometimes we can not merge continuation recored into one record, and +have to store them as separate records. Add some flags to these records +and try to reconstruct the full line when it is printed. + +Cc: Michael Neuling <mikey@neuling.org> +Signed-off-by: Kay Sievers <kay@vrfy.org> +--- + kernel/printk.c | 113 ++++++++++++++++++++++++++++++++++++-------------------- + 1 file changed, 74 insertions(+), 39 deletions(-) + --- a/kernel/printk.c +++ b/kernel/printk.c @@ -194,8 +194,10 @@ static int console_may_schedule; @@ -15,7 +26,7 @@ index f02f1f5..fe9fd52 100644 }; struct log { -@@ -838,8 +840,8 @@ static size_t print_prefix(const struct log *msg, bool syslog, char *buf) +@@ -838,8 +840,8 @@ static size_t print_prefix(const struct return len; } @@ -26,7 +37,7 @@ index f02f1f5..fe9fd52 100644 { const char *text = log_text(msg); size_t text_size = msg->text_len; -@@ -848,6 +850,8 @@ static size_t msg_print_text(const struct log *msg, bool syslog, +@@ -848,6 +850,8 @@ static size_t msg_print_text(const struc do { const char *next = memchr(text, '\n', text_size); size_t text_len; @@ -35,7 +46,7 @@ index f02f1f5..fe9fd52 100644 if (next) { text_len = next - text; -@@ -857,19 +861,35 @@ static size_t msg_print_text(const struct log *msg, bool syslog, +@@ -857,19 +861,35 @@ static size_t msg_print_text(const struc text_len = text_size; } @@ -75,7 +86,7 @@ index f02f1f5..fe9fd52 100644 } text = next; -@@ -882,6 +902,7 @@ static int syslog_print(char __user *buf, int size) +@@ -882,6 +902,7 @@ static int syslog_print(char __user *buf { char *text; struct log *msg; @@ -83,7 +94,7 @@ index f02f1f5..fe9fd52 100644 int len = 0; text = kmalloc(LOG_LINE_MAX, GFP_KERNEL); -@@ -896,16 +917,18 @@ static int syslog_print(char __user *buf, int size) +@@ -896,16 +917,18 @@ static int syslog_print(char __user *buf /* messages are gone, move to first one */ syslog_seq = log_first_seq; syslog_idx = log_first_idx; @@ -103,7 +114,7 @@ index f02f1f5..fe9fd52 100644 } else n = 0; raw_spin_unlock_irq(&logbuf_lock); -@@ -944,6 +967,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) +@@ -944,6 +967,7 @@ static int syslog_print_all(char __user u64 next_seq; u64 seq; u32 idx; @@ -111,7 +122,7 @@ index f02f1f5..fe9fd52 100644 if (clear_seq < log_first_seq) { /* messages are gone, move to first available one */ -@@ -957,10 +981,11 @@ static int syslog_print_all(char __user *buf, int size, bool clear) +@@ -957,10 +981,11 @@ static int syslog_print_all(char __user */ seq = clear_seq; idx = clear_idx; @@ -124,7 +135,7 @@ index f02f1f5..fe9fd52 100644 idx = log_next(idx); seq++; } -@@ -968,10 +993,11 @@ static int syslog_print_all(char __user *buf, int size, bool clear) +@@ -968,10 +993,11 @@ static int syslog_print_all(char __user /* move first record forward until length fits into the buffer */ seq = clear_seq; idx = clear_idx; @@ -137,7 +148,7 @@ index f02f1f5..fe9fd52 100644 idx = log_next(idx); seq++; } -@@ -980,17 +1006,19 @@ static int syslog_print_all(char __user *buf, int size, bool clear) +@@ -980,17 +1006,19 @@ static int syslog_print_all(char __user next_seq = log_next_seq; len = 0; @@ -158,7 +169,7 @@ index f02f1f5..fe9fd52 100644 raw_spin_unlock_irq(&logbuf_lock); if (copy_to_user(buf + len, text, textlen)) -@@ -1003,6 +1031,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) +@@ -1003,6 +1031,7 @@ static int syslog_print_all(char __user /* messages are gone, move to next one */ seq = log_first_seq; idx = log_first_idx; @@ -166,7 +177,7 @@ index f02f1f5..fe9fd52 100644 } } } -@@ -1116,18 +1145,18 @@ int do_syslog(int type, char __user *buf, int len, bool from_file) +@@ -1116,18 +1145,18 @@ int do_syslog(int type, char __user *buf */ error = log_next_idx - syslog_idx; } else { @@ -190,7 +201,7 @@ index f02f1f5..fe9fd52 100644 } } raw_spin_unlock_irq(&logbuf_lock); -@@ -1396,10 +1425,9 @@ asmlinkage int vprintk_emit(int facility, int level, +@@ -1396,10 +1425,9 @@ asmlinkage int vprintk_emit(int facility static char textbuf[LOG_LINE_MAX]; char *text = textbuf; size_t text_len; @@ -202,7 +213,7 @@ index f02f1f5..fe9fd52 100644 int printed_len = 0; boot_delay_msec(); -@@ -1438,7 +1466,7 @@ asmlinkage int vprintk_emit(int facility, int level, +@@ -1438,7 +1466,7 @@ asmlinkage int vprintk_emit(int facility recursion_bug = 0; printed_len += strlen(recursion_msg); /* emit KERN_CRIT message */ @@ -211,7 +222,7 @@ index f02f1f5..fe9fd52 100644 NULL, 0, recursion_msg, printed_len); } -@@ -1451,7 +1479,7 @@ asmlinkage int vprintk_emit(int facility, int level, +@@ -1451,7 +1479,7 @@ asmlinkage int vprintk_emit(int facility /* mark and strip a trailing newline */ if (text_len && text[text_len-1] == '\n') { text_len--; @@ -220,7 +231,7 @@ index f02f1f5..fe9fd52 100644 } /* strip syslog prefix and extract log level or control flags */ -@@ -1461,7 +1489,7 @@ asmlinkage int vprintk_emit(int facility, int level, +@@ -1461,7 +1489,7 @@ asmlinkage int vprintk_emit(int facility if (level == -1) level = text[1] - '0'; case 'd': /* KERN_DEFAULT */ @@ -229,7 +240,7 @@ index f02f1f5..fe9fd52 100644 case 'c': /* KERN_CONT */ text += 3; text_len -= 3; -@@ -1471,22 +1499,20 @@ asmlinkage int vprintk_emit(int facility, int level, +@@ -1471,22 +1499,20 @@ asmlinkage int vprintk_emit(int facility if (level == -1) level = default_message_loglevel; @@ -257,7 +268,7 @@ index f02f1f5..fe9fd52 100644 dict, dictlen, text, text_len); } else { bool stored = false; -@@ -1498,13 +1524,13 @@ asmlinkage int vprintk_emit(int facility, int level, +@@ -1498,13 +1524,13 @@ asmlinkage int vprintk_emit(int facility * flush it out and store this line separately. */ if (cont.len && cont.owner == current) { @@ -313,7 +324,7 @@ index f02f1f5..fe9fd52 100644 raw_spin_unlock(&logbuf_lock); stop_critical_timings(); /* don't trace print latency */ -@@ -2522,8 +2551,7 @@ bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, +@@ -2522,8 +2551,7 @@ bool kmsg_dump_get_line(struct kmsg_dump } msg = log_from_idx(dumper->cur_idx); @@ -323,7 +334,7 @@ index f02f1f5..fe9fd52 100644 dumper->cur_idx = log_next(dumper->cur_idx); dumper->cur_seq++; -@@ -2563,6 +2591,7 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, +@@ -2563,6 +2591,7 @@ bool kmsg_dump_get_buffer(struct kmsg_du u32 idx; u64 next_seq; u32 next_idx; @@ -331,7 +342,7 @@ index f02f1f5..fe9fd52 100644 size_t l = 0; bool ret = false; -@@ -2585,23 +2614,27 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, +@@ -2585,23 +2614,27 @@ bool kmsg_dump_get_buffer(struct kmsg_du /* calculate length of entire buffer */ seq = dumper->cur_seq; idx = dumper->cur_idx; @@ -361,7 +372,7 @@ index f02f1f5..fe9fd52 100644 } /* last message in next interation */ -@@ -2609,14 +2642,16 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, +@@ -2609,14 +2642,16 @@ bool kmsg_dump_get_buffer(struct kmsg_du next_idx = idx; l = 0; |