mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: akpm@linux-foundation.org, Tejun Heo <tj@kernel.org>
Cc: davem@davemloft.net, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, Petr Mladek <pmladek@suse.com>
Subject: [PATCH] printk: Warn about dropped messages also on extended consoles
Date: Thu, 30 Jul 2015 13:28:52 +0200	[thread overview]
Message-ID: <1438255732-31326-1-git-send-email-pmladek@suse.com> (raw)

The commit #6fe29354befe4c ("printk: implement support for extended console
drivers") added an extra buffer to format messages for extended consoles.
We need to put there also the warning about dropped messages, so it appears
on these consoles.

Signed-off-by: Petr Mladek <pmladek@suse.com>
---
 kernel/printk/printk.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index cf8c24203368..77d3d3698283 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2254,8 +2254,15 @@ again:
 		}
 
 		if (console_seq < log_first_seq) {
-			len = sprintf(text, "** %u printk messages dropped ** ",
-				      (unsigned)(log_first_seq - console_seq));
+			static const char dropped_msg[] =
+				"** %u printk messages dropped ** ";
+			unsigned int dropped_count =
+				(unsigned int)(log_first_seq - console_seq);
+
+			len = sprintf(text, dropped_msg, dropped_count);
+			if (nr_ext_console_drivers)
+				ext_len = sprintf(ext_text, dropped_msg,
+						  dropped_count);
 
 			/* messages are gone, move to first one */
 			console_seq = log_first_seq;
@@ -2290,8 +2297,8 @@ skip:
 		len += msg_print_text(msg, console_prev, false,
 				      text + len, sizeof(text) - len);
 		if (nr_ext_console_drivers) {
-			ext_len = msg_print_ext_header(ext_text,
-						sizeof(ext_text),
+			ext_len += msg_print_ext_header(ext_text + ext_len,
+						sizeof(ext_text) - ext_len,
 						msg, console_seq, console_prev);
 			ext_len += msg_print_ext_body(ext_text + ext_len,
 						sizeof(ext_text) - ext_len,
-- 
1.8.5.6


             reply	other threads:[~2015-07-30 11:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30 11:28 Petr Mladek [this message]
2015-07-30 12:10 ` Joe Perches
2015-07-30 13:39 ` Tejun Heo
2015-07-30 15:02   ` Petr Mladek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438255732-31326-1-git-send-email-pmladek@suse.com \
    --to=pmladek@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®