* [PATCH for-4.19?] xen/x86: pretty print interrupt CPU affinity masks
@ 2024-05-15 15:29 Roger Pau Monne
2024-05-15 15:30 ` Andrew Cooper
2024-05-16 17:13 ` Andrew Cooper
0 siblings, 2 replies; 6+ messages in thread
From: Roger Pau Monne @ 2024-05-15 15:29 UTC (permalink / raw)
To: xen-devel; +Cc: Roger Pau Monne, Jan Beulich, Andrew Cooper, Oleksii Kurochko
Print the CPU affinity masks as numeric ranges instead of plain hexadecimal
bitfields.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
xen/arch/x86/irq.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 80ba8d9fe912..3b951d81bd6d 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1934,10 +1934,10 @@ void do_IRQ(struct cpu_user_regs *regs)
if ( ~irq < nr_irqs && irq_desc_initialized(desc) )
{
spin_lock(&desc->lock);
- printk("IRQ%d a=%04lx[%04lx,%04lx] v=%02x[%02x] t=%s s=%08x\n",
- ~irq, *cpumask_bits(desc->affinity),
- *cpumask_bits(desc->arch.cpu_mask),
- *cpumask_bits(desc->arch.old_cpu_mask),
+ printk("IRQ%d a={%*pbl}[{%*pbl},{%*pbl}] v=%02x[%02x] t=%s s=%08x\n",
+ ~irq, CPUMASK_PR(desc->affinity),
+ CPUMASK_PR(desc->arch.cpu_mask),
+ CPUMASK_PR(desc->arch.old_cpu_mask),
desc->arch.vector, desc->arch.old_vector,
desc->handler->typename, desc->status);
spin_unlock(&desc->lock);
@@ -2638,7 +2638,7 @@ void fixup_irqs(const cpumask_t *mask, bool verbose)
if ( !set_affinity )
printk("Cannot set affinity for IRQ%u\n", irq);
else if ( break_affinity )
- printk("Broke affinity for IRQ%u, new: %*pb\n",
+ printk("Broke affinity for IRQ%u, new: {%*pbl}\n",
irq, CPUMASK_PR(affinity));
}
--
2.44.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH for-4.19?] xen/x86: pretty print interrupt CPU affinity masks
2024-05-15 15:29 [PATCH for-4.19?] xen/x86: pretty print interrupt CPU affinity masks Roger Pau Monne
@ 2024-05-15 15:30 ` Andrew Cooper
2024-05-16 16:06 ` Oleksii K.
2024-05-16 17:13 ` Andrew Cooper
1 sibling, 1 reply; 6+ messages in thread
From: Andrew Cooper @ 2024-05-15 15:30 UTC (permalink / raw)
To: Roger Pau Monne, xen-devel; +Cc: Jan Beulich, Oleksii Kurochko
On 15/05/2024 4:29 pm, Roger Pau Monne wrote:
> Print the CPU affinity masks as numeric ranges instead of plain hexadecimal
> bitfields.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Ha - I was going to write exactly the same patch, but you beat me to it.
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH for-4.19?] xen/x86: pretty print interrupt CPU affinity masks
2024-05-15 15:30 ` Andrew Cooper
@ 2024-05-16 16:06 ` Oleksii K.
0 siblings, 0 replies; 6+ messages in thread
From: Oleksii K. @ 2024-05-16 16:06 UTC (permalink / raw)
To: Andrew Cooper, Roger Pau Monne, xen-devel; +Cc: Jan Beulich
On Wed, 2024-05-15 at 16:30 +0100, Andrew Cooper wrote:
> On 15/05/2024 4:29 pm, Roger Pau Monne wrote:
> > Print the CPU affinity masks as numeric ranges instead of plain
> > hexadecimal
> > bitfields.
> >
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>
> Ha - I was going to write exactly the same patch, but you beat me to
> it.
>
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Looks good to me for having in Xen 4.19 release.
Release-acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
~ Oleksii
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH for-4.19?] xen/x86: pretty print interrupt CPU affinity masks
2024-05-15 15:29 [PATCH for-4.19?] xen/x86: pretty print interrupt CPU affinity masks Roger Pau Monne
2024-05-15 15:30 ` Andrew Cooper
@ 2024-05-16 17:13 ` Andrew Cooper
2024-05-17 6:58 ` Roger Pau Monné
2024-05-17 7:39 ` Jan Beulich
1 sibling, 2 replies; 6+ messages in thread
From: Andrew Cooper @ 2024-05-16 17:13 UTC (permalink / raw)
To: Roger Pau Monne, xen-devel; +Cc: Jan Beulich, Oleksii Kurochko
On 15/05/2024 4:29 pm, Roger Pau Monne wrote:
> Print the CPU affinity masks as numeric ranges instead of plain hexadecimal
> bitfields.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> xen/arch/x86/irq.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
> index 80ba8d9fe912..3b951d81bd6d 100644
> --- a/xen/arch/x86/irq.c
> +++ b/xen/arch/x86/irq.c
> @@ -1934,10 +1934,10 @@ void do_IRQ(struct cpu_user_regs *regs)
> if ( ~irq < nr_irqs && irq_desc_initialized(desc) )
> {
> spin_lock(&desc->lock);
> - printk("IRQ%d a=%04lx[%04lx,%04lx] v=%02x[%02x] t=%s s=%08x\n",
> - ~irq, *cpumask_bits(desc->affinity),
> - *cpumask_bits(desc->arch.cpu_mask),
> - *cpumask_bits(desc->arch.old_cpu_mask),
> + printk("IRQ%d a={%*pbl}[{%*pbl},{%*pbl}] v=%02x[%02x] t=%s s=%08x\n",
Looking at this more closely, there's still some information obfuscation
going on.
How about "... a={} o={} n={} v=..."
so affinity, old and new masks are all stated explicitly, instead of
having to remember what the square brackets mean, and in particular that
the masks are backwards?
Happy to adjust on commit.
~Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH for-4.19?] xen/x86: pretty print interrupt CPU affinity masks
2024-05-16 17:13 ` Andrew Cooper
@ 2024-05-17 6:58 ` Roger Pau Monné
2024-05-17 7:39 ` Jan Beulich
1 sibling, 0 replies; 6+ messages in thread
From: Roger Pau Monné @ 2024-05-17 6:58 UTC (permalink / raw)
To: Andrew Cooper; +Cc: xen-devel, Jan Beulich, Oleksii Kurochko
On Thu, May 16, 2024 at 06:13:29PM +0100, Andrew Cooper wrote:
> On 15/05/2024 4:29 pm, Roger Pau Monne wrote:
> > Print the CPU affinity masks as numeric ranges instead of plain hexadecimal
> > bitfields.
> >
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > ---
> > xen/arch/x86/irq.c | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
> > index 80ba8d9fe912..3b951d81bd6d 100644
> > --- a/xen/arch/x86/irq.c
> > +++ b/xen/arch/x86/irq.c
> > @@ -1934,10 +1934,10 @@ void do_IRQ(struct cpu_user_regs *regs)
> > if ( ~irq < nr_irqs && irq_desc_initialized(desc) )
> > {
> > spin_lock(&desc->lock);
> > - printk("IRQ%d a=%04lx[%04lx,%04lx] v=%02x[%02x] t=%s s=%08x\n",
> > - ~irq, *cpumask_bits(desc->affinity),
> > - *cpumask_bits(desc->arch.cpu_mask),
> > - *cpumask_bits(desc->arch.old_cpu_mask),
> > + printk("IRQ%d a={%*pbl}[{%*pbl},{%*pbl}] v=%02x[%02x] t=%s s=%08x\n",
>
> Looking at this more closely, there's still some information obfuscation
> going on.
>
> How about "... a={} o={} n={} v=..."
>
> so affinity, old and new masks are all stated explicitly, instead of
> having to remember what the square brackets mean, and in particular that
> the masks are backwards?
>
> Happy to adjust on commit.
Sure, I guess I got used to it and didn't think of adjusting the
format. The only risk is anyone having an automated parser to consume
that information, but I think it's unlikely.
Thanks, Roger.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH for-4.19?] xen/x86: pretty print interrupt CPU affinity masks
2024-05-16 17:13 ` Andrew Cooper
2024-05-17 6:58 ` Roger Pau Monné
@ 2024-05-17 7:39 ` Jan Beulich
1 sibling, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2024-05-17 7:39 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Oleksii Kurochko, Roger Pau Monne, xen-devel
On 16.05.2024 19:13, Andrew Cooper wrote:
> On 15/05/2024 4:29 pm, Roger Pau Monne wrote:
>> Print the CPU affinity masks as numeric ranges instead of plain hexadecimal
>> bitfields.
>>
>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>> ---
>> xen/arch/x86/irq.c | 10 +++++-----
>> 1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
>> index 80ba8d9fe912..3b951d81bd6d 100644
>> --- a/xen/arch/x86/irq.c
>> +++ b/xen/arch/x86/irq.c
>> @@ -1934,10 +1934,10 @@ void do_IRQ(struct cpu_user_regs *regs)
>> if ( ~irq < nr_irqs && irq_desc_initialized(desc) )
>> {
>> spin_lock(&desc->lock);
>> - printk("IRQ%d a=%04lx[%04lx,%04lx] v=%02x[%02x] t=%s s=%08x\n",
>> - ~irq, *cpumask_bits(desc->affinity),
>> - *cpumask_bits(desc->arch.cpu_mask),
>> - *cpumask_bits(desc->arch.old_cpu_mask),
>> + printk("IRQ%d a={%*pbl}[{%*pbl},{%*pbl}] v=%02x[%02x] t=%s s=%08x\n",
>
> Looking at this more closely, there's still some information obfuscation
> going on.
>
> How about "... a={} o={} n={} v=..."
>
> so affinity, old and new masks are all stated explicitly, instead of
> having to remember what the square brackets mean, and in particular that
> the masks are backwards?
Just one question: Why put old ahead of new? Aiui that's what you refer to
with "backwards", yet I don't see what's backwards about it. Old would
possibly matter only when the IRQ was recently moved, whereas new (actually:
Why "new"?) would matter at all times. I'd see "... a={} m={} o={} v=..."
as more appropriate.
Jan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-05-17 7:39 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-15 15:29 [PATCH for-4.19?] xen/x86: pretty print interrupt CPU affinity masks Roger Pau Monne
2024-05-15 15:30 ` Andrew Cooper
2024-05-16 16:06 ` Oleksii K.
2024-05-16 17:13 ` Andrew Cooper
2024-05-17 6:58 ` Roger Pau Monné
2024-05-17 7:39 ` Jan Beulich
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.