lkml.org 
[lkml]   [2015]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH/RFC 2/3] ftrace: introduce nohotpatch function attribute
On Mon, 26 Jan 2015 13:54:53 +0100
Heiko Carstens <heiko.carstens@de.ibm.com> wrote:

> gcc supports an s390 specific function attribute called "hotpatch".
> It can be used to specify the number of halfwords that shall be added before
> and after a function that shall be filled with nops for runtime patching.
>
> s390 will use the hotpatch attribute for function tracing, therefore
> introduce a nohotpatch define, depending on CC_USING_HOTPATCH, and add it
> to the existing notrace define.

Are the two mutually exclusive? That is, can you have -pg and hotpatch
together? Reason why I ask is, if you have either -pg or hotpatch, then
we only need "no_instrument_function" or "hotpatch" in the notrace
define, not both. But I could be wrong.

-- Steve

>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> ---
> include/linux/compiler.h | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/compiler.h b/include/linux/compiler.h
> index b4fd7013c9f4..b4ab98e0e10b 100644
> --- a/include/linux/compiler.h
> +++ b/include/linux/compiler.h
> @@ -54,7 +54,13 @@ extern void __chk_io_ptr(const volatile void __iomem *);
> #include <linux/compiler-gcc.h>
> #endif
>
> -#define notrace __attribute__((no_instrument_function))
> +#ifdef CC_USING_HOTPATCH
> +#define nohotpatch __attribute__((hotpatch(0,0)))
> +#else
> +#define nohotpatch
> +#endif
> +
> +#define notrace __attribute__((no_instrument_function)) nohotpatch
>
> /* Intel compiler defines __GNUC__. So we will overwrite implementations
> * coming from above header files here



\
 
 \ /
  Last update: 2015-01-26 16:01    [W:0.116 / U:0.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site