summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/ftrace_32.S
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2019-10-21 17:18:23 +0200
committerBorislav Petkov <bp@suse.de>2019-10-25 10:52:22 +0200
commit0f42c1ad44d437f75b840b572376fd538fbb9643 (patch)
treeb86501365601e861b13c80f35ea0487d3cab0d0b /arch/x86/kernel/ftrace_32.S
parentx86/asm: Replace WEAK uses by SYM_INNER_LABEL_ALIGN (diff)
downloadlinux-0f42c1ad44d437f75b840b572376fd538fbb9643.tar.xz
linux-0f42c1ad44d437f75b840b572376fd538fbb9643.zip
x86/ftrace: Get rid of function_hook
History lesson courtesy of Steve: "When ftrace first was introduced to the kernel, it used gcc's mcount profiling mechanism. The mcount mechanism would add a call to "mcount" at the start of every function but after the stack frame was set up. Later, in gcc 4.6, gcc introduced -mfentry, that would create a call to "__fentry__" instead of "mcount", before the stack frame was set up. In order to handle both cases, ftrace defined a macro "function_hook" that would be either "mcount" or "__fentry__" depending on which one was being used. The Linux kernel no longer supports the "mcount" method, thus there's no reason to keep the "function_hook" define around. Simply use "__fentry__", as there is no ambiguity to the name anymore." Drop it everywhere. Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Jiri Slaby <jslaby@suse.cz> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Peter Zijlstra <peterz@infradead.org> Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: x86@kernel.org Link: http://lkml.kernel.org/r/20191018124800.0a7006bb@gandalf.local.home
Diffstat (limited to 'arch/x86/kernel/ftrace_32.S')
-rw-r--r--arch/x86/kernel/ftrace_32.S8
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/x86/kernel/ftrace_32.S b/arch/x86/kernel/ftrace_32.S
index 8ed1f5d371f0..e8a9f8370112 100644
--- a/arch/x86/kernel/ftrace_32.S
+++ b/arch/x86/kernel/ftrace_32.S
@@ -12,18 +12,16 @@
#include <asm/frame.h>
#include <asm/asm-offsets.h>
-# define function_hook __fentry__
-EXPORT_SYMBOL(__fentry__)
-
#ifdef CONFIG_FRAME_POINTER
# define MCOUNT_FRAME 1 /* using frame = true */
#else
# define MCOUNT_FRAME 0 /* using frame = false */
#endif
-SYM_FUNC_START(function_hook)
+SYM_FUNC_START(__fentry__)
ret
-SYM_FUNC_END(function_hook)
+SYM_FUNC_END(__fentry__)
+EXPORT_SYMBOL(__fentry__)
SYM_CODE_START(ftrace_caller)