From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: [PATCH 1/2] ftrace: move the CALLER_ADDRx macros into its own header
Date: Fri, 12 Feb 2016 00:21:06 +0100 [thread overview]
Message-ID: <1455232867-29059-1-git-send-email-bigeasy@linutronix.de> (raw)
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
next reply other threads:[~2016-02-11 23:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-11 23:21 Sebastian Andrzej Siewior [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455232867-29059-1-git-send-email-bigeasy@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®