lkml.org 
[lkml]   [2010]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 5/5] tracing: Do not record user stack trace from NMI context
From
Date
On Sun, 2010-03-14 at 23:05 +0100, John Kacur wrote:
> On Sat, Mar 13, 2010 at 3:57 AM, Steven Rostedt <rostedt@goodmis.org> wrote:

> > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> > index 484337d..e52683f 100644
> > --- a/kernel/trace/trace.c
> > +++ b/kernel/trace/trace.c
> > @@ -1284,6 +1284,13 @@ ftrace_trace_userstack(struct ring_buffer *buffer, unsigned long flags, int pc)
> > if (!(trace_flags & TRACE_ITER_USERSTACKTRACE))
> > return;
> >
> > + /*
> > + * NMIs can not handle page faults, even with fix ups.
> > + * The save user stack can (and often does) fault.
> > + */
> > + if (unlikely(in_nmi()))
> > + return;
> > +
> > event = trace_buffer_lock_reserve(buffer, TRACE_USER_STACK,
> > sizeof(*entry), flags, pc);
> > if (!event)
> > --
> > 1.7.0
> >
>
> That is some awfully cool detective work. Just one question, if it is
> so easy to trigger, why did you wrap it in "unlikely"?

It was not easy to trigger until I had a case to trigger it. Currently,
the only time that this should trigger is for the lockdep tracing, which
only happens when lockdep is enabled. Most of the time, this should
never trigger.

-- Steve




\
 
 \ /
  Last update: 2010-03-14 23:33    [W:0.046 / U:50.320 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site