mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
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>
This commit is contained in:
parent
c6f28ed507
commit
92eecfff32
10 changed files with 24 additions and 49 deletions
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue