linux/drivers/char
Seiji Aguchi fc2d557c74 kmsg_dump: constrain mtdoops and ramoops to perform their actions only for KMSG_DUMP_PANIC
This series aims to develop logging facility for enterprise use.

It is important to save kernel messages reliably on enterprise system
because they are helpful for diagnosing system.

This series add kmsg_dump() to the paths loosing kernel messages.  The use
case is the following.

[Use case of reboot/poweroff/halt/emergency_restart]

 My company has often experienced the followings in our support service.
 - Customer's system suddenly reboots.
 - Customers ask us to investigate the reason of the reboot.

We recognize the fact itself because boot messages remain in
/var/log/messages.  However, we can't investigate the reason why the
system rebooted, because the last messages don't remain.  And off course
we can't explain the reason.

We can solve above problem with this patch as follows.

 Case1: reboot with command
   - We can see "Restarting system with command:" or ""Restarting system.".

 Case2: halt with command
   - We can see "System halted.".

 Case3: poweroff with command
   - We can see " Power down.".

 Case4: emergency_restart with sysrq.
   - We can see "Sysrq:" outputted in __handle_sysrq().

 Case5: emergency_restart with softdog.
   - We can see "Initiating system reboot" in watchdog_fire().

So, we can distinguish the reason of reboot, poweroff, halt and emergency_restart.

If customer executed reboot command, you may think the customer should
know the fact.  However, they often claim they don't execute the command
when they rebooted system by mistake.

No message remains on the current Linux kernel, so we can't show the proof
to the customer.  This patch improves this situation.

This patch:

