trace: Use -mcount-record for dynamic ftrace
authorAndi Kleen <ak@linux.intel.com>
Mon, 27 Nov 2017 21:34:13 +0000 (13:34 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Feb 2021 13:00:33 +0000 (14:00 +0100)
commit0788a22d85fea3b23b0a979f35d0a0a1a734ecc3
treeb4e74b57c0cb652640fe394a11bd7368919471a7
parent0d38200da5d9c26508fb5435e36ccd1345825ef3
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>
scripts/Makefile.build