> On Tue, 2010-10-19 at 10:52 +0200, ext KOSAKI Motohiro wrote:> > > Hi,> > > > > > Final messages from reboot, halt and poweroff aren't output to disk because klogd/syslogd > > > has been killed and root file system has been turned read-only.> > > > > > Final messages from emergency_restart aren't output to disk as well because system may> > > reboot before klogd/syslogd outputs messages to disk.> > > > > > Therefore, it is better to put kmsg_dumper in reboot/halt/poweroff/emergency_restart path.> > > Any comments/advices are welcome.> > > > I think mtdoops user don't want to dump logs if a system reboot/poweroff> > safely because mtd device have write count limitation. and they are main> > user of kmsg_dump().

mtdoops was the only user until ramoops came along.

> Right, at least this is how we use mtdoops - we log crashes.

Fair enough. So I suppose the existing clients (mtdoops_do_dump andramoops_do_dump) should be altered to inspect the `reason' argument,and return if it isn't KMSG_DUMP_OOPS, KMSG_DUMP_PANIC orKMSG_DUMP_KEXEC (I assume?)

If that sounds suitable then I'd ask Seiji to update and resend thepatch, along with a complete changelog as earlier dicussed.

I'd suggest doing it as two patches, the first of which alters mtdoopsand ramoops to perform their actions only for the appropriate `reason'values.