diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2015-06-10 15:04:35 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2015-06-10 15:04:35 -0400 |
commit | f3d17ce138e023a6cb5bc0a18c4d2821f7439298 (patch) | |
tree | e696f7eea71a9f092e9851465a82832add33908c | |
parent | 767ec135c4a17548b985967db4c89b33bf4f33a5 (diff) | |
download | trace-cmd-f3d17ce138e023a6cb5bc0a18c4d2821f7439298.tar.gz |
trace-cmd: Fix stop, reset, start and stat for default instances
The fix to fix stop, restart, and start, broke them too for the default
instance. If -t or -B were not used, then -t is to be assumed, but
that was not the case, and no instance was selected.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-local.h | 1 | ||||
-rw-r--r-- | trace-record.c | 12 | ||||
-rw-r--r-- | trace-stat.c | 3 |
3 files changed, 9 insertions, 7 deletions
diff --git a/trace-local.h b/trace-local.h index ab2bd347..cbdac8e0 100644 --- a/trace-local.h +++ b/trace-local.h @@ -179,6 +179,7 @@ extern struct buffer_instance *first_instance; struct buffer_instance *create_instance(char *name); void add_instance(struct buffer_instance *instance); char *get_instance_file(struct buffer_instance *instance, const char *file); +void update_first_instance(struct buffer_instance *instance, int topt); void show_instance_file(struct buffer_instance *instance, const char *name); int count_cpus(void); diff --git a/trace-record.c b/trace-record.c index a0a6728a..6f514f3b 100644 --- a/trace-record.c +++ b/trace-record.c @@ -3704,9 +3704,9 @@ static void add_hook(struct buffer_instance *instance, const char *arg) } } -static void update_first_instance(int topt) +void update_first_instance(struct buffer_instance *instance, int topt) { - if (topt) + if (topt || instance == &top_instance) first_instance = &top_instance; else first_instance = buffer_instances; @@ -3791,7 +3791,7 @@ void trace_record (int argc, char **argv) } } - update_first_instance(topt); + update_first_instance(instance, topt); disable_tracing(); exit(0); } else if (strcmp(argv[1], "restart") == 0) { @@ -3819,7 +3819,7 @@ void trace_record (int argc, char **argv) } } - update_first_instance(topt); + update_first_instance(instance, topt); enable_tracing(); exit(0); } else if (strcmp(argv[1], "reset") == 0) { @@ -3850,7 +3850,7 @@ void trace_record (int argc, char **argv) break; } } - update_first_instance(topt); + update_first_instance(instance, topt); disable_all(1); set_buffer_size(); clear_filters(); @@ -4137,7 +4137,7 @@ void trace_record (int argc, char **argv) } else topt = 1; - update_first_instance(topt); + update_first_instance(instance, topt); if (!extract) check_doing_something(); diff --git a/trace-stat.c b/trace-stat.c index 6c387190..cc941a38 100644 --- a/trace-stat.c +++ b/trace-stat.c @@ -905,13 +905,14 @@ void trace_stat (int argc, char **argv) /* Force to use top instance */ topt = 1; instance = &top_instance; - first_instance = instance; break; default: usage(argv); } } + update_first_instance(instance, topt); + for_all_instances(instance) { stat_instance(instance); } |