diff mbox series

[3/9] x86/IRQ: improve dump_irqs()

Message ID 5CC6DEC50200007800229EA0@prv1-mh.provo.novell.com (mailing list archive)
State Superseded
Headers show
Series x86: IRQ management adjustments | expand

Commit Message

Jan Beulich April 29, 2019, 11:23 a.m. UTC
Don't log a stray trailing comma. Shorten a few fields.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Roger Pau Monné May 3, 2019, 3:43 p.m. UTC | #1
On Mon, Apr 29, 2019 at 05:23:49AM -0600, Jan Beulich wrote:
> Don't log a stray trailing comma. Shorten a few fields.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

> -            for ( i = 0; i < action->nr_guests; i++ )
> +            for ( i = 0; i < action->nr_guests; )
>              {
> -                d = action->guest[i];
> +                d = action->guest[i++];

Per my taste I would leave the increment in the for, but it's just
taste.
Jan Beulich May 6, 2019, 8:06 a.m. UTC | #2
>>> On 03.05.19 at 17:43, <roger.pau@citrix.com> wrote:
> On Mon, Apr 29, 2019 at 05:23:49AM -0600, Jan Beulich wrote:
>> Don't log a stray trailing comma. Shorten a few fields.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks.

>> -            for ( i = 0; i < action->nr_guests; i++ )
>> +            for ( i = 0; i < action->nr_guests; )
>>              {
>> -                d = action->guest[i];
>> +                d = action->guest[i++];
> 
> Per my taste I would leave the increment in the for, but it's just
> taste.

If it was just taste, I'd have left it there, but there is

                printk("d%d:%3d(%c%c%c)%c",
                       d->domain_id, pirq,
                       evtchn_port_is_pending(d, info->evtchn) ? 'P' : '-',
                       evtchn_port_is_masked(d, info->evtchn) ? 'M' : '-',
                       info->masked ? 'M' : '-',
                       i < action->nr_guests ? ',' : '\n');

which depends on the early increment (or else would need adding
" + 1" or " - 1" on one side of the < . In fact this change is the
"don't log a stray trailing comma" part.

Jan
diff mbox series

Patch

--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2318,7 +2318,7 @@  static void dump_irqs(unsigned char key)
 
         spin_lock_irqsave(&desc->lock, flags);
 
-        printk("   IRQ:%4d affinity:%*pb vec:%02x type=%-15s status=%08x ",
+        printk("   IRQ:%4d aff:%*pb vec:%02x %-15s status=%03x ",
                irq, nr_cpu_ids, cpumask_bits(desc->affinity), desc->arch.vector,
                desc->handler->typename, desc->status);
 
@@ -2329,23 +2329,21 @@  static void dump_irqs(unsigned char key)
         {
             action = (irq_guest_action_t *)desc->action;
 
-            printk("in-flight=%d domain-list=", action->in_flight);
+            printk("in-flight=%d%c",
+                   action->in_flight, action->nr_guests ? ' ' : '\n');
 
-            for ( i = 0; i < action->nr_guests; i++ )
+            for ( i = 0; i < action->nr_guests; )
             {
-                d = action->guest[i];
+                d = action->guest[i++];
                 pirq = domain_irq_to_pirq(d, irq);
                 info = pirq_info(d, pirq);
-                printk("%u:%3d(%c%c%c)",
+                printk("d%d:%3d(%c%c%c)%c",
                        d->domain_id, pirq,
                        evtchn_port_is_pending(d, info->evtchn) ? 'P' : '-',
                        evtchn_port_is_masked(d, info->evtchn) ? 'M' : '-',
-                       (info->masked ? 'M' : '-'));
-                if ( i != action->nr_guests )
-                    printk(",");
+                       info->masked ? 'M' : '-',
+                       i < action->nr_guests ? ',' : '\n');
             }
-
-            printk("\n");
         }
         else if ( desc->action )
             printk("%ps()\n", desc->action->handler);