ftrace/x86: Add register_ftrace_direct() for custom trampolines
Enable x86 to allow for register_ftrace_direct(), where a custom trampoline may be called directly from an ftrace mcount/fentry location. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
@@ -1042,6 +1042,18 @@ void prepare_ftrace_return(unsigned long self_addr, unsigned long *parent,
|
||||
if (unlikely(atomic_read(¤t->tracing_graph_pause)))
|
||||
return;
|
||||
|
||||
/*
|
||||
* If the return location is actually pointing directly to
|
||||
* the start of a direct trampoline (if we trace the trampoline
|
||||
* it will still be offset by MCOUNT_INSN_SIZE), then the
|
||||
* return address is actually off by one word, and we
|
||||
* need to adjust for that.
|
||||
*/
|
||||
if (ftrace_find_direct_func(self_addr + MCOUNT_INSN_SIZE)) {
|
||||
self_addr = *parent;
|
||||
parent++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Protect against fault, even if it shouldn't
|
||||
* happen. This tool is too much intrusive to
|
||||
|
||||
Reference in New Issue
Block a user