]> Pileus Git - ~andy/linux/commit
ftrace: Fix function probe to only enable needed functions
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Tue, 12 Mar 2013 14:09:42 +0000 (10:09 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Fri, 15 Mar 2013 04:36:00 +0000 (00:36 -0400)
commite1df4cb682ab2c3c2981c8efa4aec044e61f4e06
tree2ca14d5b02052f2fec06a567fdb048aa7943a4f4
parent8380d24860e9d1659ab22896b86d7fe591c424fa
ftrace: Fix function probe to only enable needed functions

Currently the function probe enables all functions and runs a "hash"
against every function call to see if it should call a probe. This
is extremely wasteful.

Note, a probe is something like:

  echo schedule:traceoff > /debug/tracing/set_ftrace_filter

When schedule is called, the probe will disable tracing. But currently,
it has a call back for *all* functions, and checks to see if the
called function is the probe that is needed.

The probe function has been created before ftrace was rewritten to
allow for more than one "op" to be registered by the function tracer.
When probes were created, it couldn't limit the functions without also
limiting normal function calls. But now we can, it's about time
to update the probe code.

Todo, have separate ops for different entries. That is, assign
a ftrace_ops per probe, instead of one op for all probes. But
as there's not many probes assigned, this may not be that urgent.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ftrace.c