summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2017-11-28 00:34:13 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-02-23 15:59:17 +0300
commit6b6810c2a4129b508649888a98ce925caeac9fdd (patch)
tree0fdf7add70b48e9994319eb82b96ca41f53a855b /scripts
parentd10795e33bce1b2530a5106d3d1e91b1f7a76e6f (diff)
downloadlinux-6b6810c2a4129b508649888a98ce925caeac9fdd.tar.xz
trace: Use -mcount-record for dynamic ftrace
commit 96f60dfa5819a065bfdd2f2ba0df7d9cbce7f4dd upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.build6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 6228a83156ea..9f27891fba86 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -222,6 +222,11 @@ cmd_modversions_c = \
endif
ifdef CONFIG_FTRACE_MCOUNT_RECORD
+# gcc 5 supports generating the mcount tables directly
+ifneq ($(call cc-option,-mrecord-mcount,y),y)
+KBUILD_CFLAGS += -mrecord-mcount
+else
+# else do it all manually
ifdef BUILD_C_RECORDMCOUNT
ifeq ("$(origin RECORDMCOUNT_WARN)", "command line")
RECORDMCOUNT_FLAGS = -w
@@ -264,6 +269,7 @@ endif
ifdef CONFIG_GCOV_KERNEL
objtool_args += --no-unreachable
endif
+endif
# 'OBJECT_FILES_NON_STANDARD := y': skip objtool checking for a directory
# 'OBJECT_FILES_NON_STANDARD_foo.o := 'y': skip objtool checking for a file