mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Stanislav Fomichev <stfomichev@yandex-team.ru>
Cc: fweisbec@gmail.com, mingo@redhat.com, jovi.zhangwei@huawei.com,
	namhyung.kim@lge.com, tom.zanussi@linux.intel.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing: let user specify tracing_thresh after selecting function_graph
Date: Tue, 3 Jun 2014 18:57:20 -0400	[thread overview]
Message-ID: <20140603185720.79552fb8@gandalf.local.home> (raw)
In-Reply-To: <1401815569-10513-1-git-send-email-stfomichev@yandex-team.ru>

On Tue,  3 Jun 2014 21:12:49 +0400
Stanislav Fomichev <stfomichev@yandex-team.ru> wrote:

> Currently, tracing_thresh works only if we specify it before selecting
> function_graph tracer. If we do the opposite, tracing_thresh will change
> it's value, but it will not be applied.
> To fix it, we need to always register handlers which take tracing_thresh into
> account.
> 
> Signed-off-by: Stanislav Fomichev <stfomichev@yandex-team.ru>
> ---
>  kernel/trace/trace_functions_graph.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
> index deff11200261..a894031986a3 100644
> --- a/kernel/trace/trace_functions_graph.c
> +++ b/kernel/trace/trace_functions_graph.c
> @@ -433,12 +433,8 @@ static int graph_trace_init(struct trace_array *tr)
>  	int ret;
>  
>  	set_graph_array(tr);
> -	if (tracing_thresh)
> -		ret = register_ftrace_graph(&trace_graph_thresh_return,
> -					    &trace_graph_thresh_entry);
> -	else
> -		ret = register_ftrace_graph(&trace_graph_return,
> -					    &trace_graph_entry);
> +	ret = register_ftrace_graph(&trace_graph_thresh_return,
> +				    &trace_graph_thresh_entry);
>  	if (ret)
>  		return ret;
>  	tracing_start_cmdline_record();

I would rather not endure the overhead of checking tracing_thresh
every time. I never use it, I didn't even know there was someone that
did ;-)

I'm not saying you can't fix this bug, I'm just saying that it
shouldn't be done this way.

Ideally there should be a callback for the tracer to deal with it, but
instead, you can for now just hardcode a function graph tracer callback
into tracing_max_lat_write(). Something like this:

	if (ptr == &tracing_thresh)
		ftrace_update_func_graph_thresh();

And then if the function tracer is active, stop it, and then restart it
with the tracing thresh function.

-- Steve

  reply	other threads:[~2014-06-03 22:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-03 17:12 Stanislav Fomichev
2014-06-03 22:57 ` Steven Rostedt [this message]
2014-06-04 13:33   ` [PATCHv2] " Stanislav Fomichev
2014-06-04 19:41     ` Steven Rostedt
2014-06-05  7:38       ` Stanislav Fomichev
2014-07-15  9:27         ` Stanislav Fomichev
2014-07-15 13:04           ` Steven Rostedt
2014-07-15 15:31             ` [PATCHv3] " Stanislav Fomichev
2014-07-17 18:08               ` Steven Rostedt
2014-07-18 11:17                 ` [PATCHv4] " Stanislav Fomichev

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=20140603185720.79552fb8@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=fweisbec@gmail.com \
    --cc=jovi.zhangwei@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung.kim@lge.com \
    --cc=stfomichev@yandex-team.ru \
    --cc=tom.zanussi@linux.intel.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

all inboxes | Powered by JetHome®