On 2025-05-27 17:58, Peter Xu wrote:
> Dave suggested the HMP output for "info migrate" can not only leverage the
> lines but also better grouping:
> 
>   https://lore.kernel.org/r/aC4_-nMc7FwsMf9p@gallifrey
> 
> I followed Dave's suggestion, and some more modifications on top:
> 
>   - Added all elements into the picture
> 
>   - Use size_to_str() and drop most of the units: benefit is more friendly
>   to most human eyes, bad side effect is lose of details, but that should
>   be corner case per my uses, and one can still leverage the QMP interface
>   when necessary.
> 
>   - Sub-grouping for "Transfers" ("Channels" and "Page Types").
> 
>   - Better indentations
> 
> Sample output:
> 
> (qemu) info migrate
> Status:                 postcopy-active
> Time (ms):              total=47317, setup=5, down=8
> RAM info:
>   Throughput (Mbps):    1342.83
>   Sizes:                pagesize=4 KiB, total=4.02 GiB
>   Transfers:            transferred=1.41 GiB, remain=2.46 GiB
>     Channels:           precopy=15.2 MiB, multifd=0 B, postcopy=1.39 GiB
>     Page Types:         normal=367713, zero=41195
>   Page Rates (pps):     transfer=40900, dirty=4
>   Others:               dirty_syncs=2, postcopy_req=57503
> 
> Cc: Zhijian Li (Fujitsu) <lizhij...@fujitsu.com>
> Suggested-by: Dr. David Alan Gilbert <d...@treblig.org>
> Signed-off-by: Peter Xu <pet...@redhat.com>
> ---
>  migration/migration-hmp-cmds.c | 59 ++++++++++++++++++----------------
>  1 file changed, 31 insertions(+), 28 deletions(-)

Reviewed-by: Juraj Marcin <jmar...@redhat.com>


Reply via email to