2013-04-29 11:34:21

by [email protected]

[permalink] [raw]
Subject: debugging live kernel

In case if my currently running kernel starts to do strange things and I
suspect it might have bug or was corrupted, what steps can be taken to
check for more info, other then dmesg?


2013-04-29 20:31:04

by Rob Landley

[permalink] [raw]
Subject: Re: debugging live kernel

On 04/29/2013 06:34:08 AM, [email protected] wrote:
> In case if my currently running kernel starts to do strange things
> and I
> suspect it might have bug or was corrupted, what steps can be taken to
> check for more info, other then dmesg?

If you built it with kgdb, you can use that. If you have a jtag
connected to the hardware, you can use that. If you built with kernel
crash dumps, you can use that. If you kept the vmlinux file
corresponding to your bzImage you can (VERY CAREFULLY) look at
/dev/kmem with gdb (or use the corresponding system.map to decode
addresses by hand; note this is horrible but possible)...

There's levels of difficulty here: "Kernel was hooked up to monitoring
stuff before it went wrong" is the easy path. "Kept the box it came in"
is the less easy path. "Flying blind on a rocketcycle" is not easy, and
you pretty much have to have experience with the first two before you
can even attempt the third. (And unless you're off in the enterprise
space you generally go "Can I reproduce the issue? Let's reproduce it
under a properly instrumented environment. If I _can't_ reproduce the
issue then a reboot fixed it and we're good.)

Your problem description is way too vague to give specific advice
about. "If I start to feel poorly, is there anything I can do to
diagnose my illness?" Ummm... yes? (No, I'm not going to exchange a
dozen emails with you to about it, and nothing here should be
considered medical advice.)

Rob-