[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210222121032.166118470@linuxfoundation.org>
Date: Mon, 22 Feb 2021 13:36:08 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>,
"Steven Rostedt (VMware)" <rostedt@...dmis.org>
Subject: [PATCH 4.14 42/57] trace: Use -mcount-record for dynamic ftrace
From: Andi Kleen <ak@...ux.intel.com>
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@...ux.intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
scripts/Makefile.build | 6 ++++++
1 file changed, 6 insertions(+)
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -224,6 +224,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
@@ -274,6 +279,7 @@ endif
ifdef CONFIG_RETPOLINE
objtool_args += --retpoline
endif
+endif
ifdef CONFIG_MODVERSIONS
Powered by blists - more mailing lists