From nobody Thu Dec 18 13:59:51 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1752243258; cv=none; d=zohomail.com; s=zohoarc; b=e3zeGmX2zhFqDjRbDZ+4jsSO9Vmzs249XlxO2JkxLQqJLPXY2ujnPMTiwxXO+Z9LJkTZO6IKM/Z+VkV5PUf8nrjyLCsEC9ITGl3Z/3An4OY0ya/dH20QJZWAIs4mZlbblutJ0qocYWeBbm2S7P2oJO9Y31Mg11VtWmTO9e1n09w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752243258; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ExL2dc8zYuNhaMMvBjDBzq3S3sLX8sfaz1Y6DiMkFWc=; b=XAlKy696bR4nHmlM9FEZFuiLCzCmlY7HeWliYp3sy7u7HYAVxsPM9xPYHvBIiUmBmX7bsQ2AnjQWViMFN2o+1gLWqsY0RSjGlPpC5eHMj0TzCRt8vtA9bI7wjlt5SXUx6b8hG8MHXp5RFkTMEJCLm2krjqx8tt4fa9x5zv/0U6g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752243258189136.61876821318197; Fri, 11 Jul 2025 07:14:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uaEVh-0006JY-FJ; Fri, 11 Jul 2025 10:14:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uaET6-0000tQ-Df for qemu-devel@nongnu.org; Fri, 11 Jul 2025 10:11:18 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uaESm-0006Zr-3L for qemu-devel@nongnu.org; Fri, 11 Jul 2025 10:10:58 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3E6181F38C; Fri, 11 Jul 2025 14:10:38 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1B0C813918; Fri, 11 Jul 2025 14:10:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id aM2cMlsbcWg7TgAAD6G6ig (envelope-from ); Fri, 11 Jul 2025 14:10:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1752243039; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ExL2dc8zYuNhaMMvBjDBzq3S3sLX8sfaz1Y6DiMkFWc=; b=sFpRtZARql7guZ6k4VgIvWaJ5AULttD9Y1soLGM91w9n88I6WInexpp15hFbo/Cm/8mcPo uGYxFh3i1IfrECBICv4QWJGa9FRjB/xiwu3srdMD/QXI6kEc8dqYC5lW+mUBHhwiDhoM2A cJjIKtR4JYW0T4uVZjKfTqCNeZD8YB4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1752243039; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ExL2dc8zYuNhaMMvBjDBzq3S3sLX8sfaz1Y6DiMkFWc=; b=FYuT+4cvF8CypQgco7KbxA0vcDCwD2CiepMvJRI9LTjiVLp1IIvfuu7mrWeMhI9T0lIp73 nSZsc8adqvN7rqCw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Ejs8cmDi; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=ji1kMhJJ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1752243038; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ExL2dc8zYuNhaMMvBjDBzq3S3sLX8sfaz1Y6DiMkFWc=; b=Ejs8cmDipsYbq4sORTTTJRxd8snhBzVpcYXRbJD9Plye8Hu51O3UBVcFsBmx1J59aSKSye lsCOHCs736c8BFMv09q6Xc5h2hQCrtcWorb3FjhOPUqbbG38KjM6yC75js5vpa6EWrdxAk UBMMo5CWm7zwAZ4bH/JI3E7rx2gGwjU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1752243038; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ExL2dc8zYuNhaMMvBjDBzq3S3sLX8sfaz1Y6DiMkFWc=; b=ji1kMhJJ6VO6U1mH/TUz4cgsgKxaYgNj0ZdGxZB1XGlz+8VmSrmuivk7CCJ7Klx42k08sp VGusom/zNN56cpAA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , "Dr . David Alan Gilbert" , Li Zhijian , Juraj Marcin , Mario Casquero Subject: [PULL 01/26] migration/hmp: Reorg "info migrate" once more Date: Fri, 11 Jul 2025 11:10:06 -0300 Message-Id: <20250711141031.423-2-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20250711141031.423-1-farosas@suse.de> References: <20250711141031.423-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-5.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; DWL_DNSWL_MED(-2.00)[suse.de:dkim]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,fujitsu.com:email,treblig.org:email,suse.de:mid,suse.de:dkim,suse.de:email]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Queue-Id: 3E6181F38C X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Score: -5.01 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1752243258915116600 Content-Type: text/plain; charset="utf-8" From: Peter Xu 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=3D47317, setup=3D5, down=3D8 RAM info: Throughput (Mbps): 1342.83 Sizes: pagesize=3D4 KiB, total=3D4.02 GiB Transfers: transferred=3D1.41 GiB, remain=3D2.46 GiB Channels: precopy=3D15.2 MiB, multifd=3D0 B, postcopy=3D1.39 = GiB Page Types: normal=3D367713, zero=3D41195 Page Rates (pps): transfer=3D40900, dirty=3D4 Others: dirty_syncs=3D2, postcopy_req=3D57503 Suggested-by: Dr. David Alan Gilbert Tested-by: Li Zhijian Reviewed-by: Li Zhijian Acked-by: Dr. David Alan Gilbert Reviewed-by: Juraj Marcin Tested-by: Mario Casquero Link: https://lore.kernel.org/r/20250613140801.474264-2-peterx@redhat.com Signed-off-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration-hmp-cmds.c | 59 ++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index e8a563c7d8..367ff6037f 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -69,7 +69,7 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) } =20 if (info->has_status) { - monitor_printf(mon, "Status: %s", + monitor_printf(mon, "Status: \t\t%s", MigrationStatus_str(info->status)); if (info->status =3D=3D MIGRATION_STATUS_FAILED && info->error_des= c) { monitor_printf(mon, " (%s)\n", info->error_desc); @@ -78,7 +78,7 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) } =20 if (info->total_time) { - monitor_printf(mon, "Time (ms): total=3D%" PRIu64, + monitor_printf(mon, "Time (ms): \t\ttotal=3D%" PRIu64, info->total_time); if (info->has_setup_time) { monitor_printf(mon, ", setup=3D%" PRIu64, @@ -110,48 +110,51 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdic= t) } =20 if (info->ram) { + g_autofree char *str_psize =3D size_to_str(info->ram->page_size); + g_autofree char *str_total =3D size_to_str(info->ram->total); + g_autofree char *str_transferred =3D size_to_str(info->ram->transf= erred); + g_autofree char *str_remaining =3D size_to_str(info->ram->remainin= g); + g_autofree char *str_precopy =3D size_to_str(info->ram->precopy_by= tes); + g_autofree char *str_multifd =3D size_to_str(info->ram->multifd_by= tes); + g_autofree char *str_postcopy =3D size_to_str(info->ram->postcopy_= bytes); + monitor_printf(mon, "RAM info:\n"); - monitor_printf(mon, " Throughput (Mbps): %0.2f\n", + monitor_printf(mon, " Throughput (Mbps): \t%0.2f\n", info->ram->mbps); - monitor_printf(mon, " Sizes (KiB): pagesize=3D%" PRIu64 - ", total=3D%" PRIu64 ",\n", - info->ram->page_size >> 10, - info->ram->total >> 10); - monitor_printf(mon, " transferred=3D%" PRIu64 - ", remain=3D%" PRIu64 ",\n", - info->ram->transferred >> 10, - info->ram->remaining >> 10); - monitor_printf(mon, " precopy=3D%" PRIu64 - ", multifd=3D%" PRIu64 - ", postcopy=3D%" PRIu64, - info->ram->precopy_bytes >> 10, - info->ram->multifd_bytes >> 10, - info->ram->postcopy_bytes >> 10); + monitor_printf(mon, " Sizes: \t\tpagesize=3D%s, total=3D%s\n", + str_psize, str_total); + monitor_printf(mon, " Transfers: \t\ttransferred=3D%s, remain=3D%= s\n", + str_transferred, str_remaining); + monitor_printf(mon, " Channels: \t\tprecopy=3D%s, " + "multifd=3D%s, postcopy=3D%s", + str_precopy, str_multifd, str_postcopy); =20 if (info->vfio) { - monitor_printf(mon, ", vfio=3D%" PRIu64, - info->vfio->transferred >> 10); + g_autofree char *str_vfio =3D size_to_str(info->vfio->transfer= red); + + monitor_printf(mon, ", vfio=3D%s", str_vfio); } monitor_printf(mon, "\n"); =20 - monitor_printf(mon, " Pages: normal=3D%" PRIu64 ", zero=3D%" PRIu= 64 - ", rate_per_sec=3D%" PRIu64 "\n", - info->ram->normal, - info->ram->duplicate, + monitor_printf(mon, " Page Types: \tnormal=3D%" PRIu64 + ", zero=3D%" PRIu64 "\n", + info->ram->normal, info->ram->duplicate); + monitor_printf(mon, " Page Rates (pps): \ttransfer=3D%" PRIu64, info->ram->pages_per_second); - monitor_printf(mon, " Others: dirty_syncs=3D%" PRIu64, - info->ram->dirty_sync_count); - if (info->ram->dirty_pages_rate) { - monitor_printf(mon, ", dirty_pages_rate=3D%" PRIu64, + monitor_printf(mon, ", dirty=3D%" PRIu64, info->ram->dirty_pages_rate); } + monitor_printf(mon, "\n"); + + monitor_printf(mon, " Others: \t\tdirty_syncs=3D%" PRIu64, + info->ram->dirty_sync_count); if (info->ram->postcopy_requests) { monitor_printf(mon, ", postcopy_req=3D%" PRIu64, info->ram->postcopy_requests); } if (info->ram->downtime_bytes) { - monitor_printf(mon, ", downtime_ram=3D%" PRIu64, + monitor_printf(mon, ", downtime_bytes=3D%" PRIu64, info->ram->downtime_bytes); } if (info->ram->dirty_sync_missed_zero_copy) { --=20 2.35.3