Re: [PATCH 7/9] ftrace, perf: Add support to use functiontracepoint in perf

From: Peter Zijlstra
Date: Mon Nov 28 2011 - 15:09:08 EST


On Mon, 2011-11-28 at 14:58 -0500, Steven Rostedt wrote:
> > +static int perf_ftrace_function_register(struct perf_event *event)
> > +{
> > + struct ftrace_ops *ops = &event->ftrace_ops;
> > +
> > + ops->flags |= FTRACE_OPS_FL_CONTROL;
> > + atomic_set(&ops->disabled, 1);
> > + ops->func = perf_ftrace_function_call;
> > + return register_ftrace_function(ops);
>
> When is ADD called? Because as soon as you register this function, even
> though you have it "disabled" the system takes about a 13% impact on
> performance just by calling this.

Typically at context switch time.

> > +static void perf_ftrace_function_enable(struct perf_event *event)
> > +{
> > + struct ftrace_ops *ops = &event->ftrace_ops;
> > + enable_ftrace_function(ops);
>
> Is it really an issue that we shouldn't call the full blown register
> instead? I'm not really understanding why this is a problem. Note, one
> of the improvements to ftrace in the near future is to enable ftrace
> without stop_machine.

Yeah, but still not something you want to do during context switches,
right?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/