riscv/ftrace: Add dynamic function graph tracer support
authorAlan Kao <alankao@andestech.com>
Tue, 13 Feb 2018 05:13:18 +0000 (13:13 +0800)
committerPalmer Dabbelt <palmer@sifive.com>
Tue, 3 Apr 2018 02:59:12 +0000 (19:59 -0700)
commitbc1a4c3a842556852bb02039887d73899d513532
tree122084b028e4384e9acfd6fa0ebc73a435c5715c
parentc15ac4fd60d5ffdb151bb2c7805f377fd7f90363
riscv/ftrace: Add dynamic function graph tracer support

Once the function_graph tracer is enabled, a filtered function has the
following call sequence:

* ftracer_caller         ==> on/off by ftrace_make_call/ftrace_make_nop
* ftrace_graph_caller
* ftrace_graph_call      ==> on/off by ftrace_en/disable_ftrace_graph_caller
* prepare_ftrace_return

Considering the following DYNAMIC_FTRACE_WITH_REGS feature, it would be
more extendable to have a ftrace_graph_caller function, instead of
calling prepare_ftrace_return directly in ftrace_caller.

Cc: Greentime Hu <greentime@andestech.com>
Signed-off-by: Alan Kao <alankao@andestech.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/kernel/ftrace.c
arch/riscv/kernel/mcount-dyn.S