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

From: Ingo Molnar
Date: Wed Mar 25 2009 - 05:51:48 EST



* Steven Rostedt <rostedt@xxxxxxxxxxx> 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
--
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/