OSDN Git Service

ftrace: Add register_ftrace_direct()
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 8 Nov 2019 18:07:06 +0000 (13:07 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 13 Nov 2019 14:36:41 +0000 (09:36 -0500)
commit763e34e74bb7d5c316015e2e39fcc8520bfd071c
tree0fc9886f242a9c91c3ab0d1234db71a6da2a010a
parent7e16f581a81759bafea04d049134b32d1a881226
ftrace: Add register_ftrace_direct()

Add the start of the functionality to allow other trampolines to use the
ftrace mcount/fentry/nop location. This adds two new functions:

 register_ftrace_direct() and unregister_ftrace_direct()

Both take two parameters: the first is the instruction address of where the
mcount/fentry/nop exists, and the second is the trampoline to have that
location called.

This will handle cases where ftrace is already used on that same location,
and will make it still work, where the registered direct called trampoline
will get called after all the registered ftrace callers are handled.

Currently, it will not allow for IP_MODIFY functions to be called at the
same locations, which include some kprobes and live kernel patching.

At this point, no architecture supports this. This is only the start of
implementing the framework.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
include/linux/ftrace.h
kernel/trace/Kconfig
kernel/trace/ftrace.c