Re: [PATCH] panic.c: export panic_on_oops

From: Andrew Morton
Date: Mon Oct 12 2009 - 14:39:28 EST


On Mon, 12 Oct 2009 20:23:46 +0200 Ingo Molnar <mingo@xxxxxxx> wrote:

>
> * Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> > On Mon, 12 Oct 2009 08:36:38 -0700 (PDT) Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > > I agree with the "save kernel buffer on panic" thing, but I disagree with
> > > making it anything new, and hooking into "printk()" or the console
> > > subsystem AT ALL. That's just bogus, stupid, and WRONG.
> > >
> > > What you can do is to just flush the 'log_buf' buffer (or as much of it as
> > > you want - the buffer may be a megabyte in size, and maybe you only want
> > > to flush the last 8kB or something like that) on oops. And _not_ mix this
> > > up with anything else.
> >
> > What he said. I did it that way in the Digeo kernel back in 2002.
> > Worked good.
> >
> > Doing it via a console is rather weird. It will need core kernel
> > changes to do it properly.
> >
> > Perhaps oops_enter() is a good place to mark the start of the log, and
> > flush it within oops_exit().
>
> Simplest would be to do the last 2K in oops_exit()? That gives the oops,
> and the history leading up to it. Since the blocking is 2K, the extra
> log output is for free.
>
> (unless the oops is larger than 2K - but that is rather rare.)
>

Some oops traces can be pretty large. Perhaps "oops_enter minus 1k up
to oops_exit".

The digeo kernel later got changed to package the oops into a binary
record format for logging to nvram. iirc that was for space reasons,
and for ease of downstream analysis.

That kernel used to be downloadable but I can't immediately find it.
Probably not very interesting anyway.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/