lkml.org 
[lkml]   [2020]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] tracing/perf: Move rcu_irq_enter/exit_irqson() to perf trace point hook
----- On Feb 12, 2020, at 3:02 AM, Peter Zijlstra peterz@infradead.org wrote:

> On Tue, Feb 11, 2020 at 12:35:21PM -0500, Mathieu Desnoyers wrote:
>
>> Minor nits:
>>
>> Why not make these an enum ?
>>
>> > +
>> > +#define trace_rcu_enter() \
>> > +({ \
>> > + unsigned long state = 0; \
>> > + if (!rcu_is_watching()) { \
>> > + if (in_nmi()) { \
>> > + state = __TR_NMI; \
>> > + rcu_nmi_enter(); \
>> > + } else { \
>> > + state = __TR_IRQ; \
>> > + rcu_irq_enter_irqson(); \
>> > + } \
>> > + } \
>> > + state; \
>> > +})
>> > +
>> > +#define trace_rcu_exit(state) \
>> > +do { \
>> > + switch (state) { \
>> > + case __TR_IRQ: \
>> > + rcu_irq_exit_irqson(); \
>> > + break; \
>> > + case __IRQ_NMI: \
>> > + rcu_nmi_exit(); \
>> > + break; \
>> > + default: \
>> > + break; \
>> > + } \
>> > +} while (0)
>>
>> And convert these into static inline functions ?
>
> Probably the same reason the rest of the file is macros; header hell.
>
> Now, I could probably make these inlines, but then I'd have to add more
> RCU function declariations to this file (which is outside of
> rcupdate.h). Do we want to do that?

Probably not :) I was just wondering why.

Thanks,

Mathieu

>
> The reason these were in this file is because I want to keep the comment
> and implementation near to nmi_enter/exit.

--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

\
 
 \ /
  Last update: 2020-02-12 16:14    [W:0.050 / U:1.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site