From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750904AbcBKXVW (ORCPT ); Thu, 11 Feb 2016 18:21:22 -0500 Received: from www.linutronix.de ([62.245.132.108]:59183 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750752AbcBKXVV (ORCPT ); Thu, 11 Feb 2016 18:21:21 -0500 From: Sebastian Andrzej Siewior To: Steven Rostedt Cc: Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org, Sebastian Andrzej Siewior Subject: [PATCH 1/2] ftrace: move the CALLER_ADDRx macros into its own header Date: Fri, 12 Feb 2016 00:21:06 +0100 Message-Id: <1455232867-29059-1-git-send-email-bigeasy@linutronix.de> X-Mailer: git-send-email 2.7.0 X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 #include #include - -#include +#include /* * 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 + +/* 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