[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-1d199b1ad606ae8b88acebd295b101c4e1cf2a57@git.kernel.org>
Date: Tue, 16 Mar 2010 14:45:36 GMT
From: tip-bot for Frederic Weisbecker <fweisbec@...il.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, paulus@...ba.org, hpa@...or.com,
mingo@...hat.com, peterz@...radead.org,
xiaoguangrong@...fujitsu.com, fweisbec@...il.com,
tglx@...utronix.de, sfr@...b.auug.org.au, mingo@...e.hu
Subject: [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 <fweisbec@...il.com>
AuthorDate: Tue, 16 Mar 2010 01:05:02 +0100
Committer: Ingo Molnar <mingo@...e.hu>
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
Reported-by: Stephen Rothwell <sfr@...b.auug.org.au>
Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Xiao Guangrong <xiaoguangrong@...fujitsu.com>
Cc: Paul Mackerras <paulus@...ba.org>
LKML-Reference: <1268697902-9518-1-git-send-regression-fweisbec@...il.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
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(-)
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 978d297..0d3466c 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)
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
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 8bf6127..455393e 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)
return NULL;
}
+#ifdef CONFIG_EVENT_TRACING
__weak
void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip)
{
}
+#endif
/*
* Output
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
index 0709e4f..7d79a10 100644
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists