Re: [PATCH 3/4] tracing: Add stack_tracer_disable/enable() functions

Steven Rostedt
2017-04-06T21:24:02Z

On Thu, 6 Apr 2017 13:21:17 -0700
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:

> > My worry is that we add another caller that doesn't disable interrupts
> > or preemption.
> >
> > I could add a __stack_trace_disable() that skips the disabling of
> > preemption, as the "__" usually denotes the call is "special".
>
> Given that interrupts are disabled at that point, and given also that
> NMI skips stack tracing if growth is required, could we just leave
> out the stack_tracer_disable() and stack_tracer_enable()?

There may be other use cases. Hmm, maybe I'll just have it do a check
to make sure preemption is disabled. Something like:

if (IS_ENABLED(CONFIG_DEBUG_PREEMPT))
WARN_ON_ONCE(!preempt_count());

-- Steve