diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2010-10-15 06:52:46 -0400 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-10-22 15:57:35 -0400 |
commit | cb52e6d9ed9bb9cf74f8396a603ecf12b64c1ec1 (patch) | |
tree | f133786c7cdbe6f36182484cc85394f62b7f901d /drivers | |
parent | a52521f149c42b35a28423ee30be9a7afa51dfbf (diff) |
xen: improvements to VIRQ_DEBUG output
* Fix bitmask formatting on 64 bit by specifying correct field widths.
* Output both global and local masked and pending information.
* Indicate in list of pending interrupts whether they are pending in
the L2, masked globally and/or masked locally.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/xen/events.c | 78 |
1 files changed, 56 insertions, 22 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index a3362479cfcf..b0cf80bf4169 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -579,41 +579,75 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id) | |||
579 | { | 579 | { |
580 | struct shared_info *sh = HYPERVISOR_shared_info; | 580 | struct shared_info *sh = HYPERVISOR_shared_info; |
581 | int cpu = smp_processor_id(); | 581 | int cpu = smp_processor_id(); |
582 | unsigned long *cpu_evtchn = cpu_evtchn_mask(cpu); | ||
582 | int i; | 583 | int i; |
583 | unsigned long flags; | 584 | unsigned long flags; |
584 | static DEFINE_SPINLOCK(debug_lock); | 585 | static DEFINE_SPINLOCK(debug_lock); |
586 | struct vcpu_info *v; | ||
585 | 587 | ||
586 | spin_lock_irqsave(&debug_lock, flags); | 588 | spin_lock_irqsave(&debug_lock, flags); |
587 | 589 | ||
588 | printk("vcpu %d\n ", cpu); | 590 | printk("\nvcpu %d\n ", cpu); |
589 | 591 | ||
590 | for_each_online_cpu(i) { | 592 | for_each_online_cpu(i) { |
591 | struct vcpu_info *v = per_cpu(xen_vcpu, i); | 593 | int pending; |
592 | printk("%d: masked=%d pending=%d event_sel %08lx\n ", i, | 594 | v = per_cpu(xen_vcpu, i); |
593 | (get_irq_regs() && i == cpu) ? xen_irqs_disabled(get_irq_regs()) : v->evtchn_upcall_mask, | 595 | pending = (get_irq_regs() && i == cpu) |
594 | v->evtchn_upcall_pending, | 596 | ? xen_irqs_disabled(get_irq_regs()) |
595 | v->evtchn_pending_sel); | 597 | : v->evtchn_upcall_mask; |
598 | printk("%d: masked=%d pending=%d event_sel %0*lx\n ", i, | ||
599 | pending, v->evtchn_upcall_pending, | ||
600 | (int)(sizeof(v->evtchn_pending_sel)*2), | ||
601 | v->evtchn_pending_sel); | ||
602 | } | ||
603 | v = per_cpu(xen_vcpu, cpu); | ||
604 | |||
605 | printk("\npending:\n "); | ||
606 | for (i = ARRAY_SIZE(sh->evtchn_pending)-1; i >= 0; i--) | ||
607 | printk("%0*lx%s", (int)sizeof(sh->evtchn_pending[0])*2, | ||
608 | sh->evtchn_pending[i], | ||
609 | i % 8 == 0 ? "\n " : " "); | ||
610 | printk("\nglobal mask:\n "); | ||
611 | for (i = ARRAY_SIZE(sh->evtchn_mask)-1; i >= 0; i--) | ||
612 | printk("%0*lx%s", | ||
613 | (int)(sizeof(sh->evtchn_mask[0])*2), | ||
614 | sh->evtchn_mask[i], | ||
615 | i % 8 == 0 ? "\n " : " "); | ||
616 | |||
617 | printk("\nglobally unmasked:\n "); | ||
618 | for (i = ARRAY_SIZE(sh->evtchn_mask)-1; i >= 0; i--) | ||
619 | printk("%0*lx%s", (int)(sizeof(sh->evtchn_mask[0])*2), | ||
620 | sh->evtchn_pending[i] & ~sh->evtchn_mask[i], | ||
621 | i % 8 == 0 ? "\n " : " "); | ||
622 | |||
623 | printk("\nlocal cpu%d mask:\n ", cpu); | ||
624 | for (i = (NR_EVENT_CHANNELS/BITS_PER_LONG)-1; i >= 0; i--) | ||
625 | printk("%0*lx%s", (int)(sizeof(cpu_evtchn[0])*2), | ||
626 | cpu_evtchn[i], | ||
627 | i % 8 == 0 ? "\n " : " "); | ||
628 | |||
629 | printk("\nlocally unmasked:\n "); | ||
630 | for (i = ARRAY_SIZE(sh->evtchn_mask)-1; i >= 0; i--) { | ||
631 | unsigned long pending = sh->evtchn_pending[i] | ||
632 | & ~sh->evtchn_mask[i] | ||
633 | & cpu_evtchn[i]; | ||
634 | printk("%0*lx%s", (int)(sizeof(sh->evtchn_mask[0])*2), | ||
635 | pending, i % 8 == 0 ? "\n " : " "); | ||
596 | } | 636 | } |
597 | printk("pending:\n "); | ||
598 | for(i = ARRAY_SIZE(sh->evtchn_pending)-1; i >= 0; i--) | ||
599 | printk("%08lx%s", sh->evtchn_pending[i], | ||
600 | i % 8 == 0 ? "\n " : " "); | ||
601 | printk("\nmasks:\n "); | ||
602 | for(i = ARRAY_SIZE(sh->evtchn_mask)-1; i >= 0; i--) | ||
603 | printk("%08lx%s", sh->evtchn_mask[i], | ||
604 | i % 8 == 0 ? "\n " : " "); | ||
605 | |||
606 | printk("\nunmasked:\n "); | ||
607 | for(i = ARRAY_SIZE(sh->evtchn_mask)-1; i >= 0; i--) | ||
608 | printk("%08lx%s", sh->evtchn_pending[i] & ~sh->evtchn_mask[i], | ||
609 | i % 8 == 0 ? "\n " : " "); | ||
610 | 637 | ||
611 | printk("\npending list:\n"); | 638 | printk("\npending list:\n"); |
612 | for(i = 0; i < NR_EVENT_CHANNELS; i++) { | 639 | for (i = 0; i < NR_EVENT_CHANNELS; i++) { |
613 | if (sync_test_bit(i, sh->evtchn_pending)) { | 640 | if (sync_test_bit(i, sh->evtchn_pending)) { |
614 | printk(" %d: event %d -> irq %d\n", | 641 | int word_idx = i / BITS_PER_LONG; |
642 | printk(" %d: event %d -> irq %d%s%s%s\n", | ||
615 | cpu_from_evtchn(i), i, | 643 | cpu_from_evtchn(i), i, |
616 | evtchn_to_irq[i]); | 644 | evtchn_to_irq[i], |
645 | sync_test_bit(word_idx, &v->evtchn_pending_sel) | ||
646 | ? "" : " l2-clear", | ||
647 | !sync_test_bit(i, sh->evtchn_mask) | ||
648 | ? "" : " globally-masked", | ||
649 | sync_test_bit(i, cpu_evtchn) | ||
650 | ? "" : " locally-masked"); | ||
617 | } | 651 | } |
618 | } | 652 | } |
619 | 653 | ||