mbox series

[v4,0/6] trace-cmd reset fixes

Message ID 20190311083339.21581-1-tstoyanov@vmware.com (mailing list archive)
Headers show
Series trace-cmd reset fixes | expand

Message

Tzvetomir Stoyanov March 11, 2019, 8:33 a.m. UTC
[
 V4 changes:
   - An extra patch was inluded in v3 (not realeted to trace-cmd reset fixes), by mistake.
 V3 changes:
   - Refactored reset_max_latency() and reset_max_latency_instance(),
     as Steven Rostedt suggested.
 V2 changes:
   - Fixed subjects of the patches.
   - Refactored add_event_pid() and reset_event_pid(), 
     as Steven Rostedt suggested.
]

This patch series fixes "trace-cmd reset" command to 
restore default values of various ftrace configurations:
tracng_on, trace_clock, set_event_pid and tracing_max_latency.
It also fixes a segfault when the command is executed with 
"-a -d" options.

Tzvetomir Stoyanov (6):
  trace-cmd: Fix "trace-cmd reset" command to restore "tracng_on"
  trace-cmd: Fix "trace-cmd reset -a -d" segfault
  trace-cmd: Fix "trace-cmd reset" command to restore default clock
  trace-cmd: Reafctored add_event_pid()to utilize write_instance_file()
  trace-cmd: Fix "trace-cmd reset" command to restore the default value
    of set_event_pid
  trace-cmd: Reafctored reset_max_latency() to utilize
    write_instance_file()

 tracecmd/trace-record.c | 137 ++++++++++++++++++++++------------------
 1 file changed, 75 insertions(+), 62 deletions(-)

Comments

Slavomir Kaslev March 11, 2019, 1:02 p.m. UTC | #1
On Mon, Mar 11, 2019 at 10:33 AM Tzvetomir Stoyanov
<tstoyanov@vmware.com> wrote:
>
> [
>  V4 changes:
>    - An extra patch was inluded in v3 (not realeted to trace-cmd reset fixes), by mistake.
>  V3 changes:
>    - Refactored reset_max_latency() and reset_max_latency_instance(),
>      as Steven Rostedt suggested.
>  V2 changes:
>    - Fixed subjects of the patches.
>    - Refactored add_event_pid() and reset_event_pid(),
>      as Steven Rostedt suggested.
> ]
>
> This patch series fixes "trace-cmd reset" command to
> restore default values of various ftrace configurations:
> tracng_on, trace_clock, set_event_pid and tracing_max_latency.
> It also fixes a segfault when the command is executed with
> "-a -d" options.
>
> Tzvetomir Stoyanov (6):
>   trace-cmd: Fix "trace-cmd reset" command to restore "tracng_on"
>   trace-cmd: Fix "trace-cmd reset -a -d" segfault
>   trace-cmd: Fix "trace-cmd reset" command to restore default clock
>   trace-cmd: Reafctored add_event_pid()to utilize write_instance_file()
>   trace-cmd: Fix "trace-cmd reset" command to restore the default value
>     of set_event_pid
>   trace-cmd: Reafctored reset_max_latency() to utilize
>     write_instance_file()
>
>  tracecmd/trace-record.c | 137 ++++++++++++++++++++++------------------
>  1 file changed, 75 insertions(+), 62 deletions(-)
>
> --
> 2.20.1
>

Nit: write_file() and write_instance_file() are moved twice in patches
4 and 6. Moving them once in its new place in trace-record.c would
have made the patchset smaller and easier to review.

With that said, all patches looks good to me.

Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>

Thanks!