diff options
| author | Andi Kleen <ak@linux.intel.com> | 2017-11-27 16:34:13 -0500 |
|---|---|---|
| committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2018-05-28 12:49:51 -0400 |
| commit | 96f60dfa5819a065bfdd2f2ba0df7d9cbce7f4dd (patch) | |
| tree | 98102816257e20f2be705a016b7049d16b159636 /scripts | |
| parent | 2824f5033248600673e3e126a4d135363cbfd9ac (diff) | |
trace: Use -mcount-record for dynamic ftrace
gcc 5 supports a new -mcount-record option to generate ftrace
tables directly. This avoids the need to run record_mcount
manually.
Use this option when available.
So far doesn't use -mcount-nop, which also exists now.
This is needed to make ftrace work with LTO because the
normal record-mcount script doesn't run over the link
time output.
It should also improve build times slightly in the general
case.
Link: http://lkml.kernel.org/r/20171127213423.27218-12-andi@firstfloor.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/Makefile.build | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 8bdb1dc4072c..dcbca18011bb 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
| @@ -207,6 +207,11 @@ cmd_modversions_c = \ | |||
| 207 | endif | 207 | endif |
| 208 | 208 | ||
| 209 | ifdef CONFIG_FTRACE_MCOUNT_RECORD | 209 | ifdef CONFIG_FTRACE_MCOUNT_RECORD |
| 210 | # gcc 5 supports generating the mcount tables directly | ||
| 211 | ifneq ($(call cc-option,-mrecord-mcount,y),y) | ||
| 212 | KBUILD_CFLAGS += -mrecord-mcount | ||
| 213 | else | ||
| 214 | # else do it all manually | ||
| 210 | ifdef BUILD_C_RECORDMCOUNT | 215 | ifdef BUILD_C_RECORDMCOUNT |
| 211 | ifeq ("$(origin RECORDMCOUNT_WARN)", "command line") | 216 | ifeq ("$(origin RECORDMCOUNT_WARN)", "command line") |
| 212 | RECORDMCOUNT_FLAGS = -w | 217 | RECORDMCOUNT_FLAGS = -w |
| @@ -259,6 +264,7 @@ ifneq ($(RETPOLINE_CFLAGS),) | |||
| 259 | objtool_args += --retpoline | 264 | objtool_args += --retpoline |
| 260 | endif | 265 | endif |
| 261 | endif | 266 | endif |
| 267 | endif | ||
| 262 | 268 | ||
| 263 | 269 | ||
| 264 | ifdef CONFIG_MODVERSIONS | 270 | ifdef CONFIG_MODVERSIONS |
