WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] xen: stringify assertion condition for printing

To: "Ian Campbell" <ian.campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xen: stringify assertion condition for printing sooner
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Mon, 17 Jan 2011 14:28:06 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 17 Jan 2011 06:30:08 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <711cbaa038cae8c03cf8.1295273724@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <711cbaa038cae8c03cf8.1295273724@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>>> On 17.01.11 at 15:15, Ian Campbell <ian.campbell@xxxxxxxxxx> wrote:
> # HG changeset patch
> # User Ian Campbell <ian.campbell@xxxxxxxxxx>
> # Date 1295273568 0
> # Node ID 711cbaa038cae8c03cf825165d2e07b0a3c94f89
> # Parent  92e51f0053b5f5c05aa0e4948f6c35be364be11c
> xen: stringify assertion condition for printing sooner.
> 
> So that:
> (XEN) Assertion '!(((*({ unsigned long __ptr; __asm__ ("" : "=r"(__ptr) : 
> "0"(&per_cpu____preempt_count)); (typeof(&per_cpu____preempt_count)) (__ptr + 
> (get_cpu_info()->per_cpu_offset)); }))) || 
> ((irq_stat[(((get_cpu_info()->processor_id)1...
> becomes:
> (XEN) Assertion '"!in_atomic()"' failed at softirq.c:61
> 
> Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

I was about to put together something similar after I saw this
ugly beast.

> diff -r 92e51f0053b5 -r 711cbaa038ca xen/include/xen/lib.h
> --- a/xen/include/xen/lib.h   Mon Jan 17 11:43:46 2011 +0000
> +++ b/xen/include/xen/lib.h   Mon Jan 17 14:12:48 2011 +0000
> @@ -35,7 +35,7 @@ do {                                    
>  
>  #ifndef NDEBUG
>  #define ASSERT(p) \
> -    do { if ( unlikely(!(p)) ) assert_failed(p); } while (0)
> +    do { if ( unlikely(!(p)) ) assert_failed(#p); } while (0)
>  #else
>  #define ASSERT(p) ((void)0)
>  #endif

But then you should also remove the second stringification in
include/asm-x86/bug.h:assert_failed(), so that it becomes

(XEN) Assertion '!in_atomic()' failed at softirq.c:61

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>