Alters mtdoops and ramoops to perform their actions only for
KMSG_DUMP_PANIC, KMSG_DUMP_OOPS and KMSG_DUMP_KEXEC because they would
like to log crashes only.

Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Marco Stornelli <marco.stornelli@gmail.com>
Reviewed-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-13 08:03:07 -08:00
..
agp i915/gtt: fix ordering causing DMAR errors on object teardown. 2011-01-12 11:39:48 +10:00
hw_random BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
ip2 ip2: fix compiler warning on ip2main_pci_tbl 2010-12-10 15:20:15 -08:00
ipmi Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2011-01-11 11:02:13 -08:00
mwave drivers/char/mwave/Makefile: clean up 2010-10-27 18:03:15 -07:00
pcmcia pcmcia/ipwireless: don't use flush_scheduled_work() 2010-12-24 15:59:06 +01:00
rio drivers/char/rio/Makefile: replace the use of <module>-objs with <module>-y 2010-10-27 18:03:15 -07:00
tpm Merge branch 'master' into next 2011-01-10 09:46:24 +11:00
xilinx_hwicap Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
Kconfig drivers: char: hvc: add arm JTAG DCC console support 2010-11-30 17:27:13 -08:00
Makefile drivers: char: hvc: add arm JTAG DCC console support 2010-11-30 17:27:13 -08:00
amiserial.c BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
apm-emulation.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-10-24 13:41:39 -07:00
applicom.c drivers/char/applicom.c: fix information leak to userland 2010-10-27 18:03:14 -07:00
applicom.h
bfin-otp.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
bfin_jtag_comm.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
briq_panel.c BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
bsr.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
cd1865.h
cs5535_gpio.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
cyclades.c tty: icount changeover for other main devices 2010-10-22 10:20:05 -07:00
digi1.h
digiFep1.h
digiPCI.h
ds1302.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
ds1620.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
dsp56k.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
dtlk.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
efirtc.c efirtc: explicitly set llseek to no_llseek 2009-12-16 07:19:59 -08:00
epca.c epca: Kill the big kernel lock 2010-08-10 13:47:40 -07:00
epca.h
epcaconfig.h
generic_nvram.c drivers: autoconvert trivial BKL users to private mutex 2010-10-05 15:01:04 +02:00
generic_serial.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
genrtc.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
hangcheck-timer.c Input: sysrq - drop tty argument form handle_sysrq() 2010-08-21 00:34:45 -07:00
hpet.c BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
hvc_beat.c Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6 2010-02-25 15:38:37 -08:00
hvc_console.c drivers/char/hvc_console.c: remove unneeded __set_current_state(TASK_RUNNING) 2010-10-27 18:03:14 -07:00
hvc_console.h hvc_console: make the ops pointer const. 2010-02-24 14:22:32 +10:30
hvc_dcc.c drivers: char: hvc: add arm JTAG DCC console support 2010-11-30 17:27:13 -08:00
hvc_irq.c
hvc_iseries.c Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
hvc_iucv.c [S390] hvc_iucv: do not call iucv_unregister if iucv_register failed 2010-10-25 16:10:17 +02:00
hvc_rtas.c hvc_console: make the ops pointer const. 2010-02-24 14:22:32 +10:30
hvc_tile.c char: hvc: check for error case 2010-10-14 14:48:12 -04:00
hvc_udbg.c hvc_console: make the ops pointer const. 2010-02-24 14:22:32 +10:30
hvc_vio.c drivers/char/hvc_vio: Use static const char arrays 2010-11-29 15:48:18 +11:00
hvc_xen.c Merge branch 'stable/xen-pcifront-0.8.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen 2010-10-28 17:11:17 -07:00
hvcs.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
hvsi.c hvsi: don't use flush_scheduled_work() 2010-12-24 15:59:07 +01:00
i8k.c Fix gcc 4.5.1 miscompiling drivers/char/i8k.c (again) 2010-11-15 13:27:06 -08:00
isicom.c isicom: kill off the BKL 2010-08-10 13:47:40 -07:00
istallion.c BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
lp.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
mbcs.c drivers: autoconvert trivial BKL users to private mutex 2010-10-05 15:01:04 +02:00
mbcs.h
mem.c vfs: introduce FMODE_UNSIGNED_OFFSET for allowing negative f_pos 2010-10-25 21:18:21 -04:00
misc.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
mmtimer.c SGI Altix IA64 mmtimer: eliminate long interval timer holdoffs 2010-10-27 18:03:14 -07:00
moxa.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
moxa.h
mspec.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
mxser.c drivers/char/mxser.c: fix compilation warning in mxser.c 2010-10-27 18:03:15 -07:00
mxser.h
nozomi.c nozomi: Fix warning from the previous TIOCGCOUNT changes 2010-11-09 14:49:38 -08:00
nsc_gpio.c
nvram.c drivers: autoconvert trivial BKL users to private mutex 2010-10-05 15:01:04 +02:00
nwbutton.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
nwbutton.h
nwflash.c drivers: autoconvert trivial BKL users to private mutex 2010-10-05 15:01:04 +02:00
pc8736x_gpio.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
ppdev.c drivers/char/ppdev.c: fix information leak to userland 2010-10-27 18:03:14 -07:00
ps3flash.c drop unused dentry argument to ->fsync 2010-05-27 22:05:02 -04:00
ramoops.c kmsg_dump: constrain mtdoops and ramoops to perform their actions only for KMSG_DUMP_PANIC 2011-01-13 08:03:07 -08:00
random.c random: Use this_cpu_inc_return 2010-12-17 15:18:05 +01:00
raw.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
riscom8.c riscom8: kill use of lock_kernel 2010-08-10 13:47:40 -07:00
riscom8.h
riscom8_reg.h
rocket.c rocket: fix compiler warning on rocket_pci_ids 2010-12-10 15:20:14 -08:00
rocket.h
rocket_int.h
rtc.c of/device: Replace struct of_device with struct platform_device 2010-08-06 09:25:50 -06:00
scc.h
scx200_gpio.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
ser_a2232.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
ser_a2232.h
ser_a2232fw.ax
ser_a2232fw.h
serial167.c BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
snsc.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
snsc.h headers: kobject.h redux 2011-01-10 08:51:44 -08:00
snsc_event.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sonypi.c sonypi: don't use flush_scheduled_work() 2010-12-24 15:59:07 +01:00
specialix.c Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 2011-01-07 14:39:20 -08:00
specialix_io8.h
stallion.c BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
sx.c BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
sx.h
sxboards.h
sxwindow.h
synclink.c tty: icount changeover for other main devices 2010-10-22 10:20:05 -07:00
synclink_gt.c drivers/char/synclink_gt.c: add extended sync feature 2010-10-27 18:03:14 -07:00
synclinkmp.c tty: icount changeover for other main devices 2010-10-22 10:20:05 -07:00
tb0219.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
tlclk.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
toshiba.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
ttyprintk.c add ttyprintk driver 2010-10-22 10:20:02 -07:00
uv_mmtimer.c BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
viotape.c Merge branch 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl 2010-10-22 10:52:56 -07:00
virtio_console.c Char: virtio_console, fix memory leak 2010-11-24 15:21:12 +10:30
vme_scc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00