diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-03-15 20:05:02 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-03-16 04:27:27 -0400 |
commit | 1d199b1ad606ae8b88acebd295b101c4e1cf2a57 (patch) | |
tree | 1d08629d41f7d0fa6ffd7780fd3caf3d18ca8de7 | |
parent | d06d92b7c9b99ea52bdaeb13f544675529891b8a (diff) |
perf: Fix unexported generic perf_arch_fetch_caller_regs
perf_arch_fetch_caller_regs() is exported for the overriden x86
version, but not for the generic weak version.
As a general rule, weak functions should not have their symbol
exported in the same file they are defined.
So let's export it on trace_event_perf.c as it is used by trace
events only.
This fixes:
ERROR: ".perf_arch_fetch_caller_regs" [fs/xfs/xfs.ko] undefined!
ERROR: ".perf_arch_fetch_caller_regs" [arch/powerpc/platforms/cell/spufs/spufs.ko] undefined!
-v2: And also only build it if trace events are enabled.
-v3: Fix changelog mistake
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1268697902-9518-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 3 | ||||
-rw-r--r-- | kernel/perf_event.c | 2 | ||||
-rw-r--r-- | kernel/trace/trace_event_perf.c | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 978d297170a1..0d3466cf7f57 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -1695,6 +1695,7 @@ struct perf_callchain_entry *perf_callchain(struct pt_regs *regs) | |||
1695 | return entry; | 1695 | return entry; |
1696 | } | 1696 | } |
1697 | 1697 | ||
1698 | #ifdef CONFIG_EVENT_TRACING | ||
1698 | void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip) | 1699 | void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip) |
1699 | { | 1700 | { |
1700 | regs->ip = ip; | 1701 | regs->ip = ip; |
@@ -1706,4 +1707,4 @@ void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int ski | |||
1706 | regs->cs = __KERNEL_CS; | 1707 | regs->cs = __KERNEL_CS; |
1707 | local_save_flags(regs->flags); | 1708 | local_save_flags(regs->flags); |
1708 | } | 1709 | } |
1709 | EXPORT_SYMBOL_GPL(perf_arch_fetch_caller_regs); | 1710 | #endif |
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 8bf61273c58b..455393e71cab 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -2790,10 +2790,12 @@ __weak struct perf_callchain_entry *perf_callchain(struct pt_regs *regs) | |||
2790 | return NULL; | 2790 | return NULL; |
2791 | } | 2791 | } |
2792 | 2792 | ||
2793 | #ifdef CONFIG_EVENT_TRACING | ||
2793 | __weak | 2794 | __weak |
2794 | void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip) | 2795 | void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip) |
2795 | { | 2796 | { |
2796 | } | 2797 | } |
2798 | #endif | ||
2797 | 2799 | ||
2798 | /* | 2800 | /* |
2799 | * Output | 2801 | * Output |
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c index 0709e4f75114..7d79a10c3cde 100644 --- a/kernel/trace/trace_event_perf.c +++ b/kernel/trace/trace_event_perf.c | |||
@@ -12,6 +12,8 @@ | |||
12 | DEFINE_PER_CPU(struct pt_regs, perf_trace_regs); | 12 | DEFINE_PER_CPU(struct pt_regs, perf_trace_regs); |
13 | EXPORT_PER_CPU_SYMBOL_GPL(perf_trace_regs); | 13 | EXPORT_PER_CPU_SYMBOL_GPL(perf_trace_regs); |
14 | 14 | ||
15 | EXPORT_SYMBOL_GPL(perf_arch_fetch_caller_regs); | ||
16 | |||
15 | static char *perf_trace_buf; | 17 | static char *perf_trace_buf; |
16 | static char *perf_trace_buf_nmi; | 18 | static char *perf_trace_buf_nmi; |
17 | 19 | ||