All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ftrace: move the CALLER_ADDRx macros into its own header
@ 2016-02-11 23:21 Sebastian Andrzej Siewior
  2016-02-11 23:21 ` [PATCH 2/2] kernel: sched: fix preempt_disable_ip recodring for preempt_disable() Sebastian Andrzej Siewior
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Andrzej Siewior @ 2016-02-11 23:21 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Ingo Molnar, Peter Zijlstra, linux-kernel,
	Sebastian Andrzej Siewior

This patch moves the CALLER_ADDRx macros into their own header so it is
not required to include ftrace.h just for them.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 include/linux/ftrace.h        | 25 +------------------------
 include/linux/ftrace_caller.h | 28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 24 deletions(-)
 create mode 100644 include/linux/ftrace_caller.h

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 81de7123959d..83193c717cb9 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -16,8 +16,7 @@
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/fs.h>
-
-#include <asm/ftrace.h>
+#include <linux/ftrace_caller.h>
 
 /*
  * If the arch supports passing the variable contents of
@@ -689,28 +688,6 @@ static inline void __ftrace_enabled_restore(int enabled)
 #endif
 }
 
-/* All archs should have this, but we define it for consistency */
-#ifndef ftrace_return_address0
-# define ftrace_return_address0 __builtin_return_address(0)
-#endif
-
-/* Archs may use other ways for ADDR1 and beyond */
-#ifndef ftrace_return_address
-# ifdef CONFIG_FRAME_POINTER
-#  define ftrace_return_address(n) __builtin_return_address(n)
-# else
-#  define ftrace_return_address(n) 0UL
-# endif
-#endif
-
-#define CALLER_ADDR0 ((unsigned long)ftrace_return_address0)
-#define CALLER_ADDR1 ((unsigned long)ftrace_return_address(1))
-#define CALLER_ADDR2 ((unsigned long)ftrace_return_address(2))
-#define CALLER_ADDR3 ((unsigned long)ftrace_return_address(3))
-#define CALLER_ADDR4 ((unsigned long)ftrace_return_address(4))
-#define CALLER_ADDR5 ((unsigned long)ftrace_return_address(5))
-#define CALLER_ADDR6 ((unsigned long)ftrace_return_address(6))
-
 #ifdef CONFIG_IRQSOFF_TRACER
   extern void time_hardirqs_on(unsigned long a0, unsigned long a1);
   extern void time_hardirqs_off(unsigned long a0, unsigned long a1);
diff --git a/include/linux/ftrace_caller.h b/include/linux/ftrace_caller.h
new file mode 100644
index 000000000000..887a7c220cd6
--- /dev/null
+++ b/include/linux/ftrace_caller.h
@@ -0,0 +1,28 @@
+#ifndef _LINUX_FTRACE_CALLER_H
+#define _LINUX_FTRACE_CALLER_H
+
+#include <asm/ftrace.h>
+
+/* All archs should have this, but we define it for consistency */
+#ifndef ftrace_return_address0
+# define ftrace_return_address0		__builtin_return_address(0)
+#endif
+
+/* Archs may use other ways for ADDR1 and beyond */
+#ifndef ftrace_return_address
+# ifdef CONFIG_FRAME_POINTER
+#  define ftrace_return_address(n)	__builtin_return_address(n)
+# else
+#  define ftrace_return_address(n)	0UL
+# endif
+#endif
+
+#define CALLER_ADDR0 ((unsigned long)ftrace_return_address0)
+#define CALLER_ADDR1 ((unsigned long)ftrace_return_address(1))
+#define CALLER_ADDR2 ((unsigned long)ftrace_return_address(2))
+#define CALLER_ADDR3 ((unsigned long)ftrace_return_address(3))
+#define CALLER_ADDR4 ((unsigned long)ftrace_return_address(4))
+#define CALLER_ADDR5 ((unsigned long)ftrace_return_address(5))
+#define CALLER_ADDR6 ((unsigned long)ftrace_return_address(6))
+
+#endif
-- 
2.7.0

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

end of thread, other threads:[~2016-02-12 16:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-11 23:21 [PATCH 1/2] ftrace: move the CALLER_ADDRx macros into its own header Sebastian Andrzej Siewior
2016-02-11 23:21 ` [PATCH 2/2] kernel: sched: fix preempt_disable_ip recodring for preempt_disable() Sebastian Andrzej Siewior
2016-02-11 23:22   ` Sebastian Andrzej Siewior
2016-02-12  0:27   ` kbuild test robot
2016-02-12  0:45     ` Steven Rostedt
2016-02-12 15:21       ` Sebastian Andrzej Siewior
2016-02-12 16:27         ` Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.