kmod/core: ftrace function_graph tracer compatibility

Steven Rostedt recommended to return "regs->ip + MCOUNT_INSN_SIZE",
which is what the function_graph tracer expects.  This fixes
function_graph tracing for a patched function.

This change also means that the function tracer will only show the
patched function once (corresponding to a trace of the original
function) rather than twice.  This is probably more in line with what a
user would expect.
This commit is contained in:
Josh Poimboeuf 2014-07-01 10:05:23 -05:00
parent 79bd9f03ee
commit d2201980e6
1 changed files with 1 additions and 1 deletions

View File

@ -413,7 +413,7 @@ kpatch_ftrace_handler(unsigned long ip, unsigned long parent_ip,
}
done:
if (func)
regs->ip = func->new_addr;
regs->ip = func->new_addr + MCOUNT_INSN_SIZE;
preempt_enable_notrace();
}