Re: [GIT PULL] trivial for 4.9

From: Steven Rostedt
Date: Sat Oct 08 2016 - 09:23:36 EST


On Fri, Oct 07, 2016 at 04:09:51PM -0700, Tony Luck wrote:
> On Fri, Oct 7, 2016 at 4:01 PM, Tony Luck <tony.luck@xxxxxxxxx> wrote:
> > What if there isn't a "next printk" call for hours, or days?
> >
> > That poor little message without a "\n" will sit in the kernel buffers,
> > and the user who might want to see the message can't, until some
> > unrelated thing happens to print something.
>
> Retracted ... I'm sure that at some point in the past it happened like
> that ... but
> I just retested on 4.8 and the first message (with no "\n") showed up on the
> serial port just fine without some other message to push it out. When the
> next message came along, a "\n" was auto-inserted.
>

No there was a small window in time that it did just that. And it caused me a
day of debugging. My ftrace self tests at boot up do something like:

printk("testing X....");

if (test(X))
printk(" PASSED\n");
else
printk(" FAILED\n");


And with this new change, the "testing X..." never appeared, but it caused the
system to crash, It confused me because it crashed right after a:

testing Y.... PASSED

came out.

Thus I was debugging why Y failed caused the system crash even though it
reported a passing statement. The sad part was that my bug came in after this
updated to printk. So in bisecting I didn't notice. But what I did notice in
bisecting, was test X, and I tried that, and sure enough it crashed. Then
that's where I started looking at changes in printk.

I made a minor stink about it, and we converted the behavior back to where
kernel writes to printk would always go to the console.

-- Steve