* Saving the kernel log accross boots
@ 2009-06-25 14:40 Martin Meuli
2009-06-25 15:23 ` Bill Gatliff
2009-06-25 17:02 ` Marco
0 siblings, 2 replies; 5+ messages in thread
From: Martin Meuli @ 2009-06-25 14:40 UTC (permalink / raw)
To: linux-embedded
Hi All
In case of a crash we would like to save the kernel log and retrieve it in
the next boot.
There are already several suggestions on how to do it on this and other
lists.
(Kernel crashing and log buffers: Robin Getz)
Unfortunately we don't have extra SRAM to use for it. We need to do it in
the 'normal' RAM.
ARCH=ARM
What we did:
- modify kernel/printk.c: use
__attribute__((__section__(".bss.kringbuf"... to put the log related stuf
into a separate section
- modify the linker script to link .bss.kringbuf at the start of the .bss
section
- modify arch/arm/kernel/head-common.S to exclude the new section from
being nulled (if it was a watchdog restart)
- modify kernel/printk.c to use cach_flush after prink
- make sure the bootloader does not overwrite that memory
This seems to work.
After a crash we get the messages from the new boot and the last crash.
It seems that the decompress code is using memory at the end of the kernel
and destroys the log. So we have to use the bootloader to decompress the
image into RAM.
Before digging any deeper I would like to know if someone as a better
(more general) idea.
Regards, Martin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Saving the kernel log accross boots
2009-06-25 14:40 Saving the kernel log accross boots Martin Meuli
@ 2009-06-25 15:23 ` Bill Gatliff
2009-06-25 15:29 ` Wolfram Sang
2009-06-25 17:02 ` Marco
1 sibling, 1 reply; 5+ messages in thread
From: Bill Gatliff @ 2009-06-25 15:23 UTC (permalink / raw)
To: Martin Meuli; +Cc: linux-embedded
Martin Meuli wrote:
>
> Before digging any deeper I would like to know if someone as a better
> (more general) idea.
Could you stuff the output into an MTD device?
What about netconsole, or putting the console on a serial port? Then
you could send the log out before and up to the point the crash happens.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Saving the kernel log accross boots
2009-06-25 14:40 Saving the kernel log accross boots Martin Meuli
2009-06-25 15:23 ` Bill Gatliff
@ 2009-06-25 17:02 ` Marco
1 sibling, 0 replies; 5+ messages in thread
From: Marco @ 2009-06-25 17:02 UTC (permalink / raw)
To: Martin Meuli; +Cc: linux-embedded
Martin Meuli wrote:
> Hi All
>
> In case of a crash we would like to save the kernel log and retrieve it
> in the next boot.
> There are already several suggestions on how to do it on this and other
> lists.
> (Kernel crashing and log buffers: Robin Getz)
> Unfortunately we don't have extra SRAM to use for it. We need to do it
> in the 'normal' RAM.
>
> ARCH=ARM
>
> What we did:
> - modify kernel/printk.c: use
> __attribute__((__section__(".bss.kringbuf"... to put the log related
> stuf into a separate section
> - modify the linker script to link .bss.kringbuf at the start of the
> .bss section
> - modify arch/arm/kernel/head-common.S to exclude the new section from
> being nulled (if it was a watchdog restart)
> - modify kernel/printk.c to use cach_flush after prink
> - make sure the bootloader does not overwrite that memory
>
> This seems to work.
> After a crash we get the messages from the new boot and the last crash.
> It seems that the decompress code is using memory at the end of the
> kernel and destroys the log. So we have to use the bootloader to
> decompress the image into RAM.
>
> Before digging any deeper I would like to know if someone as a better
> (more general) idea.
>
> Regards, Martin
I submitted for a review a new filesystem for 2.6.30 called pramfs that
it can be useful for your case. You could use a little piece of ram to
store the log.
Marco
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-06-26 8:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-25 14:40 Saving the kernel log accross boots Martin Meuli
2009-06-25 15:23 ` Bill Gatliff
2009-06-25 15:29 ` Wolfram Sang
2009-06-26 8:21 ` Martin Meuli
2009-06-25 17:02 ` Marco
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).