tracing: only allow -trace to override -D if set
PATCH 1/1 tracing: only allow -trace to override -D if set
Otherwise any -D settings the user may have made get ignored.
--- trace/control.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
trace/control.c +8 -3
@@ -226,10 +226,15 @@ void trace_init_file(const char *file)#ifdef CONFIG_TRACE_SIMPLE st_set_trace_file (file);#elif definedCONFIG_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. +/* +* 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. */ -qemu_set_log_filename (file, &error_fatal); +if (file) { +qemu_set_log_filename (file, &error_fatal); + }#else if (file) { fprintf(stderr, "error: --trace file=...: "
Signature · 1 line
2.20.1
Stefan Hajnoczi
AppliedQuoted 6 lines · Alex Bennée
Otherwise any -D settings the user may have made get ignored.
Signed-off-by Alex Bennée <[email protected]>--- trace/control.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
Thanks, applied to my tracing tree:
https://github.com/stefanha/qemu/commits/tracing
Stefan
Quoted 10 lines · Stefan Hajnoczi
Quoted 6 lines · Alex Bennée
Otherwise any -D settings the user may have made get ignored.
Signed-off-by Alex Bennée <[email protected]>--- trace/control.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)Thanks, applied to my tracing tree:
https://github.com/stefanha/qemu/commits/tracing
If possible, please add 'Fixes: e144a605a'.
Quoted 9 lines · Philippe Mathieu-Daudé
Quoted 8 lines · Stefan Hajnoczi
Quoted 6 lines · Alex Bennée
Otherwise any -D settings the user may have made get ignored.
Signed-off-by Alex Bennée <[email protected]>--- trace/control.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
Quoted 4 lines
Quoted 2 lines
Thanks, applied to my tracing tree:
https://github.com/stefanha/qemu/commits/tracingIf possible, please add 'Fixes:
e144a605a'.
Done!
Stefan
Quoted 21 lines · Alex Bennée
Otherwise any -D settings the user may have made get ignored.
Signed-off-by Alex Bennée <[email protected]>--- trace/control.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)trace/control.c +3
-2@@ -226,10 +226,15 @@ void trace_init_file(const char *file)#ifdef CONFIG_TRACE_SIMPLE st_set_trace_file (file);#elif definedCONFIG_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. +/* +* If both the simple and the log backends are enabled, "--trace file" +* only applies to the simple backend; use "-D" for the log
trace/control.c void trace_init_file(const char *file) · line 240
Quoted 10 lines
trace/control.c +5
-1+* backend. However we should only override -D if we actually have +* something to override it with. */ -qemu_set_log_filename (file, &error_fatal); +if (file) { +qemu_set_log_filename (file, &error_fatal); + }#else if (file) { fprintf(stderr, "error: --trace file=...: "