Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1401717

Re: [PATCH] ftrace/x86: Fix function graph tracer reset path

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject Re: [PATCH] ftrace/x86: Fix function graph tracer reset path
Date 2016-05-16 21:20 +0200
Message-ID <rzwdz-2AX-9@gated-at.bofh.it> (permalink)
References (3 earlier) <rzpYt-74T-5@gated-at.bofh.it> <rzpYt-74T-3@gated-at.bofh.it> <rzrdT-7Kg-17@gated-at.bofh.it> <rzrGX-892-31@gated-at.bofh.it> <rzw3U-2xP-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 16 May 2016 21:03:59 +0200
Borislav Petkov <bp@suse.de> wrote:

> On Mon, May 16, 2016 at 11:24:53PM +0900, Namhyung Kim wrote:
> > > -GLOBAL(ftrace_stub)
> > > +/* This is weak to keep gas from relaxing the jumps */
> > > +WEAK(ftrace_stub)
> > >  	retq
> > >  END(ftrace_caller)  
> 
> You could also force the 5-byte jump. I guess you could also write
> simply ".long 0" in there but this way it is more robust if someone
> decides to add other stuff between the JMP and the ftrace_stub label.
> 
> ---
> diff --git a/arch/x86/kernel/mcount_64.S b/arch/x86/kernel/mcount_64.S
> index ed48a9f465f8..b1db8a584c06 100644
> --- a/arch/x86/kernel/mcount_64.S
> +++ b/arch/x86/kernel/mcount_64.S
> @@ -179,7 +179,9 @@ GLOBAL(ftrace_epilogue)
>  
>  #ifdef CONFIG_FUNCTION_GRAPH_TRACER
>  GLOBAL(ftrace_graph_call)
> -	jmp ftrace_stub
> +	.byte 0xe9
> +	.long ftrace_stub - 1f
> +1:
>  #endif
>  

I actually thought about this first, but I thought it rather a hack
(although one could argue all of function tracing is a hack ;-) But as
the "weak" call was used to fix one location, why not use it here too.
Being consistent, and also making sure all calls to ftrace_stub do the
same.

-- Steve

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] ftrace/x86: Fix function graph tracer reset path Namhyung Kim <namhyung@kernel.org> - 2016-05-13 16:00 +0200
  Re: [PATCH] ftrace/x86: Fix function graph tracer reset path Steven Rostedt <rostedt@goodmis.org> - 2016-05-13 16:10 +0200
    Re: [PATCH] ftrace/x86: Fix function graph tracer reset path Matt Fleming <matt@codeblueprint.co.uk> - 2016-05-16 04:10 +0200
  Re: [PATCH] ftrace/x86: Fix function graph tracer reset path Namhyung Kim <namhyung@kernel.org> - 2016-05-16 04:10 +0200
    Re: [PATCH] ftrace/x86: Fix function graph tracer reset path Namhyung Kim <namhyung@kernel.org> - 2016-05-16 14:40 +0200
      Re: [PATCH] ftrace/x86: Fix function graph tracer reset path Steven Rostedt <rostedt@goodmis.org> - 2016-05-16 16:00 +0200
        Re: [PATCH] ftrace/x86: Fix function graph tracer reset path Namhyung Kim <namhyung@kernel.org> - 2016-05-16 16:30 +0200
          Re: [PATCH] ftrace/x86: Fix function graph tracer reset path Borislav Petkov <bp@suse.de> - 2016-05-16 21:10 +0200
            Re: [PATCH] ftrace/x86: Fix function graph tracer reset path Borislav Petkov <bp@suse.de> - 2016-05-16 21:20 +0200
              Re: [PATCH] ftrace/x86: Fix function graph tracer reset path Steven Rostedt <rostedt@goodmis.org> - 2016-05-16 21:30 +0200
            Re: [PATCH] ftrace/x86: Fix function graph tracer reset path Steven Rostedt <rostedt@goodmis.org> - 2016-05-16 21:20 +0200
        Re: [PATCH] ftrace/x86: Fix function graph tracer reset path Matt Fleming <matt@codeblueprint.co.uk> - 2016-05-16 22:00 +0200
        Re: [PATCH] ftrace/x86: Fix function graph tracer reset path Masami Hiramatsu <mhiramat@kernel.org> - 2016-05-17 00:10 +0200
  Re: [PATCH] ftrace/x86: Fix function graph tracer reset path Masami Hiramatsu <mhiramat@kernel.org> - 2016-05-16 04:10 +0200

csiph-web