[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b867ee8a02043ec6b18c9330bfe3a091d66c816c.camel@perches.com>
Date: Tue, 14 Apr 2020 12:04:32 -0700
From: Joe Perches <joe@...ches.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
Thierry Reding <thierry.reding@...il.com>,
paul@...pouillou.net, Dan Carpenter <dan.carpenter@...cle.com>
Cc: u.kleine-koenig@...gutronix.de, linux-pwm@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] pwm: Add missing '\n' in log messages
On Tue, 2020-04-14 at 20:30 +0200, Christophe JAILLET wrote:
> Being able to detect early missing trailing '\n' would help maintainers
> and patch providers.
>
> You are the 2nd person (I've added Paul Cercueil in copy of my reply)
> who reports that he is thinking that it is no more required to add a '\n'.
The printk subsystem will, for every printk, check
if the last printk has a newline termination and if
it doesn't and the current printk does not start with
KERN_CONT will insert a newline.
The negative to this approach is the last printk,
if it does not have a newline, is buffered and not
emitted until another printk occurs.
There is also the (now small) possibility that
multiple concurrent kernel threads or processes
could interleave printks without a terminating
newline and a different process could emit a
printk that starts with KERN_CONT and the emitted
message could be garbled.
See:
commit 4bcc595ccd80decb4245096e3d1258989c50ed41
Author: Linus Torvalds <torvalds@...ux-foundation.org>
Date: Sat Oct 8 20:32:40 2016 -0700
printk: reinstate KERN_CONT for printing continuation lines
Powered by blists - more mailing lists