linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Changbin Du <changbin.du@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fgraph: Remove redundant ftrace_graph_notrace_addr() test
Date: Tue, 30 Jul 2019 12:15:27 -0400	[thread overview]
Message-ID: <20190730121527.13f600f5@gandalf.local.home> (raw)
In-Reply-To: <20190730140850.7927-1-changbin.du@gmail.com>

On Tue, 30 Jul 2019 22:08:50 +0800
Changbin Du <changbin.du@gmail.com> wrote:

> We already have tested it before. The second one should be removed.
> With this change, the performance should have little improvement.
> 
> Fixes: 9cd2992f2d6c ("fgraph: Have set_graph_notrace only affect function_graph tracer")

Thanks! I think this should even be marked for stable. Not really a bad
bug, but a bug none the less.

-- Steve


> Signed-off-by: Changbin Du <changbin.du@gmail.com>
> ---
>  kernel/trace/trace_functions_graph.c | 17 +++++++----------
>  1 file changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
> index 69ebf3c2f1b5..78af97163147 100644
> --- a/kernel/trace/trace_functions_graph.c
> +++ b/kernel/trace/trace_functions_graph.c
> @@ -137,6 +137,13 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)
>  	if (trace_recursion_test(TRACE_GRAPH_NOTRACE_BIT))
>  		return 0;
>  
> +	/*
> +	 * Do not trace a function if it's filtered by set_graph_notrace.
> +	 * Make the index of ret stack negative to indicate that it should
> +	 * ignore further functions.  But it needs its own ret stack entry
> +	 * to recover the original index in order to continue tracing after
> +	 * returning from the function.
> +	 */
>  	if (ftrace_graph_notrace_addr(trace->func)) {
>  		trace_recursion_set(TRACE_GRAPH_NOTRACE_BIT);
>  		/*
> @@ -155,16 +162,6 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)
>  	if (ftrace_graph_ignore_irqs())
>  		return 0;
>  
> -	/*
> -	 * Do not trace a function if it's filtered by set_graph_notrace.
> -	 * Make the index of ret stack negative to indicate that it should
> -	 * ignore further functions.  But it needs its own ret stack entry
> -	 * to recover the original index in order to continue tracing after
> -	 * returning from the function.
> -	 */
> -	if (ftrace_graph_notrace_addr(trace->func))
> -		return 1;
> -
>  	/*
>  	 * Stop here if tracing_threshold is set. We only write function return
>  	 * events to the ring buffer.


  reply	other threads:[~2019-07-30 16:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 14:08 [PATCH] fgraph: Remove redundant ftrace_graph_notrace_addr() test Changbin Du
2019-07-30 16:15 ` Steven Rostedt [this message]
2019-07-31 10:31   ` Changbin Du
2019-07-31 11:58     ` 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=20190730121527.13f600f5@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=changbin.du@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).