[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xen: Define debug_build() based on NDEBUG. Use it in a few printk's.


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Mon, 04 Feb 2013 15:44:38 +0000
  • Delivery-date: Mon, 04 Feb 2013 15:44:44 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1359543064 28800
# Node ID de3eff977231a85616672685dfcc042730d4b513
# Parent  0d4c69f7e6cf13c01a6b95a02f1fcea6167266dc
xen: Define debug_build() based on NDEBUG. Use it in a few printk's.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 0d4c69f7e6cf -r de3eff977231 xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c      Wed Jan 30 02:43:21 2013 -0800
+++ b/xen/arch/arm/traps.c      Wed Jan 30 02:51:04 2013 -0800
@@ -62,15 +62,10 @@ asmlinkage void __div0(void)
 static void print_xen_info(void)
 {
     char taint_str[TAINT_STRING_MAX_LEN];
-    char debug = 'n';
-
-#ifndef NDEBUG
-    debug = 'y';
-#endif
 
     printk("----[ Xen-%d.%d%s  arm32  debug=%c  %s ]----\n",
            xen_major_version(), xen_minor_version(), xen_extra_version(),
-           debug, print_tainted(taint_str));
+           debug_build() ? 'y' : 'n', print_tainted(taint_str));
 }
 
 uint32_t *select_user_reg(struct cpu_user_regs *regs, int reg)
diff -r 0d4c69f7e6cf -r de3eff977231 xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c       Wed Jan 30 02:43:21 2013 -0800
+++ b/xen/arch/x86/x86_64/traps.c       Wed Jan 30 02:51:04 2013 -0800
@@ -28,15 +28,10 @@
 static void print_xen_info(void)
 {
     char taint_str[TAINT_STRING_MAX_LEN];
-    char debug = 'n';
-
-#ifndef NDEBUG
-    debug = 'y';
-#endif
 
     printk("----[ Xen-%d.%d%s  x86_64  debug=%c  %s ]----\n",
            xen_major_version(), xen_minor_version(), xen_extra_version(),
-           debug, print_tainted(taint_str));
+           debug_build() ? 'y' : 'n', print_tainted(taint_str));
 }
 
 enum context { CTXT_hypervisor, CTXT_pv_guest, CTXT_hvm_guest };
diff -r 0d4c69f7e6cf -r de3eff977231 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c        Wed Jan 30 02:43:21 2013 -0800
+++ b/xen/drivers/char/console.c        Wed Jan 30 02:51:04 2013 -0800
@@ -577,11 +577,6 @@ void __init console_init_preirq(void)
 {
     char *p;
     int sh;
-#ifndef NDEBUG
-    char debug = 'y';
-#else
-    char debug = 'n';
-#endif
 
     serial_init_preirq();
 
@@ -616,7 +611,7 @@ void __init console_init_preirq(void)
     printk("Xen version %d.%d%s (%s@%s) (%s) debug=%c %s\n",
            xen_major_version(), xen_minor_version(), xen_extra_version(),
            xen_compile_by(), xen_compile_domain(),
-           xen_compiler(), debug, xen_compile_date());
+           xen_compiler(), debug_build() ? 'y' : 'n', xen_compile_date());
     printk("Latest ChangeSet: %s\n", xen_changeset());
 
     if ( opt_sync_console )
diff -r 0d4c69f7e6cf -r de3eff977231 xen/include/xen/lib.h
--- a/xen/include/xen/lib.h     Wed Jan 30 02:43:21 2013 -0800
+++ b/xen/include/xen/lib.h     Wed Jan 30 02:51:04 2013 -0800
@@ -41,8 +41,10 @@ do {                                    
 #ifndef NDEBUG
 #define ASSERT(p) \
     do { if ( unlikely(!(p)) ) assert_failed(#p); } while (0)
+#define debug_build() 1
 #else
 #define ASSERT(p) do { if ( 0 && (p) ); } while (0)
+#define debug_build() 0
 #endif
 
 #define ABS(_x) ({                              \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.