ftrace/x86: Move MCOUNT_SAVE_FRAME out of header file
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Mon, 24 Nov 2014 16:30:58 +0000 (11:30 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 1 Dec 2014 19:07:16 +0000 (14:07 -0500)
Linus pointed out that MCOUNT_SAVE_FRAME is used in only a single file
and that there's no reason that it should be in a header file.
Move the macro to the code that uses it.

Link: http://lkml.kernel.org/r/CA+55aFwF+qCGSKdGaEgW4p6N65GZ5_XTV=1NbtWDvxnd5yYLiw@mail.gmail.com
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1411262304010.3961@nanos
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
arch/x86/include/asm/ftrace.h
arch/x86/kernel/mcount_64.S

index e1f7fec..f45acad 100644 (file)
@@ -1,39 +1,6 @@
 #ifndef _ASM_X86_FTRACE_H
 #define _ASM_X86_FTRACE_H
 
-#ifdef __ASSEMBLY__
-
-       /* skip is set if the stack was already partially adjusted */
-       .macro MCOUNT_SAVE_FRAME skip=0
-        /*
-         * We add enough stack to save all regs.
-         */
-       subq $(SS+8-\skip), %rsp
-       movq %rax, RAX(%rsp)
-       movq %rcx, RCX(%rsp)
-       movq %rdx, RDX(%rsp)
-       movq %rsi, RSI(%rsp)
-       movq %rdi, RDI(%rsp)
-       movq %r8, R8(%rsp)
-       movq %r9, R9(%rsp)
-        /* Move RIP to its proper location */
-       movq SS+8(%rsp), %rdx
-       movq %rdx, RIP(%rsp)
-       .endm
-
-       .macro MCOUNT_RESTORE_FRAME skip=0
-       movq R9(%rsp), %r9
-       movq R8(%rsp), %r8
-       movq RDI(%rsp), %rdi
-       movq RSI(%rsp), %rsi
-       movq RDX(%rsp), %rdx
-       movq RCX(%rsp), %rcx
-       movq RAX(%rsp), %rax
-       addq $(SS+8-\skip), %rsp
-       .endm
-
-#endif
-
 #ifdef CONFIG_FUNCTION_TRACER
 #ifdef CC_USING_FENTRY
 # define MCOUNT_ADDR           ((long)(__fentry__))
index 24842c7..94fe467 100644 (file)
 # define function_hook mcount
 #endif
 
+/* skip is set if the stack was already partially adjusted */
+.macro MCOUNT_SAVE_FRAME skip=0
+        /*
+         * We add enough stack to save all regs.
+         */
+       subq $(SS+8-\skip), %rsp
+       movq %rax, RAX(%rsp)
+       movq %rcx, RCX(%rsp)
+       movq %rdx, RDX(%rsp)
+       movq %rsi, RSI(%rsp)
+       movq %rdi, RDI(%rsp)
+       movq %r8, R8(%rsp)
+       movq %r9, R9(%rsp)
+        /* Move RIP to its proper location */
+       movq SS+8(%rsp), %rdx
+       movq %rdx, RIP(%rsp)
+       .endm
+
+.macro MCOUNT_RESTORE_FRAME skip=0
+       movq R9(%rsp), %r9
+       movq R8(%rsp), %r8
+       movq RDI(%rsp), %rdi
+       movq RSI(%rsp), %rsi
+       movq RDX(%rsp), %rdx
+       movq RCX(%rsp), %rcx
+       movq RAX(%rsp), %rax
+       addq $(SS+8-\skip), %rsp
+       .endm
+
 /* skip is set if stack has been adjusted */
 .macro ftrace_caller_setup trace_label skip=0
        MCOUNT_SAVE_FRAME \skip