arm64: ftrace: Add dynamic ftrace support
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Wed, 30 Apr 2014 09:54:34 +0000 (18:54 +0900)
committerMark Brown <broonie@linaro.org>
Fri, 30 May 2014 17:15:43 +0000 (18:15 +0100)
commit95d7e5533398803e3ced340771cb3461c9443407
treef7cc63729e3ca06361ad9d3bc7ceb032a7e0b5fd
parentfc0c93936ae80bdffac7499a820d7e5105ef44d5
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.

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
arch/arm64/Kconfig
arch/arm64/include/asm/ftrace.h
arch/arm64/kernel/entry-ftrace.S
arch/arm64/kernel/ftrace.c