Skip to contentSkip to conversation

UML - Dump core on panic

PATCH In review Jeff Dike 1 participant 1 message Apr 11, 2007 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 3/4 UML - Dump core on panic

Dump core after a panic. This will provide better debugging information than is currently available.

--

 arch/um/include/os.h     |    1 +
 arch/um/kernel/um_arch.c |    2 +-
 arch/um/os-Linux/util.c  |    6 ++++++
 3 files changed, 8 insertions(+), 1 deletion(-)
arch/um/include/os.h +1 -0
Index: linux-2.6.21-mm/arch/um/include/os.h
===================================================================
@@ -281,6 +281,7 @@ extern void setup_machinename(char *mach
 extern void setup_hostinfo(char *buf, int len);
 extern int setjmp_wrapper(void (*proc)(void *, void *), ...);
 extern void os_log_info(char *fmt, va_list ap);
+extern void os_dump_core(void);
 
 /* time.c */
 #define BILLION (1000 * 1000 * 1000)
arch/um/kernel/um_arch.c +1 -1
Index: linux-2.6.21-mm/arch/um/kernel/um_arch.c
===================================================================
@@ -474,7 +474,7 @@ static int panic_exit(struct notifier_bl
 	show_regs(&(current->thread.regs));
 	bust_spinlocks(0);
 	uml_exitcode = 1;
-	machine_halt();
+	os_dump_core();
 	return 0;
 }
 
arch/um/os-Linux/util.c +6 -0
Index: linux-2.6.21-mm/arch/um/os-Linux/util.c
===================================================================
@@ -148,3 +148,9 @@ void os_log_info(char *fmt, va_list ap)
 	vsnprintf(&logging_buf[len], sizeof(logging_buf) - len, fmt, ap);
 	write(logging_fd, logging_buf, strlen(logging_buf));
 }
+
+void os_dump_core(void)
+{
+	signal(SIGSEGV, SIG_DFL);
+	abort();
+}

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel