Re: [PATCH v4 11/27] rcu,tracing: Create trace_rcu_{enter,exit}()

From: Peter Zijlstra
Date: Fri Mar 06 2020 - 07:41:00 EST


On Fri, Mar 06, 2020 at 12:50:42PM +0100, Peter Zijlstra wrote:
> > +static inline int trace_rcu_enter(void)
> > +{
> > + int state = !rcu_is_watching();
> > + if (state)
> > + rcu_irq_enter_irqsave();
> > + return state;
> > +}
> > +
> > +static inline void trace_rcu_exit(int state)
> > +{
> > + if (state)
> > + rcu_irq_exit_irqsave();
> > +}
> > +
> > /*
> > * The init_rcu_head_on_stack() and destroy_rcu_head_on_stack() calls
> > * are needed for dynamic initialization and destruction of rcu_head

Also, I just noticed these read like tracepoints, so I'm going to rename
them: rcu_trace_{enter,exit}().