diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2015-02-12 23:08:32 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2015-02-12 23:08:32 -0500 |
commit | 02c326f441360549311698af9f1b3edb543ce514 (patch) | |
tree | df361f88356e0658542e6506f1db4e30d156a0c7 | |
parent | 91367555e9be5bcab35c8403c1ebd28ef2620134 (diff) | |
download | trace-cmd-02c326f441360549311698af9f1b3edb543ce514.tar.gz |
trace-cmd profile: Fix hook saving from record to report
There was a bug when after a hook was read from the trace.dat file
it would be reset by the handle->hooks instead of assigning it to
the handle->hooks.
There was a second bug where the hooks in trace.dat file would
not be listed if there were no command line hooks presented.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-input.c | 2 | ||||
-rw-r--r-- | trace-read.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/trace-input.c b/trace-input.c index 4352287e..92eba45c 100644 --- a/trace-input.c +++ b/trace-input.c @@ -1996,7 +1996,7 @@ static int handle_options(struct tracecmd_input *handle) break; case TRACECMD_OPTION_HOOK: hook = tracecmd_create_event_hook(buf); - hook = handle->hooks; + hook->next = handle->hooks; handle->hooks = hook; break; default: diff --git a/trace-read.c b/trace-read.c index f3e47982..17636a7c 100644 --- a/trace-read.c +++ b/trace-read.c @@ -1065,6 +1065,8 @@ static void read_data_info(struct list_head *handle_list, enum output_type otype init_wakeup(handles->handle); if (last_hook) last_hook->next = tracecmd_hooks(handles->handle); + else + hooks = tracecmd_hooks(handles->handle); trace_init_profile(handles->handle, hooks, global); process_filters(handles); |