Skip to contentSkip to conversation

perf: export perf_trace_regs and perf_arch_fetch_caller_regs

PATCH In review Xiao Guangrong 4 participants 7 messages Mar 11, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf: export perf_trace_regs and perf_arch_fetch_caller_regs

Export perf_trace_regs and perf_arch_fetch_caller_regs since module will use these

---
 arch/x86/kernel/cpu/perf_event.c |    1 +
 kernel/trace/trace_event_perf.c  |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/kernel/cpu/perf_event.c +1 -0
index 4a0514d..8700643 100644
@@ -1697,3 +1697,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);
kernel/trace/trace_event_perf.c +1 -0
index f315b12..af4621b 100644
@@ -10,6 +10,7 @@
 #include "trace.h"
 
 DEFINE_PER_CPU(struct pt_regs, perf_trace_regs);
+EXPORT_SYMBOL_GPL(perf_trace_regs);
 
 static char *perf_trace_buf;
 static char *perf_trace_buf_nmi;
Signature · 1 line
1.6.4
maintainer
#1 lore raw
Quoted 4 lines · Xiao Guangrong

#include "trace.h"

DEFINE_PER_CPU(struct pt_regs, perf_trace_regs);
+EXPORT_SYMBOL_GPL(perf_trace_regs);

Shouldn't that be:

EXPORT_PER_CPU_SYMBOL_GPL(perf_trace_regs); ?

#2 lore raw
In reply to Xiao Guangrong
Quoted 2 lines · Xiao Guangrong

Export perf_trace_regs and perf_arch_fetch_caller_regs since module will use these

What modules exactly? Uusually you add the export together with the series adding the users.

maintainer
#3 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 2 lines · Xiao Guangrong

Export perf_trace_regs and perf_arch_fetch_caller_regs since module will use these

What modules exactly? Uusually you add the export together with the series adding the users.

Pretty much all modular tracepoint users I think, I just got this from a pp64_defconfig build:

ERROR: "perf_trace_regs" [fs/xfs/xfs.ko] undefined!
ERROR: ".perf_arch_fetch_caller_regs" [fs/xfs/xfs.ko] undefined!
ERROR: "perf_trace_regs" [arch/powerpc/platforms/cell/spufs/spufs.ko] undefined!
ERROR: ".perf_arch_fetch_caller_regs" [arch/powerpc/platforms/cell/spufs/spufs.ko] undefined!

#4 lore raw
Quoted 2 lines · Peter Zijlstra

Pretty much all modular tracepoint users I think, I just got this from a pp64_defconfig build:

Interesting, that doesn't happen in mainline yet.

#5 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 2 lines · Peter Zijlstra

Pretty much all modular tracepoint users I think, I just got this from a pp64_defconfig build:

Interesting, that doesn't happen in mainline yet.

Yeah, it's in -tip.

Thanks guys for this fix. I think I'm unable to remind there are modules in the kernel, I'm not counting anymore the number of times I forget to export symbols for modules.

May be I should start to stick posters with photos of modules entitled "I want to believe" everywhere in my flat. Or perhaps I'm going to buy electronic glasses that display modules advertizing in the street. I'm not sure yet but I'll find a way.

#6 lore raw
In reply to Xiao Guangrong
Commit-ID:  639fe4b12f92b54c9c3b38c82cdafaa38cfd3e63
Gitweb:     http://git.kernel.org/tip/639fe4b12f92b54c9c3b38c82cdafaa38cfd3e63
Author:     Xiao Guangrong <[email protected]>
AuthorDate: Thu, 11 Mar 2010 15:30:35 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 11 Mar 2010 15:21:29 +0100

perf: export perf_trace_regs and perf_arch_fetch_caller_regs

Export perf_trace_regs and perf_arch_fetch_caller_regs since module will use these.

[ use EXPORT_PER_CPU_SYMBOL_GPL() ]

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/cpu/perf_event.c |    1 +
 kernel/trace/trace_event_perf.c  |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/kernel/cpu/perf_event.c +1 -0
index 5fb490c..7645fae 100644
@@ -1713,3 +1713,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);
kernel/trace/trace_event_perf.c +1 -0
index f315b12..0709e4f 100644
@@ -10,6 +10,7 @@
 #include "trace.h"
 
 DEFINE_PER_CPU(struct pt_regs, perf_trace_regs);
+EXPORT_PER_CPU_SYMBOL_GPL(perf_trace_regs);
 
 static char *perf_trace_buf;
 static char *perf_trace_buf_nmi;