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

[Xen-devel] [PATCH 11/12] xen: add some debug output for failed multical

To: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 11/12] xen: add some debug output for failed multicalls
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Mon, 15 Oct 2007 13:48:51 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, LKML <linux-kernel@xxxxxxxxxxxxxxx>, Andi Kleen <ak@xxxxxxx>, Chris Wright <chrisw@xxxxxxxxxxxx>, virtualization@xxxxxxxxxxxxxx, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir@xxxxxxxxxxxxx>, Stable Kernel <stable@xxxxxxxxxx>
Delivery-date: Mon, 15 Oct 2007 14:38:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20071015204840.074767068@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.46-1
Multicalls are expected to never fail, and the normal response to a
failed multicall is very terse.  In the interests of better
debuggability, add some more verbose output.  It may be worth turning
this off once it all seems more tested.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx>

---
 arch/x86/xen/multicalls.c |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

===================================================================
--- a/arch/x86/xen/multicalls.c
+++ b/arch/x86/xen/multicalls.c
@@ -26,11 +26,16 @@
 
 #include "multicalls.h"
 
+#define MC_DEBUG       1
+
 #define MC_BATCH       32
 #define MC_ARGS                (MC_BATCH * 16 / sizeof(u64))
 
 struct mc_buffer {
        struct multicall_entry entries[MC_BATCH];
+#if MC_DEBUG
+       struct multicall_entry debug[MC_BATCH];
+#endif
        u64 args[MC_ARGS];
        struct callback {
                void (*fn)(void *);
@@ -56,11 +61,31 @@ void xen_mc_flush(void)
        local_irq_save(flags);
 
        if (b->mcidx) {
+#if MC_DEBUG
+               memcpy(b->debug, b->entries,
+                      b->mcidx * sizeof(struct multicall_entry));
+#endif
+
                if (HYPERVISOR_multicall(b->entries, b->mcidx) != 0)
                        BUG();
                for (i = 0; i < b->mcidx; i++)
                        if (b->entries[i].result < 0)
                                ret++;
+
+#if MC_DEBUG
+               if (ret) {
+                       printk(KERN_ERR "%d multicall(s) failed: cpu %d\n",
+                              ret, smp_processor_id());
+                       for(i = 0; i < b->mcidx; i++) {
+                               printk("  call %2d/%d: op=%lu arg=[%lx] 
result=%ld\n",
+                                      i+1, b->mcidx,
+                                      b->debug[i].op,
+                                      b->debug[i].args[0],
+                                      b->entries[i].result);
+                       }
+               }
+#endif
+
                b->mcidx = 0;
                b->argidx = 0;
        } else

-- 


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

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