Skip to content

Commit

Permalink
ftrace: Mark function tracer test functions noinline/noclone
Browse files Browse the repository at this point in the history
The ftrace function tracer self tests calls some functions to verify
the get traced. This relies on them not being inlined. Previously
this was ensured by putting them into another file, but with LTO
the compiler can inline across files, which makes the tests fail.

Mark these functions as noinline and noclone.

Link: http://lkml.kernel.org/r/20171221233732.31896-1-andi@firstfloor.org

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
  • Loading branch information
Andi Kleen authored and Steven Rostedt (VMware) committed Jan 23, 2018
1 parent 0e4d819 commit dd3dad0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kernel/trace/trace_selftest_dynamic.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include "trace.h"

int DYN_FTRACE_TEST_NAME(void)
noinline __noclone int DYN_FTRACE_TEST_NAME(void)
{
/* used to call mcount */
return 0;
}

int DYN_FTRACE_TEST_NAME2(void)
noinline __noclone int DYN_FTRACE_TEST_NAME2(void)
{
/* used to call mcount */
return 0;
Expand Down

0 comments on commit dd3dad0

Please sign in to comment.