* [PATCH] tracing: only allow -trace to override -D if set
@ 2020-02-11 11:10 Alex Bennée
2020-02-12 15:34 ` Stefan Hajnoczi
2020-02-24 18:14 ` Laurent Vivier
0 siblings, 2 replies; 5+ messages in thread
From: Alex Bennée @ 2020-02-11 11:10 UTC (permalink / raw)
To: qemu-devel; +Cc: Alex Bennée, Stefan Hajnoczi
Otherwise any -D settings the user may have made get ignored.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
trace/control.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/trace/control.c b/trace/control.c
index 6c775e68eba..2ffe0008184 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -226,10 +226,15 @@ void trace_init_file(const char *file)
#ifdef CONFIG_TRACE_SIMPLE
st_set_trace_file(file);
#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.
+ /*
+ * 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=...: "
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] tracing: only allow -trace to override -D if set
2020-02-11 11:10 [PATCH] tracing: only allow -trace to override -D if set Alex Bennée
@ 2020-02-12 15:34 ` Stefan Hajnoczi
2020-02-12 22:31 ` Philippe Mathieu-Daudé
2020-02-24 18:14 ` Laurent Vivier
1 sibling, 1 reply; 5+ messages in thread
From: Stefan Hajnoczi @ 2020-02-12 15:34 UTC (permalink / raw)
To: Alex Bennée; +Cc: qemu-devel, Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 381 bytes --]
On Tue, Feb 11, 2020 at 11:10:54AM +0000, Alex Bennée wrote:
> Otherwise any -D settings the user may have made get ignored.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tracing: only allow -trace to override -D if set
2020-02-12 15:34 ` Stefan Hajnoczi
@ 2020-02-12 22:31 ` Philippe Mathieu-Daudé
2020-02-13 13:45 ` Stefan Hajnoczi
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-12 22:31 UTC (permalink / raw)
To: Stefan Hajnoczi, Alex Bennée; +Cc: qemu-devel, Stefan Hajnoczi
On 2/12/20 4:34 PM, Stefan Hajnoczi wrote:
> On Tue, Feb 11, 2020 at 11:10:54AM +0000, Alex Bennée wrote:
>> Otherwise any -D settings the user may have made get ignored.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> ---
>> 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'.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tracing: only allow -trace to override -D if set
2020-02-12 22:31 ` Philippe Mathieu-Daudé
@ 2020-02-13 13:45 ` Stefan Hajnoczi
0 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2020-02-13 13:45 UTC (permalink / raw)
To: Philippe Mathieu-Daudé; +Cc: Stefan Hajnoczi, Alex Bennée, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 602 bytes --]
On Wed, Feb 12, 2020 at 11:31:00PM +0100, Philippe Mathieu-Daudé wrote:
> On 2/12/20 4:34 PM, Stefan Hajnoczi wrote:
> > On Tue, Feb 11, 2020 at 11:10:54AM +0000, Alex Bennée wrote:
> > > Otherwise any -D settings the user may have made get ignored.
> > >
> > > Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> > > ---
> > > 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'.
Done!
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tracing: only allow -trace to override -D if set
2020-02-11 11:10 [PATCH] tracing: only allow -trace to override -D if set Alex Bennée
2020-02-12 15:34 ` Stefan Hajnoczi
@ 2020-02-24 18:14 ` Laurent Vivier
1 sibling, 0 replies; 5+ messages in thread
From: Laurent Vivier @ 2020-02-24 18:14 UTC (permalink / raw)
To: Alex Bennée, qemu-devel; +Cc: Stefan Hajnoczi
On 11/02/2020 12:10, Alex Bennée wrote:
> Otherwise any -D settings the user may have made get ignored.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
> trace/control.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/trace/control.c b/trace/control.c
> index 6c775e68eba..2ffe0008184 100644
> --- a/trace/control.c
> +++ b/trace/control.c
> @@ -226,10 +226,15 @@ void trace_init_file(const char *file)
> #ifdef CONFIG_TRACE_SIMPLE
> st_set_trace_file(file);
> #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.
> + /*
> + * 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=...: "
>
Tested-by: Laurent Vivier <laurent@vivier.eu>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-02-24 18:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 11:10 [PATCH] tracing: only allow -trace to override -D if set Alex Bennée
2020-02-12 15:34 ` Stefan Hajnoczi
2020-02-12 22:31 ` Philippe Mathieu-Daudé
2020-02-13 13:45 ` Stefan Hajnoczi
2020-02-24 18:14 ` Laurent Vivier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).