The Linux kernel’s ftrace mechanism makes it possible to dynamically attach hooks to kernel functions, and can be used for a variety of purposes including tracing, debugging, and live-patching.
The low-level details of ftrace differ by architecture, and recently the arm64’s ftrace implementation has evolved substantially with the implementation of DYNAMIC_FTRACE_WITH_ARGS and DYNAMIC_FTRACE_WITH_CALL_OPS, which enable richer, lower overhead tracing with relatively simple and
maintainable architecture code.
This walk will cover the low-level details of arm64’s ftrace implementation, how it works, and why certain design choices were made.
Mark Rutland