Skip to content

Commit

Permalink
ftrace: Remove check for HAVE_FUNCTION_TRACE_MCOUNT_TEST
Browse files Browse the repository at this point in the history
function_trace_stop is no longer used to disable function tracing.
This means that archs are no longer limited if it does not support
checking this variable in the mcount trampoline.

No need to use the list_func for archs that do not support this
obsolete method.

Acked-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt (Red Hat) committed Jul 18, 2014
1 parent 1d48d59 commit 7544256
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
26 changes: 0 additions & 26 deletions Documentation/trace/ftrace-design.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,30 +102,6 @@ extern void mcount(void);
EXPORT_SYMBOL(mcount);


HAVE_FUNCTION_TRACE_MCOUNT_TEST
-------------------------------

This is an optional optimization for the normal case when tracing is turned off
in the system. If you do not enable this Kconfig option, the common ftrace
code will take care of doing the checking for you.

To support this feature, you only need to check the function_trace_stop
variable in the mcount function. If it is non-zero, there is no tracing to be
done at all, so you can return.

This additional pseudo code would simply be:
void mcount(void)
{
/* save any bare state needed in order to do initial checking */

+ if (function_trace_stop)
+ return;

extern void (*ftrace_trace_function)(unsigned long, unsigned long);
if (ftrace_trace_function != ftrace_stub)
...


HAVE_FUNCTION_GRAPH_TRACER
--------------------------

Expand Down Expand Up @@ -328,8 +304,6 @@ void mcount(void)

void ftrace_caller(void)
{
/* implement HAVE_FUNCTION_TRACE_MCOUNT_TEST if you desire */

/* save all state needed by the ABI (see paragraph above) */

unsigned long frompc = ...;
Expand Down
3 changes: 1 addition & 2 deletions include/linux/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
* features, then it must call an indirect function that
* does. Or at least does enough to prevent any unwelcomed side effects.
*/
#if !defined(CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST) || \
!ARCH_SUPPORTS_FTRACE_OPS
#if !ARCH_SUPPORTS_FTRACE_OPS
# define FTRACE_FORCE_LIST_FUNC 1
#else
# define FTRACE_FORCE_LIST_FUNC 0
Expand Down

0 comments on commit 7544256

Please sign in to comment.