Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen: add some debug output for failed multicalls

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@xensource.com>

authored by

Jeremy Fitzhardinge and committed by
Jeremy Fitzhardinge
a122d623 e3d26976

+25
+25
arch/x86/xen/multicalls.c
··· 26 26 27 27 #include "multicalls.h" 28 28 29 + #define MC_DEBUG 1 30 + 29 31 #define MC_BATCH 32 30 32 #define MC_ARGS (MC_BATCH * 16 / sizeof(u64)) 31 33 32 34 struct mc_buffer { 33 35 struct multicall_entry entries[MC_BATCH]; 36 + #if MC_DEBUG 37 + struct multicall_entry debug[MC_BATCH]; 38 + #endif 34 39 u64 args[MC_ARGS]; 35 40 struct callback { 36 41 void (*fn)(void *); ··· 61 56 local_irq_save(flags); 62 57 63 58 if (b->mcidx) { 59 + #if MC_DEBUG 60 + memcpy(b->debug, b->entries, 61 + b->mcidx * sizeof(struct multicall_entry)); 62 + #endif 63 + 64 64 if (HYPERVISOR_multicall(b->entries, b->mcidx) != 0) 65 65 BUG(); 66 66 for (i = 0; i < b->mcidx; i++) 67 67 if (b->entries[i].result < 0) 68 68 ret++; 69 + 70 + #if MC_DEBUG 71 + if (ret) { 72 + printk(KERN_ERR "%d multicall(s) failed: cpu %d\n", 73 + ret, smp_processor_id()); 74 + for(i = 0; i < b->mcidx; i++) { 75 + printk(" call %2d/%d: op=%lu arg=[%lx] result=%ld\n", 76 + i+1, b->mcidx, 77 + b->debug[i].op, 78 + b->debug[i].args[0], 79 + b->entries[i].result); 80 + } 81 + } 82 + #endif 83 + 69 84 b->mcidx = 0; 70 85 b->argidx = 0; 71 86 } else