linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: "linux-trace-devel@vger.kernel.org"  <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH 5/5] fix "trace-cmd reset" command to restore the default value of tracing_max_latency
Date: Tue, 5 Mar 2019 14:06:09 -0500	[thread overview]
Message-ID: <20190305140609.3000ed5a@gandalf.local.home> (raw)
In-Reply-To: <20181213142125.12149-6-tstoyanov@vmware.com>

On Thu, 13 Dec 2018 14:21:44 +0000
Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:

> The "trace-cmd reset" command should restore ftrace to its default state.
> This patch sets "tracing/tracing_max_latency" to 0,
> when the "trace-cmd reset" command is executed.
> 
> Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
> ---
>  tracecmd/trace-record.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
> index f77e49a..a9bcd8d 100644
> --- a/tracecmd/trace-record.c
> +++ b/tracecmd/trace-record.c
> @@ -3769,6 +3769,14 @@ static void reset_event_pid(void)
>  		write_instance_file(instance, "set_event_pid", "", "event_pid");
>  }
>  
> +static void reset_max_latency_instance(void)
> +{
> +	struct buffer_instance *instance;
> +
> +	for_all_instances(instance)
> +		write_instance_file(instance,
> +				    "tracing_max_latency", "0", "max_latency");
> +}

We should fix reset_max_latency() use write_instance_file, and then
make a reset_max_latency_instance() to call it on all instance.

-- Steve

>  
>  static void clear_triggers(void)
>  {
> @@ -4474,6 +4482,7 @@ void trace_reset(int argc, char **argv)
>  	/* set clock to "local" */
>  	reset_clock();
>  	reset_event_pid();
> +	reset_max_latency_instance();
>  	tracecmd_remove_instances();
>  	clear_func_filters();
>  	/* restore tracing_on to 1 */


  reply	other threads:[~2019-03-05 19:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13 14:21 [PATCH 0/5] trace-cmd reset fixes Tzvetomir Stoyanov
2018-12-13 14:21 ` [PATCH 1/5] fix "trace-cmd reset" command to restore "tracng_on" Tzvetomir Stoyanov
2018-12-13 14:21 ` [PATCH 2/5] fix "trace-cmd reset -a -d" segfault Tzvetomir Stoyanov
2018-12-13 14:21 ` [PATCH 3/5] fix "trace-cmd reset" command to restore default clock Tzvetomir Stoyanov
2018-12-13 14:21 ` [PATCH 4/5] fix "trace-cmd reset" command to restore the default value of set_event_pid Tzvetomir Stoyanov
2019-03-05 19:03   ` Steven Rostedt
2018-12-13 14:21 ` [PATCH 5/5] fix "trace-cmd reset" command to restore the default value of tracing_max_latency Tzvetomir Stoyanov
2019-03-05 19:06   ` Steven Rostedt [this message]
2019-03-05 13:24 ` [PATCH 0/5] trace-cmd reset fixes Slavomir Kaslev

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=20190305140609.3000ed5a@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=tstoyanov@vmware.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).