]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ftrace: store mcount address in rec->ip
authorAbhishek Sagar <sagar.abhishek@gmail.com>
Sat, 21 Jun 2008 18:17:27 +0000 (23:47 +0530)
committerIngo Molnar <mingo@elte.hu>
Mon, 23 Jun 2008 20:10:56 +0000 (22:10 +0200)
Record the address of the mcount call-site. Currently all archs except sparc64
record the address of the instruction following the mcount call-site. Some
general cleanups are entailed. Storing mcount addresses in rec->ip enables
looking them up in the kprobe hash table later on to check if they're kprobe'd.

Signed-off-by: Abhishek Sagar <sagar.abhishek@gmail.com>
Cc: davem@davemloft.net
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
19 files changed:
arch/arm/kernel/armksyms.c
arch/arm/kernel/entry-common.S
arch/arm/kernel/ftrace.c
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/entry_64.S
arch/powerpc/kernel/ftrace.c
arch/sparc64/kernel/ftrace.c
arch/sparc64/kernel/sparc64_ksyms.c
arch/x86/kernel/entry_32.S
arch/x86/kernel/entry_64.S
arch/x86/kernel/ftrace.c
arch/x86/kernel/i386_ksyms_32.c
arch/x86/kernel/x8664_ksyms_64.c
include/asm-arm/ftrace.h [new file with mode: 0644]
include/asm-powerpc/ftrace.h
include/asm-sparc64/ftrace.h [new file with mode: 0644]
include/asm-x86/ftrace.h [new file with mode: 0644]
include/linux/ftrace.h
kernel/trace/ftrace.c

index 3b132215cbf83105998a3aedb05a0e1744be69d0..cc7b246e9652033d9593006f2821f99aad102fe3 100644 (file)
@@ -18,6 +18,7 @@
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
+#include <asm/ftrace.h>
 
 /*
  * libgcc functions - functions that are used internally by the
@@ -48,11 +49,6 @@ extern void __aeabi_ulcmp(void);
 extern void fpundefinstr(void);
 extern void fp_enter(void);
 
-#ifdef CONFIG_FTRACE
-extern void mcount(void);
-EXPORT_SYMBOL(mcount);
-#endif
-
 /*
  * This has a special calling convention; it doesn't
  * modify any of the usual registers, except for LR.
@@ -186,3 +182,7 @@ EXPORT_SYMBOL(_find_next_bit_be);
 #endif
 
 EXPORT_SYMBOL(copy_page);
+
+#ifdef CONFIG_FTRACE
+EXPORT_SYMBOL(mcount);
+#endif
index 8f79a4789ed48d0a513f16f107eca73726b26e59..84694e88b4289d07d2b952f69a1ff644ca010fb2 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <asm/unistd.h>
+#include <asm/ftrace.h>
 #include <asm/arch/entry-macro.S>
 
 #include "entry-header.S"
@@ -104,6 +105,7 @@ ENTRY(ret_from_fork)
 ENTRY(mcount)
        stmdb sp!, {r0-r3, lr}
        mov r0, lr
+       sub r0, r0, #MCOUNT_INSN_SIZE
 
        .globl mcount_call
 mcount_call:
@@ -114,6 +116,7 @@ ENTRY(ftrace_caller)
        stmdb sp!, {r0-r3, lr}
        ldr r1, [fp, #-4]
        mov r0, lr
+       sub r0, r0, #MCOUNT_INSN_SIZE
 
        .globl ftrace_call
 ftrace_call:
@@ -134,6 +137,7 @@ ENTRY(mcount)
 trace:
        ldr r1, [fp, #-4]
        mov r0, lr
+       sub r0, r0, #MCOUNT_INSN_SIZE
        mov lr, pc
        mov pc, r2
        ldmia sp!, {r0-r3, pc}
index 22f3d6e309f9f9ca1de820703c426601f83fee7d..76d50e6091bc5694d19a6d9fab0b59284cd311fd 100644 (file)
  */
 
 #include <linux/ftrace.h>
+
 #include <asm/cacheflush.h>
+#include <asm/ftrace.h>
 
