Re: [PATCH 018/18] kdb-add-kdump-cmd
Joe Korty <[email protected]> Fri, 11 Jul 2008 10:37:47 -0400
| Newsgroups | gmane.linux.kernel.debugging |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Jul 11, 2008 at 02:16:45AM -0400, jidong xiao wrote: > As I understand kexec/kdump code is arch dependent, but from your > patch there is no arch specific piece of code, please can you explain > this? > > Thanks > Jason Xiao Hi Jason, Well, kdump has a generic component as well a per-arch support components, so I guess if one is on an arch where the per-arch component is not present the the call to crash_kexec() will (hopefully) NOP. However, I am not a user of kdump, and we are (so far) an x86-only shop, so the behavour of crash_kexec() on other arches is unknown to me. I've forwarded your letter to the author of the patch, perhaps he will be able to provide additional illumination. Regards, Joe > On Fri, Jul 11, 2008 at 4:57 AM, <[email protected]> wrote: > > Add kdump command to KDB. This command triggers > > a dump of the kernel via the kexec/kdump mechanism. > > > > Author: Jim Houston <[email protected]> > > Signed-off-by: Joe Korty <[email protected]> > > > > Index: 2.6.26-rc9/kdb/modules/Makefile > > =================================================================== > > --- 2.6.26-rc9.orig/kdb/modules/Makefile 2008-07-10 12:14:15.000000000 -0400 > > +++ 2.6.26-rc9/kdb/modules/Makefile 2008-07-10 13:41:59.000000000 -0400 > > @@ -6,7 +6,7 @@ > > # Copyright (c) 1999-2006 Silicon Graphics, Inc. All Rights Reserved. > > # > > > > -obj-$(CONFIG_KDB_MODULES) += kdbm_pg.o kdbm_task.o kdbm_vm.o kdbm_sched.o > > +obj-$(CONFIG_KDB_MODULES) += kdbm_pg.o kdbm_task.o kdbm_vm.o kdbm_sched.o kdbm_kdump.o > > obj-m += kdbm_debugtypes.o > > ifdef CONFIG_X86 > > obj-$(CONFIG_KDB_MODULES) += kdbm_x86.o > > Index: 2.6.26-rc9/kdb/modules/kdbm_kdump.c > > =================================================================== > > --- /dev/null 1970-01-01 00:00:00.000000000 +0000 > > +++ 2.6.26-rc9/kdb/modules/kdbm_kdump.c 2008-07-10 13:40:59.000000000 -0400 > > @@ -0,0 +1,43 @@ > > +/* > > + * This file is subject to the terms and conditions of the GNU General Public > > + * License. See the file "COPYING" in the main directory of this archive > > + * for more details. > > + * > > + * Copyright (c) 2006 Concurrent Computer Corp > > + */ > > + > > +#include <linux/kdb.h> > > +#include <linux/kdbprivate.h> > > +#include <linux/module.h> > > +#include <linux/init.h> > > +#include <linux/irq.h> > > +#include <linux/sched.h> > > +#include <linux/kexec.h> > > + > > + > > +MODULE_AUTHOR("Concurrent Computer Corp"); > > +MODULE_DESCRIPTION("interface to request kdump crash dump"); > > +MODULE_LICENSE("GPL"); > > + > > +static int > > +kdbm_kdump(int argc, const char **argv) > > +{ > > + kdb_printf("Calling crash_kexec\n"); > > + crash_kexec(get_irq_regs()); > > + kdb_printf("crash_kexec failed\n"); > > + return 0; > > +} > > + > > +static int __init kdbm_kdump_init(void) > > +{ > > + kdb_register("kdump", kdbm_kdump, "", "request kdump crash dump", 0); > > + return 0; > > +} > > + > > +static void __exit kdbm_kdump_exit(void) > > +{ > > + kdb_unregister("kdump"); > > +} > > + > > +module_init(kdbm_kdump_init) > > +module_exit(kdbm_kdump_exit) > > Index: 2.6.26-rc9/kernel/kexec.c > > =================================================================== > > --- 2.6.26-rc9.orig/kernel/kexec.c 2008-07-10 12:12:51.000000000 -0400 > > +++ 2.6.26-rc9/kernel/kexec.c 2008-07-10 13:40:59.000000000 -0400 > > @@ -19,6 +19,7 @@ > > #include <linux/reboot.h> > > #include <linux/ioport.h> > > #include <linux/hardirq.h> > > +#include <linux/module.h> > > #include <linux/elf.h> > > #include <linux/elfcore.h> > > #include <linux/utsrelease.h> > > @@ -1077,6 +1078,7 @@ > > BUG_ON(!locked); > > } > > } > > +EXPORT_SYMBOL_GPL(crash_kexec); > > > > static u32 *append_elf_note(u32 *buf, char *name, unsigned type, void *data, > > size_t data_len) --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.