• Steven Rostedt (Red Hat)'s avatar
    ftrace: Fix function probe to only enable needed functions · e1df4cb6
    Steven Rostedt (Red Hat) authored
    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: default avatarSteven Rostedt <rostedt@goodmis.org>
    e1df4cb6
ftrace.c 108 KB