lkml.org 
[lkml]   [2009]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/6] ftrace: move function tracer functions out of trace.c

* Andrew Morton <akpm@linux-foundation.org> wrote:

> On Thu, 15 Jan 2009 23:53:43 -0500 Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > static void
> > +function_trace_call_preempt_only(unsigned long ip, unsigned long parent_ip)
> > +{
> > + struct trace_array *tr = func_trace;
> > + struct trace_array_cpu *data;
> > + unsigned long flags;
> > + long disabled;
> > + int cpu, resched;
> > + int pc;
> > +
> > + if (unlikely(!ftrace_function_enabled))
> > + return;
>
> We're optimizing for the tracing-is-enabled case. What's the thinking
> here?

There's two levels here: first the patched in callsites. Those are NOPs in
the usual case - there's no overhead for the default 'function tracing is
built in but not enabled' case.

There's a second level: a /debug/tracing/tracing_enabled lightweight
dynamic flag to flip tracing on/off while the tracer is enabled. _That_
one, if it ever matters to a codepath, is default-enabled.

I.e. the above code sequence is correct.

Thanks,

Ingo


\
 
 \ /
  Last update: 2009-01-16 12:15    [W:0.097 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site