diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-11-02 06:58:41 -0500 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2020-11-11 13:08:09 +0000 |
commit | 92eecfff32763ee138f4cebc1a12c5b051ad5bb5 (patch) | |
tree | 3b74701f9b1b6301b6e0a972eb7cc6bba22ad823 /trace | |
parent | c6f28ed5075df79fef39c500362a3f4089256c9c (diff) |
trace: remove argument from trace_init_file
It is not needed, all the callers are just saving what was
retrieved from -trace and trace_init_file can retrieve it
on its own.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20201102115841.4017692-1-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'trace')
-rw-r--r-- | trace/control.c | 10 | ||||
-rw-r--r-- | trace/control.h | 12 |
2 files changed, 7 insertions, 15 deletions
diff --git a/trace/control.c b/trace/control.c index 5669db7eea..b82fb87316 100644 --- a/trace/control.c +++ b/trace/control.c @@ -222,8 +222,10 @@ static void trace_init_events(const char *fname) loc_pop(&loc); } -void trace_init_file(const char *file) +void trace_init_file(void) { + QemuOpts *opts = qemu_find_opts_singleton("trace"); + const char *file = qemu_opt_get(opts, "file"); #ifdef CONFIG_TRACE_SIMPLE st_set_trace_file(file); if (init_trace_on_startup) { @@ -289,9 +291,8 @@ bool trace_init_backends(void) return true; } -char *trace_opt_parse(const char *optarg) +void trace_opt_parse(const char *optarg) { - char *trace_file; QemuOpts *opts = qemu_opts_parse_noisily(qemu_find_opts("trace"), optarg, true); if (!opts) { @@ -301,11 +302,8 @@ char *trace_opt_parse(const char *optarg) trace_enable_events(qemu_opt_get(opts, "enable")); } trace_init_events(qemu_opt_get(opts, "events")); - trace_file = g_strdup(qemu_opt_get(opts, "file")); init_trace_on_startup = true; qemu_opts_del(opts); - - return trace_file; } uint32_t trace_get_vcpu_event_count(void) diff --git a/trace/control.h b/trace/control.h index 1f81c491b6..05b95ea453 100644 --- a/trace/control.h +++ b/trace/control.h @@ -167,8 +167,6 @@ void trace_event_set_vcpu_state_dynamic(CPUState *vcpu, /** * trace_init_backends: - * @file: Name of trace output file; may be NULL. - * Corresponds to commandline option "--trace file=...". * * Initialize the tracing backend. * @@ -178,14 +176,12 @@ bool trace_init_backends(void); /** * trace_init_file: - * @file: Name of trace output file; may be NULL. - * Corresponds to commandline option "--trace file=...". * * Record the name of the output file for the tracing backend. * Exits if no selected backend does not support specifying the - * output file, and a non-NULL file was passed. + * output file, and a file was specified with "-trace file=...". */ -void trace_init_file(const char *file); +void trace_init_file(void); /** * trace_init_vcpu: @@ -229,10 +225,8 @@ extern QemuOptsList qemu_trace_opts; * @optarg: A string argument of --trace command line argument * * Initialize tracing subsystem. - * - * Returns the filename to save trace to. It must be freed with g_free(). */ -char *trace_opt_parse(const char *optarg); +void trace_opt_parse(const char *optarg); /** * trace_get_vcpu_event_count: |