ftrace/x86: Have save_mcount_regs macro also save stack frames if needed
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Mon, 24 Nov 2014 23:08:48 +0000 (18:08 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 1 Dec 2014 19:08:27 +0000 (14:08 -0500)
commit0687c36e456ca81feff5f3415e53c1cb8d8efd56
tree347410628424a2c146e00932b6f8d0a3bbbcb823
parent85f6f0290c4d4667a5afb06e66815bcf5ce2c4f7
ftrace/x86: Have save_mcount_regs macro also save stack frames if needed

The save_mcount_regs macro saves and restores the required mcount regs that
need to be saved before calling C code. It is done for all the function hook
utilities (static tracing, dynamic tracing, regs, function graph).

When frame pointers are enabled, the ftrace trampolines need to set up
frames and pointers such that a back trace (dump stack) can continue passed
them. Currently, a separate macro is used (create_frame) to do this, but
it's only done for the ftrace_caller and ftrace_reg_caller functions. It
is not done for the static tracer or function graph tracing.

Instead of having a separate macro doing the recording of the frames,
have the save_mcount_regs perform this task. This also has all tracers
saving the frame pointers when needed.

Link: http://lkml.kernel.org/r/CA+55aFwF+qCGSKdGaEgW4p6N65GZ5_XTV=1NbtWDvxnd5yYLiw@mail.gmail.com
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1411262304010.3961@nanos
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
arch/x86/kernel/mcount_64.S