ftrace: Move ARCH_SUPPORTS_FTRACE_SAVE_REGS in Kconfig
Move SAVE_REGS support flag into Kconfig and rename it to CONFIG_DYNAMIC_FTRACE_WITH_REGS. This also introduces CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS which indicates the architecture depending part of ftrace has a code that saves full registers. On the other hand, CONFIG_DYNAMIC_FTRACE_WITH_REGS indicates the code is enabled. Link: http://lkml.kernel.org/r/20120928081516.3560.72534.stgit@ltc138.sdl.hitachi.co.jp Cc: Ingo Molnar <mingo@elte.hu> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
committed by
Steven Rostedt
parent
8741db532e
commit
06aeaaeabf
@@ -39,6 +39,9 @@ config HAVE_DYNAMIC_FTRACE
|
||||
help
|
||||
See Documentation/trace/ftrace-design.txt
|
||||
|
||||
config HAVE_DYNAMIC_FTRACE_WITH_REGS
|
||||
bool
|
||||
|
||||
config HAVE_FTRACE_MCOUNT_RECORD
|
||||
bool
|
||||
help
|
||||
@@ -434,6 +437,11 @@ config DYNAMIC_FTRACE
|
||||
were made. If so, it runs stop_machine (stops all CPUS)
|
||||
and modifies the code to jump over the call to ftrace.
|
||||
|
||||
config DYNAMIC_FTRACE_WITH_REGS
|
||||
def_bool y
|
||||
depends on DYNAMIC_FTRACE
|
||||
depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
|
||||
|
||||
config FUNCTION_PROFILER
|
||||
bool "Kernel function profiler"
|
||||
depends on FUNCTION_TRACER
|
||||
|
||||
@@ -337,7 +337,7 @@ static int __register_ftrace_function(struct ftrace_ops *ops)
|
||||
if ((ops->flags & FL_GLOBAL_CONTROL_MASK) == FL_GLOBAL_CONTROL_MASK)
|
||||
return -EINVAL;
|
||||
|
||||
#ifndef ARCH_SUPPORTS_FTRACE_SAVE_REGS
|
||||
#ifndef CONFIG_DYNAMIC_FTRACE_WITH_REGS
|
||||
/*
|
||||
* If the ftrace_ops specifies SAVE_REGS, then it only can be used
|
||||
* if the arch supports it, or SAVE_REGS_IF_SUPPORTED is also set.
|
||||
@@ -4143,8 +4143,8 @@ __ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip,
|
||||
* Archs are to support both the regs and ftrace_ops at the same time.
|
||||
* If they support ftrace_ops, it is assumed they support regs.
|
||||
* If call backs want to use regs, they must either check for regs
|
||||
* being NULL, or ARCH_SUPPORTS_FTRACE_SAVE_REGS.
|
||||
* Note, ARCH_SUPPORT_SAVE_REGS expects a full regs to be saved.
|
||||
* being NULL, or CONFIG_DYNAMIC_FTRACE_WITH_REGS.
|
||||
* Note, CONFIG_DYNAMIC_FTRACE_WITH_REGS expects a full regs to be saved.
|
||||
* An architecture can pass partial regs with ftrace_ops and still
|
||||
* set the ARCH_SUPPORT_FTARCE_OPS.
|
||||
*/
|
||||
|
||||
@@ -568,7 +568,7 @@ trace_selftest_function_regs(void)
|
||||
int ret;
|
||||
int supported = 0;
|
||||
|
||||
#ifdef ARCH_SUPPORTS_FTRACE_SAVE_REGS
|
||||
#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
|
||||
supported = 1;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user