diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2018-08-06 15:17:44 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-02-23 13:59:17 +0100 |
commit | 3f50dfb06e9814be82e099cce25d7ad9aa4e0256 (patch) | |
tree | 9cf7abec35716376bfd02d59b7513670439b08ca /scripts | |
parent | 90220daf10a3b3b97d1a6c4623a8ac23ce0cf675 (diff) | |
download | linux-stable-3f50dfb06e9814be82e099cce25d7ad9aa4e0256.tar.gz linux-stable-3f50dfb06e9814be82e099cce25d7ad9aa4e0256.tar.bz2 linux-stable-3f50dfb06e9814be82e099cce25d7ad9aa4e0256.zip |
tracing: Avoid calling cc-option -mrecord-mcount for every Makefile
commit 07d0408120216b60625c9a5b8012d1c3a907984d upstream.
Currently if CONFIG_FTRACE_MCOUNT_RECORD is enabled -mrecord-mcount
compiler flag support is tested for every Makefile.
Top 4 cc-option usages:
511 -mrecord-mcount
11 -fno-stack-protector
9 -Wno-override-init
2 -fsched-pressure
To address that move cc-option from scripts/Makefile.build to top Makefile
and export CC_USING_RECORD_MCOUNT to be used in original place.
While doing that also add -mrecord-mcount to CC_FLAGS_FTRACE (if gcc
actually supports it).
Link: http://lkml.kernel.org/r/patch-2.thread-aa7b8d.git-de935bace15a.your-ad-here.call-01533557518-ext-9465@work.hours
Acked-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.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.build | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index e0b18a286901..f8ee4e33a085 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -222,11 +222,8 @@ 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 +ifndef CC_USING_RECORD_MCOUNT +# compiler will not generate __mcount_loc use recordmcount or recordmcount.pl ifdef BUILD_C_RECORDMCOUNT ifeq ("$(origin RECORDMCOUNT_WARN)", "command line") RECORDMCOUNT_FLAGS = -w @@ -255,7 +252,7 @@ cmd_record_mcount = \ "$(CC_FLAGS_FTRACE)" ]; then \ $(sub_cmd_record_mcount) \ fi; -endif # -record-mcount +endif # CC_USING_RECORD_MCOUNT endif ifdef CONFIG_STACK_VALIDATION |