Since trace_opt_parse() deletes, this always creates an empty one.
const char *file = qemu_opt_get(opts, "file");
This is always null.
#ifdef CONFIG_TRACE_SIMPLE
st_set_trace_file(file);
if (init_trace_on_startup) {
st_set_trace_file_enabled(true);
}
#elif defined CONFIG_TRACE_LOG
/*
* If both the simple and the log backends are enabled, "--trace file"
* only applies to the simple backend; use "-D" for the log
* backend. However we should only override -D if we actually have
* something to override it with.
*/
if (file) {
qemu_set_log_filename(file, &error_fatal);
}
#else
if (file) {
fprintf(stderr, "error: --trace file=...: "
"option not supported by the selected tracing backends\n");
exit(1);
}
#endif
}
Bug: option parameter "file" has no effect. I suspect this was broken
in commit 92eecfff32 "trace: remove argument from trace_init_file",
2020-11-11.