xcp-1.6-updates/xen-4.1.hg

changeset 23228:0b0d74c97010

IO-APIC: Reformat IO-APIC RTE debug info (v2)

Having the columns aligned makes for much easier reading. Also remove
the commas which only add to visual clutter in combination with
spaces.

Furthermore, printing fewer characters makes it less likely that the
serial buffer will overflow resulting in loss of critical debugging
information.

Changes since v1:
* Format vector as hex rather than dec
* Contract some names
* destination mode uses 'L' or 'P' instead of full words
* trigger mode uses 'L' or 'E' instead of full words
* delivery mode uses short string instead of a number

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 24700:5bd5830dea13
xen-unstable date: Mon Feb 06 13:17:46 2012 -0800
author Andrew Cooper <andrew.cooper3@citrix.com>
date Thu Feb 23 10:32:48 2012 +0000 (2012-02-23)
parents 4cb8d9c9d46b
children 8435c27b3499
files xen/arch/x86/io_apic.c
line diff
     1.1 --- a/xen/arch/x86/io_apic.c	Thu Feb 23 10:31:48 2012 +0000
     1.2 +++ b/xen/arch/x86/io_apic.c	Thu Feb 23 10:32:48 2012 +0000
     1.3 @@ -2554,6 +2554,23 @@ int ioapic_guest_write(unsigned long phy
     1.4      return 0;
     1.5  }
     1.6  
     1.7 +static const char * delivery_mode_2_str(
     1.8 +    const enum ioapic_irq_destination_types mode)
     1.9 +{
    1.10 +    switch ( mode )
    1.11 +    {
    1.12 +    case dest_Fixed: return "Fixed";
    1.13 +    case dest_LowestPrio: return "LoPri";
    1.14 +    case dest_SMI: return "SMI";
    1.15 +    case dest_NMI: return "NMI";
    1.16 +    case dest_INIT: return "INIT";
    1.17 +    case dest_ExtINT: return "ExINT";
    1.18 +    case dest__reserved_1:
    1.19 +    case dest__reserved_2: return "Resvd";
    1.20 +    default: return "INVAL";
    1.21 +    }
    1.22 +}
    1.23 +
    1.24  void dump_ioapic_irq_info(void)
    1.25  {
    1.26      struct irq_pin_list *entry;
    1.27 @@ -2586,13 +2603,12 @@ void dump_ioapic_irq_info(void)
    1.28              *(((int *)&rte) + 1) = io_apic_read(entry->apic, 0x11 + 2 * pin);
    1.29              spin_unlock_irqrestore(&ioapic_lock, flags);
    1.30  
    1.31 -            printk("vector=%u, delivery_mode=%u, dest_mode=%s, "
    1.32 -                   "delivery_status=%d, polarity=%d, irr=%d, "
    1.33 -                   "trigger=%s, mask=%d, dest_id:%d\n",
    1.34 -                   rte.vector, rte.delivery_mode,
    1.35 -                   rte.dest_mode ? "logical" : "physical",
    1.36 +            printk("vec=%02x delivery=%-5s dest=%c status=%d "
    1.37 +                   "polarity=%d irr=%d trig=%c mask=%d dest_id:%d\n",
    1.38 +                   rte.vector, delivery_mode_2_str(rte.delivery_mode),
    1.39 +                   rte.dest_mode ? 'L' : 'P',
    1.40                     rte.delivery_status, rte.polarity, rte.irr,
    1.41 -                   rte.trigger ? "level" : "edge", rte.mask,
    1.42 +                   rte.trigger ? 'L' : 'E', rte.mask,
    1.43                     rte.dest.logical.logical_dest);
    1.44  
    1.45              if ( entry->next == 0 )