summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-07-13 03:35:17 +0200
committerKay Sievers <kay@vrfy.org>2012-07-13 03:35:17 +0200
commitb7d3669b17c5e569b78fcaeb660accf85316bd0d (patch)
tree37fce1d835e7ca1848f24953e67aa4a641e93038
parent661544e36f77a55dc4886b675eff1fbd9c929f87 (diff)
downloadpatches-b7d3669b17c5e569b78fcaeb660accf85316bd0d.tar.gz
update
-rw-r--r--kmsg-config-no-printk.patch10
-rw-r--r--kmsg-cont-order.patch35
-rw-r--r--kmsg-export-flags.patch8
-rw-r--r--series1
4 files changed, 46 insertions, 8 deletions
diff --git a/kmsg-config-no-printk.patch b/kmsg-config-no-printk.patch
index e07302a..9f01101 100644
--- a/kmsg-config-no-printk.patch
+++ b/kmsg-config-no-printk.patch
@@ -4,8 +4,8 @@ Subject: kmsg - avoid warning for CONFIG_PRINTK=n compilations
Signed-off-by: Kay Sievers <kay@vrfy.org>
---
- kernel/printk.c | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
+ kernel/printk.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -25,14 +25,16 @@ Signed-off-by: Kay Sievers <kay@vrfy.org>
static u32 log_next_idx;
/* the next printk record to read after the last 'clear' command */
-@@ -1631,9 +1631,15 @@ asmlinkage int printk(const char *fmt, .
+@@ -1649,10 +1649,17 @@ asmlinkage int printk(const char *fmt, .
}
EXPORT_SYMBOL(printk);
-#else
+#else /* CONFIG_PRINTK */
- #define LOG_LINE_MAX 0
+ #define LOG_LINE_MAX 0
+ #define PREFIX_MAX 0
++#define LOG_LINE_MAX 0
+static u64 syslog_seq;
+static u32 syslog_idx;
+static enum log_flags syslog_prev;
diff --git a/kmsg-cont-order.patch b/kmsg-cont-order.patch
new file mode 100644
index 0000000..3221e16
--- /dev/null
+++ b/kmsg-cont-order.patch
@@ -0,0 +1,35 @@
+---
+ kernel/printk.c | 22 ++++++++++++++++++----
+ 1 file changed, 18 insertions(+), 4 deletions(-)
+
+--- a/kernel/printk.c
++++ b/kernel/printk.c
+@@ -1377,10 +1377,24 @@ static void cont_flush(enum log_flags fl
+ if (cont.len == 0)
+ return;
+
+- log_store(cont.facility, cont.level, LOG_NOCONS | flags,
+- cont.ts_nsec, NULL, 0, cont.buf, cont.len);
+-
+- cont.flushed = true;
++ if (cont.cons) {
++ /*
++ * If we have flushed a fragment of this line to the console,
++ * we need to wait for the console to pick up the full line.
++ * We add a flag to suppress a duplicated output from the store.
++ */
++ log_store(cont.facility, cont.level, flags | LOG_NOCONS,
++ cont.ts_nsec, NULL, 0, cont.buf, cont.len);
++ cont.flushed = true;
++ } else {
++ /*
++ * If we never flushed a fragment of this line to the console,
++ * we can just submit it to the store and free the buffer.
++ */
++ log_store(cont.facility, cont.level, flags, cont.ts_nsec,
++ NULL, 0, cont.buf, cont.len);
++ cont.len = 0;
++ }
+ }
+
+ static bool cont_add(int facility, int level, const char *text, size_t len)
diff --git a/kmsg-export-flags.patch b/kmsg-export-flags.patch
index c817460..8091c5f 100644
--- a/kmsg-export-flags.patch
+++ b/kmsg-export-flags.patch
@@ -86,7 +86,7 @@ Signed-off-by: Kay Sievers <kay@vrfy.org>
Users: dmesg(1), userspace kernel log consumers
--- a/kernel/printk.c
+++ b/kernel/printk.c
-@@ -360,6 +360,7 @@ static void log_store(int facility, int
+@@ -361,6 +361,7 @@ static void log_store(int facility, int
struct devkmsg_user {
u64 seq;
u32 idx;
@@ -94,7 +94,7 @@ Signed-off-by: Kay Sievers <kay@vrfy.org>
struct mutex lock;
char buf[8192];
};
-@@ -425,6 +426,7 @@ static ssize_t devkmsg_read(struct file
+@@ -426,6 +427,7 @@ static ssize_t devkmsg_read(struct file
struct log *msg;
u64 ts_usec;
size_t i;
@@ -102,7 +102,7 @@ Signed-off-by: Kay Sievers <kay@vrfy.org>
size_t len;
ssize_t ret;
-@@ -462,8 +464,25 @@ static ssize_t devkmsg_read(struct file
+@@ -463,8 +465,25 @@ static ssize_t devkmsg_read(struct file
msg = log_from_idx(user->idx);
ts_usec = msg->ts_nsec;
do_div(ts_usec, 1000);
@@ -120,7 +120,7 @@ Signed-off-by: Kay Sievers <kay@vrfy.org>
+ if (msg->flags & LOG_CONT && !(user->prev & LOG_CONT))
+ cont = 'c';
+ else if ((msg->flags & LOG_CONT) ||
-+ (user->prev & LOG_CONT) && !(msg->flags & LOG_PREFIX))
++ ((user->prev & LOG_CONT) && !(msg->flags & LOG_PREFIX)))
+ cont = '+';
+
+ len = sprintf(user->buf, "%u,%llu,%llu,%c;",
diff --git a/series b/series
index 907aed0..eb8e491 100644
--- a/series
+++ b/series
@@ -5,3 +5,4 @@ kmsg-fix-overlong-cont.patch
kmsg-cont-order.patch
kmsg-config-no-printk.patch
kmsg-export-flags.patch
+kmsg-console-cont-flush-merge.patch