[CRIU] [PATCH] early-log: Print warnings only if the buffer is full

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Tue Oct 1 10:27:17 MSK 2019


Reviewed-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>

On 10/1/19 2:29 AM, Dmitry Safonov wrote:
> I don't see many issues with early-log, so we probably don't
> need the warning when it was used. Note that after
> commit 74731d9 ("zdtm: make grep_errors also grep warnings")
> also warnings are grepped by zdtm.py (and I believe that was
> an improvement) which prints some bothering lines:
> 
>> =[log]=> dump/zdtm/static/inotify00/38/1/dump.log
>> ------------------------ grep Error ------------------------
>> (00.000000) Will allow link remaps on FS
>> (00.000034) Warn  (criu/log.c:203): The early log isn't empty
>> ------------------------ ERROR OVER ------------------------
> 
> Instead of decreasing loglevel of the message, improve it by
> reporting a real issue.
> 
> Cc: Adrian Reber <adrian at lisas.de>
> Cc: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
> Cc: Radostin Stoyanov <rstoyanov1 at gmail.com>
> Signed-off-by: Dmitry Safonov <dima at arista.com>
> ---
>   criu/log.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/criu/log.c b/criu/log.c
> index 8bdf83534143..0ee113b91ac2 100644
> --- a/criu/log.c
> +++ b/criu/log.c
> @@ -199,8 +199,8 @@ void flush_early_log_buffer(int fd)
>   		}
>   		pos += hdr->len;
>   	}
> -	if (early_log_buf_off)
> -		pr_warn("The early log isn't empty\n");
> +	if (early_log_buf_off == EARLY_LOG_BUF_LEN)
> +		pr_warn("The early log buffer is full, some messages may have been lost\n");
>   	early_log_buf_off = 0;
>   }
>   
> 

-- 
Best regards, Tikhomirov Pavel
Software Developer, Virtuozzo.



More information about the CRIU mailing list