Re: printk: what is going on with additional newlines?

Pavel Machek
2017-08-29T20:24:51Z

[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]

Hi!

> > In 4.13-rc, printk("foo"); printk("bar"); seems to produce
> > foo\nbar. That's... quite surprising/unwelcome. What is going on
> > there? Are timestamps responsible?
>
> No.
>
> It's actively trying to treach you not to do shit.
>
> If you want to continue a line, you NEED to use KERN_CONT.
>
> That has always been true. It hasn't always been enforced, though.

Dumping hex buffer for debugging should not be a rocket science. You
are welcome not add checkpatch rules to prevent such code from being
merged...

> Stop doing continuations at all please. But if you do, you'd better
> use KERN_CONT. And if you don't, and you get multiple lines, it's your
> own damn fault.

..but please don't make debugging harder than it already is. Just
because you spend too much time doing kernel does not mean that
everyone is; having to remember "this is kernel, so it has to be
special, you have to do printk, not printf" is bad enough, having
different semantics is even more ugly.

Thanks,

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]