Skip to content

Commit

Permalink
ftrace: fix mcount export bug
Browse files Browse the repository at this point in the history
David S. Miller noticed the following bug: the -pg instrumentation
function callback is named differently on each platform. On x86 it
is mcount, on sparc it is _mcount. So the export does not make sense
in kernel/trace/ftrace.c - move it to x86.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Ingo Molnar authored and Thomas Gleixner committed May 23, 2008
1 parent d05f5f9 commit 3713567
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
9 changes: 8 additions & 1 deletion arch/x86/kernel/i386_ksyms_32.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#include <linux/ftrace.h>
#include <linux/module.h>

#include <asm/checksum.h>
#include <asm/desc.h>
#include <asm/pgtable.h>
#include <asm/desc.h>

#ifdef CONFIG_FTRACE
/* mcount is defined in assembly */
EXPORT_SYMBOL(mcount);
#endif

/* Networking helper routines. */
EXPORT_SYMBOL(csum_partial_copy_generic);
Expand Down
11 changes: 9 additions & 2 deletions arch/x86/kernel/x8664_ksyms_64.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
/* Exports for assembly files.
All C exports should go in the respective C files. */

#include <linux/ftrace.h>
#include <linux/module.h>
#include <net/checksum.h>
#include <linux/smp.h>

#include <net/checksum.h>

#include <asm/processor.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/uaccess.h>
#include <asm/desc.h>

#ifdef CONFIG_FTRACE
/* mcount is defined in assembly */
EXPORT_SYMBOL(mcount);
#endif

EXPORT_SYMBOL(kernel_thread);

EXPORT_SYMBOL(__get_user_1);
Expand Down
3 changes: 0 additions & 3 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ static struct ftrace_ops ftrace_list_end __read_mostly =
static struct ftrace_ops *ftrace_list __read_mostly = &ftrace_list_end;
ftrace_func_t ftrace_trace_function __read_mostly = ftrace_stub;

/* mcount is defined per arch in assembly */
EXPORT_SYMBOL(mcount);

void ftrace_list_func(unsigned long ip, unsigned long parent_ip)
{
struct ftrace_ops *op = ftrace_list;
Expand Down

0 comments on commit 3713567

Please sign in to comment.