svn commit: r237449 - in projects/amd64_xen_pv/sys: ddb kern

Attilio Rao attilio at FreeBSD.org
Fri Jun 22 18:18:50 UTC 2012


Author: attilio
Date: Fri Jun 22 18:18:49 2012
New Revision: 237449
URL: http://svn.freebsd.org/changeset/base/237449

Log:
  Remove the code for redirecting the panic message on emergency console
  and use it directly in vprintf() and db_printf(). This will let most of the
  output to get out when booting FreeBSD and when debugging directly in the
  emergency console.

Modified:
  projects/amd64_xen_pv/sys/ddb/db_output.c
  projects/amd64_xen_pv/sys/kern/kern_shutdown.c
  projects/amd64_xen_pv/sys/kern/subr_prf.c

Modified: projects/amd64_xen_pv/sys/ddb/db_output.c
==============================================================================
--- projects/amd64_xen_pv/sys/ddb/db_output.c	Fri Jun 22 18:01:22 2012	(r237448)
+++ projects/amd64_xen_pv/sys/ddb/db_output.c	Fri Jun 22 18:18:49 2012	(r237449)
@@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$");
 #include <sys/sysctl.h>
 
 #include <machine/stdarg.h>
+#ifdef XEN
+#include <machine/xen/xen-os.h>
+#endif
 
 #include <ddb/ddb.h>
 #include <ddb/db_output.h>
@@ -337,6 +340,11 @@ db_printf(const char *fmt, ...)
 #endif
 
 	va_start(listp, fmt);
+
+#ifdef XEN
+	/* Redirect the db_printf() output also to the emergency console. */
+	vprintk(fmt, listp);
+#endif
 	retval = kvprintf (fmt, db_putchar, &dca, db_radix, listp);
 	va_end(listp);
 

Modified: projects/amd64_xen_pv/sys/kern/kern_shutdown.c
==============================================================================
--- projects/amd64_xen_pv/sys/kern/kern_shutdown.c	Fri Jun 22 18:01:22 2012	(r237448)
+++ projects/amd64_xen_pv/sys/kern/kern_shutdown.c	Fri Jun 22 18:18:49 2012	(r237449)
@@ -616,18 +616,10 @@ panic(const char *fmt, ...)
 		panicstr = buf;
 		cngrab();
 		printf("panic: %s\n", buf);
-#ifdef XEN
-		printk("panic: %s\n", buf);
-#endif
 	} else {
 		printf("panic: ");
 		vprintf(fmt, ap);
 		printf("\n");
-#ifdef XEN
-		printk("panic: ");
-		vprintk(fmt, ap);
-		printk("\n");
-#endif
 	}
 	va_end(ap);
 #ifdef SMP

Modified: projects/amd64_xen_pv/sys/kern/subr_prf.c
==============================================================================
--- projects/amd64_xen_pv/sys/kern/subr_prf.c	Fri Jun 22 18:01:22 2012	(r237448)
+++ projects/amd64_xen_pv/sys/kern/subr_prf.c	Fri Jun 22 18:18:49 2012	(r237449)
@@ -68,6 +68,9 @@ __FBSDID("$FreeBSD$");
  * ANSI and traditional C compilers.
  */
 #include <machine/stdarg.h>
+#ifdef XEN
+#include <machine/xen/xen-os.h>
+#endif
 
 #define TOCONS	0x01
 #define TOTTY	0x02
@@ -388,6 +391,10 @@ vprintf(const char *fmt, va_list ap)
 	pca.p_bufr = NULL;
 #endif
 
+#ifdef XEN
+	/* Redirect the vprintf() output also to the emergency console. */
+	vprintk(fmt, ap);
+#endif
 	retval = kvprintf(fmt, putchar, &pca, 10, ap);
 
 #ifdef PRINTF_BUFR_SIZE


More information about the svn-src-projects mailing list