[CRIU] [PATCH] log-simple: Rework message writting logic

Pavel Emelyanov xemul at parallels.com
Fri Mar 1 13:36:47 EST 2013


On 03/01/2013 12:15 PM, Cyrill Gorcunov wrote:
> At the moment we don't write messages which uses own
> minimal printf engine in atomic manner. Every time
> an argument from pr_() helper met, it get flushed
> immediately. This leads into a mess in output.
> 
> For examle
> 
>  | __sent ack msg: (00.049334) Fetched ack: 15619 8 8 0
>  | (00.049385) Waiting for 15619 to trap
>  | (00.049400) Daemon 15619 exited trapping
>  | 15619(00.049414) Sent msg to daemon 15620 8 0 0
>  | (00.049455) Wait for ack 15620-8 on daemon socket
>  | 8 8 0
>  | Daemon wais for command
> 
> So what we need is to provide own buffer in our log-simple.c,
> fill it first and only the write it to a file.
> 
> So with this patch applied all writes are granular.
> 
>  | __sent ack msg: 16667 8 8 0
>  | Daemon wais for command
>  | (00.034946) Fetched ack: 16667 8 8 0
>  | (00.034987) Waiting for 16667 to trap
>  | (00.035004) Daemon 16667 exited trapping
>  | (00.035041) Sent msg to daemon 16668 8 0 0
>  | (00.035058) Wait for ack 16668-8 on daemon socket
>  | __fetched msg: 16668 8 0 0
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>

This patch does much more than just buffers the output. Plz, split.


More information about the CRIU mailing list