Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit fd6c7ce5 authored by AKASHI Takahiro's avatar AKASHI Takahiro Committed by Pratik Patel
Browse files

arm64: ftrace: Add dynamic ftrace support



This patch allows "dynamic ftrace" if CONFIG_DYNAMIC_FTRACE is enabled.
Here we can turn on and off tracing dynamically per-function base.

On arm64, this is done by patching single branch instruction to _mcount()
inserted by gcc -pg option. The branch is replaced to NOP initially at
kernel start up, and later on, NOP to branch to ftrace_caller() when
enabled or branch to NOP when disabled.
Please note that ftrace_caller() is a counterpart of _mcount() in case of
'static' ftrace.

More details on architecture specific requirements are described in
Documentation/trace/ftrace-design.txt.

Change-Id: I55b7a75c4e123dc4de9b904ff2689717d7df14ab
Acked-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarAKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Git-commit: bd7d38dbdf356e75eb3b1699158c9b8021fd6784
Git-repo: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git


[pratikp@codeaurora.org: fix compile error in
 arch/arm64/ftrace.c: ftrace_dyn_arch_init by changing the
 function argument from void to void *data]
Signed-off-by: default avatarPratik Patel <pratikp@codeaurora.org>
parent 5fd69ec9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment