public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel: context_tracking: use extern function instead of static inline function for user_enter/exit()
@ 2013-10-23 10:38 Chen Gang
  2013-10-23 10:47 ` Steven Rostedt
  2013-10-23 11:11 ` Frederic Weisbecker
  0 siblings, 2 replies; 7+ messages in thread
From: Chen Gang @ 2013-10-23 10:38 UTC (permalink / raw)
  To: Frederic Weisbecker, Paul McKenney, khilman, Steven Rostedt,
	Ingo Molnar, Peter Zijlstra
  Cc: Andrew Morton, linux-kernel@vger.kernel.org

The related assemble code can not find the static inline function. The
related commit "ad65782 context_tracking: Optimize main APIs off case
with static key" causes this issue.

The related error (for arm, with allmodconfig):

    LD      init/built-in.o
  arch/arm/kernel/built-in.o: In function `ret_fast_syscall':
  arch/arm/kernel/entry-common.S:42: undefined reference to `user_enter'
  arch/arm/kernel/built-in.o: In function `no_work_pending':
  arch/arm/kernel/entry-common.S:77: undefined reference to `user_enter'
  arch/arm/kernel/built-in.o: In function `vector_swi':
  arch/arm/kernel/entry-common.S:376: undefined reference to `user_exit'
  arch/arm/kernel/built-in.o: In function `__dabt_usr':
  arch/arm/kernel/entry-armv.S:365: undefined reference to `user_exit'
  arch/arm/kernel/built-in.o: In function `__irq_usr':
  arch/arm/kernel/entry-armv.S:375: undefined reference to `user_exit'
  arch/arm/kernel/built-in.o: In function `__und_usr':
  arch/arm/kernel/entry-armv.S:388: undefined reference to `user_exit'
  arch/arm/kernel/built-in.o: In function `__pabt_usr':
  arch/arm/kernel/entry-armv.S:662: undefined reference to `user_exit'


Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 include/linux/context_tracking.h |   14 ++------------
 kernel/context_tracking.c        |   12 ++++++++++++
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h
index 1581587..bf220f7 100644
--- a/include/linux/context_tracking.h
+++ b/include/linux/context_tracking.h
@@ -10,23 +10,13 @@
 #ifdef CONFIG_CONTEXT_TRACKING
 extern void context_tracking_cpu_set(int cpu);
 
+extern void user_enter(void);
+extern void user_exit(void);
 extern void context_tracking_user_enter(void);
 extern void context_tracking_user_exit(void);
 extern void __context_tracking_task_switch(struct task_struct *prev,
 					   struct task_struct *next);
 
-static inline void user_enter(void)
-{
-	if (static_key_false(&context_tracking_enabled))
-		context_tracking_user_enter();
-
-}
-static inline void user_exit(void)
-{
-	if (static_key_false(&context_tracking_enabled))
-		context_tracking_user_exit();
-}
-
 static inline enum ctx_state exception_enter(void)
 {
 	enum ctx_state prev_ctx;
diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c
index 013161f..c03d0d6 100644
--- a/kernel/context_tracking.c
+++ b/kernel/context_tracking.c
@@ -29,6 +29,18 @@ EXPORT_SYMBOL_GPL(context_tracking_enabled);
 DEFINE_PER_CPU(struct context_tracking, context_tracking);
 EXPORT_SYMBOL_GPL(context_tracking);
 
+void user_enter(void)
+{
+	if (static_key_false(&context_tracking_enabled))
+		context_tracking_user_enter();
+}
+
+void user_exit(void)
+{
+	if (static_key_false(&context_tracking_enabled))
+		context_tracking_user_exit();
+}
+
 void context_tracking_cpu_set(int cpu)
 {
 	if (!per_cpu(context_tracking.active, cpu)) {
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-10-23 11:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-23 10:38 [PATCH] kernel: context_tracking: use extern function instead of static inline function for user_enter/exit() Chen Gang
2013-10-23 10:47 ` Steven Rostedt
2013-10-23 11:01   ` Chen Gang
2013-10-23 11:15     ` Steven Rostedt
2013-10-23 11:31       ` Chen Gang
2013-10-23 11:11 ` Frederic Weisbecker
2013-10-23 11:19   ` Chen Gang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox