From: Steven Rostedt <rostedt@goodmis.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] trace: add graph output support for wakeup tracer
Date: Tue, 07 Sep 2010 11:07:45 -0400 [thread overview]
Message-ID: <1283872065.5133.116.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <20100907141846.GC5375@nowhere>
On Tue, 2010-09-07 at 16:18 +0200, Frederic Weisbecker wrote:
> On Thu, Aug 05, 2010 at 04:57:27PM +0200, Jiri Olsa wrote:
> > +static void wakeup_graph_return(struct ftrace_graph_ret *trace)
> > +{
> > + struct trace_array *tr = wakeup_trace;
> > + struct trace_array_cpu *data;
> > + unsigned long flags;
> > + long disabled;
> > + int cpu, pc;
> > +
> > + if (likely(!wakeup_task))
> > + return;
> > +
> > + pc = preempt_count();
> > + preempt_disable_notrace();
> > +
> > + cpu = raw_smp_processor_id();
> > + if (cpu != wakeup_current_cpu)
> > + goto out_enable;
> > +
> > + data = tr->data[cpu];
> > + disabled = atomic_inc_return(&data->disabled);
> > + if (unlikely(disabled != 1))
> > + goto out;
> > +
> > + local_irq_save(flags);
> > + __trace_graph_return(tr, trace, flags, pc);
> > + local_irq_restore(flags);
>
>
>
> Do you disable irqs to avoid losing traces? If so there is a race
> window between the recursion barrier in data->disabled and the
> time you disable irqs.
>
> If you don't want to lose anything (except NMIs), you need to
> replace the preempt_disable by the local_irq_save, ie disable
> irqs before the recursion protection.
>
Or is it just to get the flags variable? If so then use
local_save_flags() instead.
-- Steve
prev parent reply other threads:[~2010-09-07 15:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-05 14:57 Jiri Olsa
2010-08-23 10:22 ` Jiri Olsa
2010-09-06 17:57 ` Jiri Olsa
2010-09-06 20:14 ` Steven Rostedt
2010-09-06 17:57 ` Jiri Olsa
2010-09-07 14:18 ` Frederic Weisbecker
2010-09-07 15:07 ` Steven Rostedt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1283872065.5133.116.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®