From d2201980e6580bda8089d57f173902faf253c85a Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Tue, 1 Jul 2014 10:05:23 -0500 Subject: [PATCH] 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. --- kmod/core/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmod/core/core.c b/kmod/core/core.c index 7f2a445..5881429 100644 --- a/kmod/core/core.c +++ b/kmod/core/core.c @@ -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(); }