diff mbox series

[v3,12/15] x86/IRQ: add explicit tracing-enabled check to trace_irq_mask()

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

Commit Message

Jan Beulich May 17, 2019, 10:51 a.m. UTC
The setup for calling trace_var() (which itself checks tb_init_done) is
non-negligible, and hence a separate outer-most check is warranted.

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

Comments

Roger Pau Monne May 20, 2019, 11:46 a.m. UTC | #1
On Fri, May 17, 2019 at 04:51:50AM -0600, Jan Beulich wrote:
> The setup for calling trace_var() (which itself checks tb_init_done) is
> non-negligible, and hence a separate outer-most check is warranted.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

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

I think a macro or helper would be helpful: ie: trace_enabled or some
such. Checking tb_init_done is as obvious as it could be IMO.

Roger.
Andrew Cooper July 3, 2019, 6:41 p.m. UTC | #2
On 17/05/2019 11:51, Jan Beulich wrote:
> --- a/xen/arch/x86/irq.c
> +++ b/xen/arch/x86/irq.c
> @@ -137,6 +137,13 @@ static void trace_irq_mask(uint32_t even
>      trace_var(event, 1, sizeof(d), &d);
>  }
>  
> +static inline void trace_irq_mask(uint32_t event, int irq, int vector,

No inline.  Otherwise, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

> +                                  const cpumask_t *mask)
> +{
> +    if ( unlikely(tb_init_done) )
> +        _trace_irq_mask(event, irq, vector, mask);
> +}
> +
>  static int __init _bind_irq_vector(struct irq_desc *desc, int vector,
>                                     const cpumask_t *cpu_mask)
>  {
>
>
>
>
Jan Beulich July 4, 2019, 10:01 a.m. UTC | #3
On 03.07.2019 20:41, Andrew Cooper wrote:
> On 17/05/2019 11:51, Jan Beulich wrote:
>> --- a/xen/arch/x86/irq.c
>> +++ b/xen/arch/x86/irq.c
>> @@ -137,6 +137,13 @@ static void trace_irq_mask(uint32_t even
>>       trace_var(event, 1, sizeof(d), &d);
>>   }
>>   
>> +static inline void trace_irq_mask(uint32_t event, int irq, int vector,
> 
> No inline.

Well, I think in cases like this one we really want it, but anyway,
I'll drop it just to make progress here.

>  Otherwise, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks, Jan
diff mbox series

Patch

--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -121,8 +121,8 @@  static void release_old_vec(struct irq_d
     }
 }
 
-static void trace_irq_mask(uint32_t event, int irq, int vector,
-                           const cpumask_t *mask)
+static void _trace_irq_mask(uint32_t event, int irq, int vector,
+                            const cpumask_t *mask)
 {
     struct {
         unsigned int irq:16, vec:16;
@@ -137,6 +137,13 @@  static void trace_irq_mask(uint32_t even
     trace_var(event, 1, sizeof(d), &d);
 }
 
+static inline void trace_irq_mask(uint32_t event, int irq, int vector,
+                                  const cpumask_t *mask)
+{
+    if ( unlikely(tb_init_done) )
+        _trace_irq_mask(event, irq, vector, mask);
+}
+
 static int __init _bind_irq_vector(struct irq_desc *desc, int vector,
                                    const cpumask_t *cpu_mask)
 {