qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tracing: only allow -trace to override -D if set


From: Laurent Vivier
Subject: Re: [PATCH] tracing: only allow -trace to override -D if set
Date: Mon, 24 Feb 2020 19:14:02 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

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 <address@hidden>
> ---
>  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 <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]