linux-next: build failure after merge of the tip tree
Subsystems (4)
Hi all,
After merging the tip tree, today's linux-next build (powerpc ppc64_defconfig) failed like this:
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!
Caused by commit 5331d7b84613b8325362dde53dc2bff2fb87d351 ("perf:
Introduce new perf_fetch_caller_regs() for hot regs snapshot") from the tip tree. Presumably commit 639fe4b12f92b54c9c3b38c82cdafaa38cfd3e63 ("perf: export perf_trace_regs and perf_arch_fetch_caller_regs") should have exported the weak version as well as the x86 one.
I have used the version of the tip tree from next-20100311 for today.
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
PATCH 1/1 perf: Also export the weak version of perf_arch_fetch_caller_regs
Quoted 8 lines · Stephen Rothwell
Hi all,
After merging the tip tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this: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!
Quoted 7 lines
Caused by commit
5331d7b84613b8325362dde53dc2bff2fb87d351("perf:
Introduce newperf_fetch_caller_regs()for hot regs snapshot") from the tip tree. Presumably commit639fe4b12f92b54c9c3b38c82cdafaa38cfd3e63("perf: exportperf_trace_regsandperf_arch_fetch_caller_regs") should have exported the weak version as well as the x86 one.I have used the version of the tip tree from next-20100311 for today.
Does that fixes the issue? Sorry I can not test for now...
Thanks!
---
Quoted 1 line
From
0b21e01edb23b4725d20a9e5fddb6df7fedd16e1Mon Sep 17 00:00:00 2001
From: Frederic Weisbecker <[email protected]>
Date: Fri, 12 Mar 2010 06:23:22 +0100
Subject: [PATCH] perf: Also export the weak version of perf_arch_fetch_caller_regs
perf_arch_fetch_caller_regs() is exported in x86 but not for other archs that use the weak version.
Export it only once from the generic code, it will apply to either weak/overriden version.
--- arch/x86/kernel/cpu/perf_event.c | 1 - kernel/perf_event.c | 1 + 2 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/perf_event.c +0 -1
@@ -1691,4 +1691,3 @@ void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int ski regs->cs = __KERNEL_CS;local_save_flags (regs->flags); } -EXPORT_SYMBOL_GPL (perf_arch_fetch_caller_regs);
kernel/perf_event.c +1 -0
@@ -2794,6 +2794,7 @@ __weakvoid perf_arch_fetch_caller_regs (struct pt_regs *regs,unsigned long ip,int skip) { } +EXPORT_SYMBOL_GPL (perf_arch_fetch_caller_regs);/* * Output
Signature · 1 line
1.6.2.3
Re: [PATCH] perf: Also export the weak version of perf_arch_fetch_caller_regs
Hi Frederic,
Quoted 2 lines · On Fri, 12 Mar 2010 06:50:44 +0100 Frederic Weisbecker <[email protected]>…
Does that fixes the issue? Sorry I can not test for now...
I can't test it right now, sorry, but I have heard that EXPORT_SYMBOL's for weak symbols must be in a different file from the actual symbol definition.
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Re: [PATCH] perf: Also export the weak version of perf_arch_fetch_caller_regs
Hi Frederic,
Quoted 8 lines · On Fri, 12 Mar 2010 17:20:43 +1100 Stephen Rothwell <[email protected]>…
Quoted 2 lines · On Fri, 12 Mar 2010 06:50:44 +0100 Frederic Weisbecker <[email protected]>…
Does that fixes the issue? Sorry I can not test for now...
I can't test it right now, sorry, but I have heard that EXPORT_SYMBOL's for weak symbols must be in a different file from the actual symbol definition.
See http://lkml.org/lkml/2010/2/17/467
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
PATCH 1/1 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 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!
And also only build it if trace events are enabled.
--- arch/x86/kernel/cpu/perf_event.c | 1 - kernel/trace/trace_event_perf.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/perf_event.c +0 -1
@@ -1713,4 +1713,3 @@ void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int ski regs->cs = __KERNEL_CS;local_save_flags (regs->flags); } -EXPORT_SYMBOL_GPL (perf_arch_fetch_caller_regs);
kernel/trace/trace_event_perf.c +2 -0
@@ -12,6 +12,8 @@ DEFINE_PER_CPU(struct pt_regs, perf_trace_regs);EXPORT_PER_CPU_SYMBOL_GPL (perf_trace_regs); +EXPORT_SYMBOL_GPL (perf_arch_fetch_caller_regs); +static char *perf_trace_buf;static char *perf_trace_buf_nmi;
Signature · 1 line
1.6.2.3
PATCH v2 1/1 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 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.
--- arch/x86/kernel/cpu/perf_event.c | 3 ++- kernel/perf_event.c | 2 ++ kernel/trace/trace_event_perf.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/perf_event.c +2 -1
@@ -1702,6 +1702,7 @@ struct perf_callchain_entry *perf_callchain(struct pt_regs *regs)return entry; } +#ifdef CONFIG_EVENT_TRACING void perf_arch_fetch_caller_regs (struct pt_regs *regs,unsigned long ip,int skip) { regs->ip = ip;
@@ -1713,4 +1714,4 @@ void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int ski regs->cs = __KERNEL_CS; local_save_flags(regs->flags); } -EXPORT_SYMBOL_GPL (perf_arch_fetch_caller_regs); +#endif
kernel/perf_event.c +2 -0
@@ -2786,10 +2786,12 @@ __weak struct perf_callchain_entry *perf_callchain(struct pt_regs *regs)return NULL ; } +#ifdef CONFIG_EVENT_TRACING __weak void perf_arch_fetch_caller_regs (struct pt_regs *regs,unsigned long ip,int skip) { } +#endif /* * Output
kernel/trace/trace_event_perf.c +2 -0
@@ -12,6 +12,8 @@ DEFINE_PER_CPU(struct pt_regs, perf_trace_regs);EXPORT_PER_CPU_SYMBOL_GPL (perf_trace_regs); +EXPORT_SYMBOL_GPL (perf_arch_fetch_caller_regs); +static char *perf_trace_buf;static char *perf_trace_buf_nmi;
Signature · 1 line
1.6.2.3
Re: [PATCH v2] perf: Fix unexported generic perf_arch_fetch_caller_regs
Hi Frederic,
Quoted 4 lines · On Mon, 15 Mar 2010 23:17:22 +0100 Frederic Weisbecker <[email protected]>…
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 have their symbol exported
^
"not"
Quoted 4 lines
in the same file they are defined.
So let's export it on
trace_event_perf.cas it is used by trace events only.
Otherwise, looks good (though I haven't tested it).
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Re: [PATCH v2] perf: Fix unexported generic perf_arch_fetch_caller_regs
Quoted 9 lines · Stephen Rothwell
Hi Frederic,
Quoted 4 lines · On Mon, 15 Mar 2010 23:17:22 +0100 Frederic Weisbecker <[email protected]>…
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 have their symbol exported^"not"
Ooh, right.
Quoted 6 lines
Quoted 4 lines
in the same file they are defined.
So let's export it on
trace_event_perf.cas it is used by trace events only.Otherwise, looks good (though I haven't tested it).
I've tested with some trace event built as module and it looks fine so far.
Thanks.
PATCH v3 1/1 perf: Fix unexported generic perf_arch_fetch_caller_regs
In reply to Stephen Rothwellperf_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
--- arch/x86/kernel/cpu/perf_event.c | 3 ++- kernel/perf_event.c | 2 ++ kernel/trace/trace_event_perf.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/perf_event.c +2 -1
@@ -1702,6 +1702,7 @@ struct perf_callchain_entry *perf_callchain(struct pt_regs *regs)return entry; } +#ifdef CONFIG_EVENT_TRACING void perf_arch_fetch_caller_regs (struct pt_regs *regs,unsigned long ip,int skip) { regs->ip = ip;
@@ -1713,4 +1714,4 @@ void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int ski regs->cs = __KERNEL_CS; local_save_flags(regs->flags); } -EXPORT_SYMBOL_GPL (perf_arch_fetch_caller_regs); +#endif
kernel/perf_event.c +2 -0
@@ -2786,10 +2786,12 @@ __weak struct perf_callchain_entry *perf_callchain(struct pt_regs *regs)return NULL ; } +#ifdef CONFIG_EVENT_TRACING __weak void perf_arch_fetch_caller_regs (struct pt_regs *regs,unsigned long ip,int skip) { } +#endif /* * Output
kernel/trace/trace_event_perf.c +2 -0
@@ -12,6 +12,8 @@ DEFINE_PER_CPU(struct pt_regs, perf_trace_regs);EXPORT_PER_CPU_SYMBOL_GPL (perf_trace_regs); +EXPORT_SYMBOL_GPL (perf_arch_fetch_caller_regs); +static char *perf_trace_buf;static char *perf_trace_buf_nmi;
Signature · 1 line
1.6.2.3
[tip:perf/core] perf: Fix unexported generic perf_arch_fetch_caller_regs
Commit-ID: 1d199b1ad606ae8b88acebd295b101c4e1cf2a57 Gitweb: http://git.kernel.org/tip/1d199b1ad606ae8b88acebd295b101c4e1cf2a57 Author: Frederic Weisbecker <[email protected]> AuthorDate: Tue, 16 Mar 2010 01:05:02 +0100 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 16 Mar 2010 09:27:27 +0100
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
LKML-Reference: <[email protected]>
--- arch/x86/kernel/cpu/perf_event.c | 3 ++- kernel/perf_event.c | 2 ++ kernel/trace/trace_event_perf.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/perf_event.c +2 -1
@@ -1695,6 +1695,7 @@ struct perf_callchain_entry *perf_callchain(struct pt_regs *regs)return entry; } +#ifdef CONFIG_EVENT_TRACING void perf_arch_fetch_caller_regs (struct pt_regs *regs,unsigned long ip,int skip) { regs->ip = ip;
@@ -1706,4 +1707,4 @@ void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int ski regs->cs = __KERNEL_CS; local_save_flags(regs->flags); } -EXPORT_SYMBOL_GPL (perf_arch_fetch_caller_regs); +#endif
kernel/perf_event.c +2 -0
@@ -2790,10 +2790,12 @@ __weak struct perf_callchain_entry *perf_callchain(struct pt_regs *regs)return NULL ; } +#ifdef CONFIG_EVENT_TRACING __weak void perf_arch_fetch_caller_regs (struct pt_regs *regs,unsigned long ip,int skip) { } +#endif /* * Output
kernel/trace/trace_event_perf.c +2 -0
@@ -12,6 +12,8 @@ DEFINE_PER_CPU(struct pt_regs, perf_trace_regs);EXPORT_PER_CPU_SYMBOL_GPL (perf_trace_regs); +EXPORT_SYMBOL_GPL (perf_arch_fetch_caller_regs); +static char *perf_trace_buf;static char *perf_trace_buf_nmi;
[tip:perf/urgent] perf: Fix unexported generic perf_arch_fetch_caller_regs
In reply to Frederic WeisbeckerCommit-ID: a6b84574eed7e4fd8cb8dac2d0926fe2cf34b941 Gitweb: http://git.kernel.org/tip/a6b84574eed7e4fd8cb8dac2d0926fe2cf34b941 Author: Frederic Weisbecker <[email protected]> AuthorDate: Tue, 16 Mar 2010 01:05:02 +0100 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 17 Mar 2010 10:44:42 +0100
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
LKML-Reference: <[email protected]>
--- arch/x86/kernel/cpu/perf_event.c | 3 ++- kernel/perf_event.c | 2 ++ kernel/trace/trace_event_perf.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/perf_event.c +2 -1
@@ -1702,6 +1702,7 @@ struct perf_callchain_entry *perf_callchain(struct pt_regs *regs)return entry; } +#ifdef CONFIG_EVENT_TRACING void perf_arch_fetch_caller_regs (struct pt_regs *regs,unsigned long ip,int skip) { regs->ip = ip;
@@ -1713,4 +1714,4 @@ void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int ski regs->cs = __KERNEL_CS; local_save_flags(regs->flags); } -EXPORT_SYMBOL_GPL (perf_arch_fetch_caller_regs); +#endif
kernel/perf_event.c +2 -0
@@ -2786,10 +2786,12 @@ __weak struct perf_callchain_entry *perf_callchain(struct pt_regs *regs)return NULL ; } +#ifdef CONFIG_EVENT_TRACING __weak void perf_arch_fetch_caller_regs (struct pt_regs *regs,unsigned long ip,int skip) { } +#endif /* * Output
kernel/trace/trace_event_perf.c +2 -0
@@ -12,6 +12,8 @@ DEFINE_PER_CPU(struct pt_regs, perf_trace_regs);EXPORT_PER_CPU_SYMBOL_GPL (perf_trace_regs); +EXPORT_SYMBOL_GPL (perf_arch_fetch_caller_regs); +static char *perf_trace_buf;static char *perf_trace_buf_nmi;
Re: [PATCH] perf: Also export the weak version of perf_arch_fetch_caller_regs
In reply to Stephen RothwellQuoted 9 lines · Stephen Rothwell
Hi Frederic,
Quoted 2 lines · On Fri, 12 Mar 2010 06:50:44 +0100 Frederic Weisbecker <[email protected]>…
Does that fixes the issue? Sorry I can not test for now...
I can't test it right now, sorry, but I have heard that EXPORT_SYMBOL's for weak symbols must be in a different file from the actual symbol definition.
Hmm. Ok, kernel/trace/trace_event_perf.c must be the right place then, as the only users of this helper are trace events.
Will send a fix once I get this tested, thanks for the pointer!