[v4,1/7] printk: report dropped messages on separate line

Message ID 1405718885-11227-2-git-send-email-elder@linaro.org
State New
Headers show

Commit Message

Alex Elder July 18, 2014, 9:27 p.m.
It is possible for the log to be filled too quickly for the consoles
to be able to keep up.  This is detected in console_unlock(), and when
it occurs, a message is inserted to note the event.  When reviewing
some nearby code, Petr Mládek suggested it might be nicer if this
message were placed on a separate line.  This patch implements that
suggestion.

Suggested-by: Petr Mládek <pmladek@suse.cz>
Signed-off-by: Alex Elder <elder@linaro.org>
---
 kernel/printk/printk.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Petr Mladek July 21, 2014, 9:39 a.m. | #1
On Fri 2014-07-18 16:27:59, Alex Elder wrote:
> It is possible for the log to be filled too quickly for the consoles
> to be able to keep up.  This is detected in console_unlock(), and when
> it occurs, a message is inserted to note the event.  When reviewing
> some nearby code, Petr Mládek suggested it might be nicer if this
> message were placed on a separate line.  This patch implements that
> suggestion.
> 
> Suggested-by: Petr Mládek <pmladek@suse.cz>
> Signed-off-by: Alex Elder <elder@linaro.org>

Reviewed-by: Petr Mladek <pmladek@suse.cz>

> ---
>  kernel/printk/printk.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index 13e839d..ffc9928 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -2142,9 +2142,10 @@ again:
>  		}
>  
>  		if (console_seq < log_first_seq) {
> -			len = sprintf(text, "** %u printk messages dropped ** ",
> +			len = sprintf(text,
> +				      "%s** %u printk messages dropped **\n",
> +				      (console_prev & LOG_CONT) ? "\n" : "",
>  				      (unsigned)(log_first_seq - console_seq));
> -
>  			/* messages are gone, move to first one */
>  			console_seq = log_first_seq;
>  			console_idx = log_first_idx;
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch hide | download patch | download mbox

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 13e839d..ffc9928 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2142,9 +2142,10 @@  again:
 		}
 
 		if (console_seq < log_first_seq) {
-			len = sprintf(text, "** %u printk messages dropped ** ",
+			len = sprintf(text,
+				      "%s** %u printk messages dropped **\n",
+				      (console_prev & LOG_CONT) ? "\n" : "",
 				      (unsigned)(log_first_seq - console_seq));
-
 			/* messages are gone, move to first one */
 			console_seq = log_first_seq;
 			console_idx = log_first_idx;