summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorNaveen N Rao <naveen@kernel.org>2024-10-30 10:08:48 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2024-10-31 03:00:55 +0300
commita52f6043a2238d656ddd23ce0499cf4f12645faa (patch)
treeebe1db9c7dd95c9e11a84bfc6b17961cc8281cdf /samples
parente717754f0bb5c5347aac82232691340955735ce1 (diff)
downloadlinux-a52f6043a2238d656ddd23ce0499cf4f12645faa.tar.xz
powerpc/ftrace: Add support for DYNAMIC_FTRACE_WITH_DIRECT_CALLS
Add support for DYNAMIC_FTRACE_WITH_DIRECT_CALLS similar to the arm64 implementation. ftrace direct calls allow custom trampolines to be called into directly from function ftrace call sites, bypassing the ftrace trampoline completely. This functionality is currently utilized by BPF trampolines to hook into kernel function entries. Since we have limited relative branch range, we support ftrace direct calls through support for DYNAMIC_FTRACE_WITH_CALL_OPS. In this approach, ftrace trampoline is not entirely bypassed. Rather, it is re-purposed into a stub that reads direct_call field from the associated ftrace_ops structure and branches into that, if it is not NULL. For this, it is sufficient if we can ensure that the ftrace trampoline is reachable from all traceable functions. When multiple ftrace_ops are associated with a call site, we utilize a call back to set pt_regs->orig_gpr3 that can then be tested on the return path from the ftrace trampoline to branch into the direct caller. Signed-off-by: Naveen N Rao <naveen@kernel.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://patch.msgid.link/20241030070850.1361304-16-hbathini@linux.ibm.com
Diffstat (limited to 'samples')
0 files changed, 0 insertions, 0 deletions