Re: [PATCH 0/5][RFC] [RFC] function profiler

Ingo Molnar
2009-03-25T09:51:48Z

* Steven Rostedt <rostedt@goodmis.org> wrote:

> The following patches are RFC, and to discuss is this work would
> be useful.
>
> This patch series adds a function profiler hook to the function
> tracer and function graph tracer. That is, it uses the mcount
> calls to track the functions being called. Now with the function
> graph tracer it also keeps track of the times the functions have
> been executing.
>
> Note, this is similar to oprofile, but is not a sampling approach,
> but a true recorder. Of course, by recording every function the
> overhead compared to oprofile is higher. With the use of dynamic
> ftrace, you could just trace certain functions, or just a certain
> module. The flexibility is a bit greater with this profiling.

Also, with the built-in user-defined filter code in the latest
tracing tree this can also be used to only trace a given PID, or a
range of PIDs.

Or we can trace preempt-disabled functions only, via this filter
expression:

echo 'common_preempt_count != 0' > /debug/tracing/events/ftrace/function/filter

Or (future planned) we can profile functions only taking longer than
100 microseconds:

echo 'duration >= 0' > /debug/tracing/events/ftrace/function/filter

There are other possibilities as well.

Ingo