-#define INSN_SIZE      4
 #define PC_OFFSET      8
 #define BL_OPCODE      0xeb000000
 #define BL_OFFSET_MASK 0x00ffffff
@@ -32,10 +33,10 @@ unsigned char *ftrace_call_replace(unsigned long pc, unsigned long addr)
 {
        long offset;
 
-       offset = (long)addr - (long)(pc - INSN_SIZE + PC_OFFSET);
+       offset = (long)addr - (long)(pc + PC_OFFSET);
        if (unlikely(offset < -33554432 || offset > 33554428)) {
                /* Can't generate branches that far (from ARM ARM). Ftrace
-                * doesn't generate branches outside of core kernel text.
+                * doesn't generate branches outside of kernel text.
                 */
                WARN_ON_ONCE(1);
                return NULL;
@@ -52,7 +53,6 @@ int ftrace_modify_code(unsigned long pc, unsigned char *old_code,
 
        old = *(unsigned long *)old_code;
        new = *(unsigned long *)new_code;
-       pc -= INSN_SIZE;
 
        __asm__ __volatile__ (
                "1:  ldr    %1, [%2]  \n"
@@ -77,7 +77,7 @@ int ftrace_modify_code(unsigned long pc, unsigned char *old_code,
                : "memory");
 
        if (!err && (replaced == old))
-               flush_icache_range(pc, pc + INSN_SIZE);
+               flush_icache_range(pc, pc + MCOUNT_INSN_SIZE);
 
        return err;
 }
@@ -89,8 +89,7 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
        unsigned char *new;
 
        pc = (unsigned long)&ftrace_call;
-       pc += INSN_SIZE;
-       memcpy(&old, &ftrace_call, INSN_SIZE);
+       memcpy(&old, &ftrace_call, MCOUNT_INSN_SIZE);
        new = ftrace_call_replace(pc, (unsigned long)func);
        ret = ftrace_modify_code(pc, (unsigned char *)&old, new);
        return ret;
@@ -103,8 +102,7 @@ int ftrace_mcount_set(unsigned long *data)
        unsigned char *new;
 
        pc = (unsigned long)&mcount_call;
-       pc += INSN_SIZE;
-       memcpy(&old, &mcount_call, INSN_SIZE);
+       memcpy(&old, &mcount_call, MCOUNT_INSN_SIZE);
        new = ftrace_call_replace(pc, *addr);
        *addr = ftrace_modify_code(pc, (unsigned char *)&old, new);
        return 0;
index 3b1dd29d9f915e6116d42f9c64431a3d01d5e759..7231a708af0d6ceacde2b0e04b1c2f7110c3aa6e 100644 (file)
@@ -30,6 +30,7 @@
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
 #include <asm/unistd.h>
+#include <asm/ftrace.h>
 
 #undef SHOW_SYSCALLS
 #undef SHOW_SYSCALLS_TASK
@@ -1053,6 +1054,7 @@ _GLOBAL(_mcount)
        stw     r10,40(r1)
        stw     r3, 44(r1)
        stw     r5, 8(r1)
+       subi    r3, r3, MCOUNT_INSN_SIZE
        .globl mcount_call
 mcount_call:
        bl      ftrace_stub
@@ -1090,6 +1092,7 @@ _GLOBAL(ftrace_caller)
        stw     r10,40(r1)
        stw     r3, 44(r1)
        stw     r5, 8(r1)
+       subi    r3, r3, MCOUNT_INSN_SIZE
 .globl ftrace_call
 ftrace_call:
        bl      ftrace_stub
@@ -1128,6 +1131,7 @@ _GLOBAL(_mcount)
        stw     r3, 44(r1)
        stw     r5, 8(r1)
 
+       subi    r3, r3, MCOUNT_INSN_SIZE
        LOAD_REG_ADDR(r5, ftrace_trace_function)
        lwz     r5,0(r5)
 
index 2c4d9e056ead302f1f946b42c1f0dc4919c1fa56..2f511a969d2cfb9e9db66f12aa41a293ce32e026 100644 (file)
@@ -31,6 +31,7 @@
 #include <asm/bug.h>
 #include <asm/ptrace.h>
 #include <asm/irqflags.h>
+#include <asm/ftrace.h>
 
 /*
  * System calls.
@@ -879,6 +880,7 @@ _GLOBAL(_mcount)
        mflr    r3
        stdu    r1, -112(r1)
        std     r3, 128(r1)
+       subi    r3, r3, MCOUNT_INSN_SIZE
        .globl mcount_call
 mcount_call:
        bl      ftrace_stub
@@ -895,6 +897,7 @@ _GLOBAL(ftrace_caller)
        stdu    r1, -112(r1)
        std     r3, 128(r1)
        ld      r4, 16(r11)
+       subi    r3, r3, MCOUNT_INSN_SIZE
 .globl ftrace_call
 ftrace_call:
        bl      ftrace_stub
@@ -916,7 +919,7 @@ _GLOBAL(_mcount)
        std     r3, 128(r1)
        ld      r4, 16(r11)
 
-
+       subi    r3, r3, MCOUNT_INSN_SIZE
        LOAD_REG_ADDR(r5,ftrace_trace_function)
        ld      r5,0(r5)
        ld      r5,0(r5)
index e12c593ab9cacc94ceae3dcf8cf6d3953cf5c4e5..3855ceb937b0d23ae3b5d39bf271aabadea5eb79 100644 (file)
@@ -15,8 +15,8 @@
 #include <linux/list.h>
 
 #include <asm/cacheflush.h>
+#include <asm/ftrace.h>
 
-#define CALL_BACK              4
 
 static unsigned int ftrace_nop = 0x60000000;
 
@@ -27,9 +27,10 @@ static unsigned int ftrace_nop = 0x60000000;
 # define GET_ADDR(addr) *(unsigned long *)addr
 #endif
 
+
 static unsigned int notrace ftrace_calc_offset(long ip, long addr)
 {
-       return (int)((addr + CALL_BACK) - ip);
+       return (int)(addr - ip);
 }
 
 notrace unsigned char *ftrace_nop_replace(void)
@@ -76,9 +77,6 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
        unsigned new = *(unsigned *)new_code;
        int faulted = 0;
 
-       /* move the IP back to the start of the call */
-       ip -= CALL_BACK;
-
        /*
         * Note: Due to modules and __init, code can
         *  disappear and change, we need to protect against faulting
@@ -118,12 +116,10 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
 notrace int ftrace_update_ftrace_func(ftrace_func_t func)
 {
        unsigned long ip = (unsigned long)(&ftrace_call);
-       unsigned char old[4], *new;
+       unsigned char old[MCOUNT_INSN_SIZE], *new;
        int ret;
 
-       ip += CALL_BACK;
-
-       memcpy(old, &ftrace_call, 4);
+       memcpy(old, &ftrace_call, MCOUNT_INSN_SIZE);
        new = ftrace_call_replace(ip, (unsigned long)func);
        ret = ftrace_modify_code(ip, old, new);
 
@@ -134,16 +130,13 @@ notrace int ftrace_mcount_set(unsigned long *data)
 {
        unsigned long ip = (long)(&mcount_call);
        unsigned long *addr = data;
-       unsigned char old[4], *new;
-
-       /* ip is at the location, but modify code will subtact this */
-       ip += CALL_BACK;
+       unsigned char old[MCOUNT_INSN_SIZE], *new;
 
        /*
         * Replace the mcount stub with a pointer to the
         * ip recorder function.
         */
-       memcpy(old, &mcount_call, 4);
+       memcpy(old, &mcount_call, MCOUNT_INSN_SIZE);
        new = ftrace_call_replace(ip, *addr);
        *addr = ftrace_modify_code(ip, old, new);
 
index c17373195b1e849306eb0127953e0862c49f6df6..4298d0aee7137caf896c6e20605620b1b58b0124 100644 (file)
@@ -5,6 +5,8 @@
 #include <linux/init.h>
 #include <linux/list.h>
 
+#include <asm/ftrace.h>
+
 static const u32 ftrace_nop = 0x01000000;
 
 notrace unsigned char *ftrace_nop_replace(void)
@@ -60,9 +62,9 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
 notrace int ftrace_update_ftrace_func(ftrace_func_t func)
 {
        unsigned long ip = (unsigned long)(&ftrace_call);
-       unsigned char old[4], *new;
+       unsigned char old[MCOUNT_INSN_SIZE], *new;
 
-       memcpy(old, &ftrace_call, 4);
+       memcpy(old, &ftrace_call, MCOUNT_INSN_SIZE);
        new = ftrace_call_replace(ip, (unsigned long)func);
        return ftrace_modify_code(ip, old, new);
 }
@@ -71,13 +73,13 @@ notrace int ftrace_mcount_set(unsigned long *data)
 {
        unsigned long ip = (long)(&mcount_call);
        unsigned long *addr = data;
-       unsigned char old[4], *new;
+       unsigned char old[MCOUNT_INSN_SIZE], *new;
 
        /*
         * Replace the mcount stub with a pointer to the
         * ip recorder function.
         */
-       memcpy(old, &mcount_call, 4);
+       memcpy(old, &mcount_call, MCOUNT_INSN_SIZE);
        new = ftrace_call_replace(ip, *addr);
        *addr = ftrace_modify_code(ip, old, new);
 
index 8ac0b99f2c5563bad603edd5628794f1bdf5a898..b80d982a29c60b772b6282fc48c6e397946d71fe 100644 (file)
@@ -53,6 +53,7 @@
 #include <asm/ns87303.h>
 #include <asm/timer.h>
 #include <asm/cpudata.h>
+#include <asm/ftrace.h>
 
 struct poll {
        int fd;
@@ -112,7 +113,6 @@ EXPORT_SYMBOL(smp_call_function);
 #endif /* CONFIG_SMP */
 
 #if defined(CONFIG_MCOUNT)
-extern void _mcount(void);
 EXPORT_SYMBOL(_mcount);
 #endif
 
index 04ea83ccb979c6fcc6088bbda7113eba2d5b29d1..95e6bbe3665e1c240daa0400618a7d00c63af5a3 100644 (file)
@@ -51,6 +51,7 @@
 #include <asm/percpu.h>
 #include <asm/dwarf2.h>
 #include <asm/processor-flags.h>
+#include <asm/ftrace.h>
 #include "irq_vectors.h"
 
 /*
@@ -1118,6 +1119,7 @@ ENTRY(mcount)
        pushl %ecx
        pushl %edx
        movl 0xc(%esp), %eax
+       subl $MCOUNT_INSN_SIZE, %eax
 
 .globl mcount_call
 mcount_call:
@@ -1136,6 +1138,7 @@ ENTRY(ftrace_caller)
        pushl %edx
        movl 0xc(%esp), %eax
        movl 0x4(%ebp), %edx
+       subl $MCOUNT_INSN_SIZE, %eax
 
 .globl ftrace_call
 ftrace_call:
@@ -1166,6 +1169,7 @@ trace:
        pushl %edx
        movl 0xc(%esp), %eax
        movl 0x4(%ebp), %edx
+       subl $MCOUNT_INSN_SIZE, %eax
 
        call *ftrace_trace_function
 
index fe25e5febca386a5dc75a8891c45abf4953c97b9..b0f7308f78a6809135c8d84a163c1b4568d9bd8c 100644 (file)
@@ -51,6 +51,7 @@
 #include <asm/page.h>
 #include <asm/irqflags.h>
 #include <asm/paravirt.h>
+#include <asm/ftrace.h>
 
        .code64
 
@@ -68,6 +69,7 @@ ENTRY(mcount)
        movq %r9, 48(%rsp)
 
        movq 0x38(%rsp), %rdi
+       subq $MCOUNT_INSN_SIZE, %rdi
 
 .globl mcount_call
 mcount_call:
@@ -99,6 +101,7 @@ ENTRY(ftrace_caller)
 
        movq 0x38(%rsp), %rdi
        movq 8(%rbp), %rsi
+       subq $MCOUNT_INSN_SIZE, %rdi
 
 .globl ftrace_call
 ftrace_call:
@@ -139,6 +142,7 @@ trace:
 
        movq 0x38(%rsp), %rdi
        movq 8(%rbp), %rsi
+       subq $MCOUNT_INSN_SIZE, %rdi
 
        call   *ftrace_trace_function
 
index 55828149e01e90fccf6ac2f9f4fd677b496c8766..ab115cd15fdfbb2cc06182385b4a60b8521f617c 100644 (file)
 #include <linux/list.h>
 
 #include <asm/alternative.h>
+#include <asm/ftrace.h>
 
-#define CALL_BACK              5
 
 /* Long is fine, even if it is only 4 bytes ;-) */
 static long *ftrace_nop;
 
 union ftrace_code_union {
-       char code[5];
+       char code[MCOUNT_INSN_SIZE];
        struct {
                char e8;
                int offset;
        } __attribute__((packed));
 };
 
+
 static int notrace ftrace_calc_offset(long ip, long addr)
 {
        return (int)(addr - ip);
@@ -46,7 +47,7 @@ notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr)
        static union ftrace_code_union calc;
 
        calc.e8         = 0xe8;
-       calc.offset     = ftrace_calc_offset(ip, addr);
+       calc.offset     = ftrace_calc_offset(ip + MCOUNT_INSN_SIZE, addr);
 
        /*
         * No locking needed, this must be called via kstop_machine
@@ -65,9 +66,6 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
        unsigned char newch = new_code[4];
        int faulted = 0;
 
-       /* move the IP back to the start of the call */
-       ip -= CALL_BACK;
-
        /*
         * Note: Due to modules and __init, code can
         *  disappear and change, we need to protect against faulting
@@ -102,12 +100,10 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
 notrace int ftrace_update_ftrace_func(ftrace_func_t func)
 {
        unsigned long ip = (unsigned long)(&ftrace_call);
-       unsigned char old[5], *new;
+       unsigned char old[MCOUNT_INSN_SIZE], *new;
        int ret;
 
-       ip += CALL_BACK;
-
-       memcpy(old, &ftrace_call, 5);
+       memcpy(old, &ftrace_call, MCOUNT_INSN_SIZE);
        new = ftrace_call_replace(ip, (unsigned long)func);
        ret = ftrace_modify_code(ip, old, new);
 
@@ -118,16 +114,13 @@ notrace int ftrace_mcount_set(unsigned long *data)
 {
        unsigned long ip = (long)(&mcount_call);
        unsigned long *addr = data;
-       unsigned char old[5], *new;
-
-       /* ip is at the location, but modify code will subtact this */
-       ip += CALL_BACK;
+       unsigned char old[MCOUNT_INSN_SIZE], *new;
 
        /*
         * Replace the mcount stub with a pointer to the
         * ip recorder function.
         */
-       memcpy(old, &mcount_call, 5);
+       memcpy(old, &mcount_call, MCOUNT_INSN_SIZE);
        new = ftrace_call_replace(ip, *addr);
        *addr = ftrace_modify_code(ip, old, new);
 
@@ -142,8 +135,7 @@ int __init ftrace_dyn_arch_init(void *data)
 
        ftrace_mcount_set(data);
 
-       ftrace_nop = (unsigned long *)noptable[CALL_BACK];
+       ftrace_nop = (unsigned long *)noptable[MCOUNT_INSN_SIZE];
 
        return 0;
 }
-
index 29999dbb754ce949b7956ae3d0cd064b21c03612..dd7ebee446afaab244041868b67d89833b8d00c5 100644 (file)
@@ -1,9 +1,9 @@
-#include <linux/ftrace.h>
 #include <linux/module.h>
 
 #include <asm/checksum.h>
 #include <asm/pgtable.h>
 #include <asm/desc.h>
+#include <asm/ftrace.h>
 
 #ifdef CONFIG_FTRACE
 /* mcount is defined in assembly */
index 122885bc5f3b887fb7dfb5e761b9293dac3f385a..16ff4bf418d9de6b00295ef16490d3f20ec00f6b 100644 (file)
@@ -1,7 +1,6 @@
 /* Exports for assembly files.
    All C exports should go in the respective C files. */
 
-#include <linux/ftrace.h>
 #include <linux/module.h>
 #include <linux/smp.h>
 
@@ -11,6 +10,7 @@
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
 #include <asm/desc.h>
+#include <asm/ftrace.h>
 
 #ifdef CONFIG_FTRACE
 /* mcount is defined in assembly */
diff --git a/include/asm-arm/ftrace.h b/include/asm-arm/ftrace.h
new file mode 100644 (file)
index 0000000..584ef9a
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef _ASM_ARM_FTRACE
+#define _ASM_ARM_FTRACE
+
+#ifdef CONFIG_FTRACE
+#define MCOUNT_ADDR            ((long)(mcount))
+#define MCOUNT_INSN_SIZE       4 /* sizeof mcount call */
+
+#ifndef __ASSEMBLY__
+extern void mcount(void);
+#endif
+
+#endif
+
+#endif /* _ASM_ARM_FTRACE */
index b1bfa704b6e53b107512c75100e0c56e1c80695c..de921326cca8bf9572941a650c1bd2d8b63f128c 100644 (file)
@@ -1,6 +1,14 @@
 #ifndef _ASM_POWERPC_FTRACE
 #define _ASM_POWERPC_FTRACE
 
+#ifdef CONFIG_FTRACE
+#define MCOUNT_ADDR            ((long)(_mcount))
+#define MCOUNT_INSN_SIZE       4 /* sizeof mcount call */
+
+#ifndef __ASSEMBLY__
 extern void _mcount(void);
+#endif
 
 #endif
+
+#endif /* _ASM_POWERPC_FTRACE */
diff --git a/include/asm-sparc64/ftrace.h b/include/asm-sparc64/ftrace.h
new file mode 100644 (file)
index 0000000..f76a40a
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef _ASM_SPARC64_FTRACE
+#define _ASM_SPARC64_FTRACE
+
+#ifdef CONFIG_FTRACE
+#define MCOUNT_ADDR            ((long)(_mcount))
+#define MCOUNT_INSN_SIZE       4 /* sizeof mcount call */
+
+#ifndef __ASSEMBLY__
+extern void _mcount(void);
+#endif
+
+#endif
+
+#endif /* _ASM_SPARC64_FTRACE */
diff --git a/include/asm-x86/ftrace.h b/include/asm-x86/ftrace.h
new file mode 100644 (file)
index 0000000..c184441
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef _ASM_X86_FTRACE
+#define _ASM_SPARC64_FTRACE
+
+#ifdef CONFIG_FTRACE
+#define MCOUNT_ADDR            ((long)(mcount))
+#define MCOUNT_INSN_SIZE       5 /* sizeof mcount call */
+
+#ifndef __ASSEMBLY__
+extern void mcount(void);
+#endif
+
+#endif /* CONFIG_FTRACE */
+
+#endif /* _ASM_X86_FTRACE */
index 20e14d0093c783dab553376fd1ec8383ac1c6834..366098d591de852a59db022765b391c0004eeba2 100644 (file)
@@ -31,7 +31,6 @@ int unregister_ftrace_function(struct ftrace_ops *ops);
 void clear_ftrace_function(void);
 
 extern void ftrace_stub(unsigned long a0, unsigned long a1);
-extern void mcount(void);
 
 #else /* !CONFIG_FTRACE */
 # define register_ftrace_function(ops) do { } while (0)
@@ -54,7 +53,7 @@ enum {
 
 struct dyn_ftrace {
        struct hlist_node node;
-       unsigned long     ip;
+       unsigned long     ip; /* address of mcount call-site */
        unsigned long     flags;
 };
 
index 0d5bcf69952d9889a17cc9f1b06dbd8a0df54e24..f1e9e5c74e649cbb0f13469dc8aaf575bd34208d 100644 (file)
@@ -27,6 +27,8 @@
 #include <linux/hash.h>
 #include <linux/list.h>
 
+#include <asm/ftrace.h>
+
 #include "trace.h"
 
 /* ftrace_enabled is a method to turn ftrace on or off */
@@ -329,7 +331,6 @@ ftrace_record_ip(unsigned long ip)
 }
 
 #define FTRACE_ADDR ((long)(ftrace_caller))
-#define MCOUNT_ADDR ((long)(mcount))
 
 static int
 __ftrace_replace_code(struct dyn_ftrace *rec,