Skip to contentSkip to conversation

dump core on panics

PATCH New Gerd Knorr 1 participant 1 message Mar 10, 2004 User-mode Linux (UML)

lore
Share & tools
lore

Gerd Knorr

author
#0 lore raw

PATCH 1/1 dump core on panics

Hi,

New debugging feature: make the uml kernel dump core on panic when booted with "core=1".

Gerd

kernel/panic.c +15 -0
Index: linux-um-2.6.4-rc3/kernel/panic.c
===================================================================
@@ -37,6 +37,17 @@ static int __init panic_setup(char *str)
 }
 __setup("panic=", panic_setup);
 
+#ifdef __arch_um__
+extern void abort(void);
+static int dump_core = 0;
+static int __init dump_core_setup(char *str)
+{
+	dump_core = simple_strtoul(str, NULL, 0);
+	return 1;
+}
+__setup("core=", dump_core_setup);
+#endif
+
 /**
  *	panic - halt the system
  *	@fmt: The text string to print
@@ -60,6 +71,10 @@ NORET_TYPE void panic(const char * fmt, 
 	vsnprintf(buf, sizeof(buf), fmt, args);
 	va_end(args);
 	printk(KERN_EMERG "Kernel panic: %s\n",buf);
+#ifdef __arch_um__
+	if (dump_core)
+		abort();
+#endif
 	if (in_interrupt())
 		printk(KERN_EMERG "In interrupt handler - not syncing\n");
 	else if (!current->pid)

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel