* [PATCH] block: Improve readability in HMP 'info blockstats' output
@ 2026-05-12 11:27 Kevin Wolf
0 siblings, 0 replies; only message in thread
From: Kevin Wolf @ 2026-05-12 11:27 UTC (permalink / raw)
To: qemu-block; +Cc: kwolf, hreitz, qemu-devel
Instead of a long line with key=value pairs for each block device,
switch to a tabular form with aligned values. This makes it much easier
to find the relevant information in the output.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/monitor/block-hmp-cmds.c | 38 ++++++++++++++++------------------
1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c
index 1fd28d59eb1..69ade0534f1 100644
--- a/block/monitor/block-hmp-cmds.c
+++ b/block/monitor/block-hmp-cmds.c
@@ -794,30 +794,28 @@ void hmp_info_blockstats(Monitor *mon, const QDict *qdict)
continue;
}
- monitor_printf(mon, "%s:", stats->value->device);
- monitor_printf(mon, " rd_bytes=%" PRId64
- " wr_bytes=%" PRId64
- " rd_operations=%" PRId64
- " wr_operations=%" PRId64
- " flush_operations=%" PRId64
- " wr_total_time_ns=%" PRId64
- " rd_total_time_ns=%" PRId64
- " flush_total_time_ns=%" PRId64
- " rd_merged=%" PRId64
- " wr_merged=%" PRId64
- " idle_time_ns=%" PRId64
- "\n",
+ monitor_printf(mon, "%s%s: idle_time_ns=%" PRId64 "\n",
+ stats != stats_list ? "\n" : "",
+ stats->value->device,
+ stats->value->stats->idle_time_ns);
+ monitor_printf(mon, " %24s %16s %24s %10s\n", "bytes",
+ "operations", "total_time_ns", "merged");
+ monitor_printf(mon, "Read: %24" PRId64 " %16" PRId64 " %24" PRId64
+ " %10" PRId64 "\n",
stats->value->stats->rd_bytes,
- stats->value->stats->wr_bytes,
stats->value->stats->rd_operations,
+ stats->value->stats->rd_total_time_ns,
+ stats->value->stats->rd_merged);
+ monitor_printf(mon, "Write: %24" PRId64 " %16" PRId64 " %24" PRId64
+ " %10" PRId64 "\n",
+ stats->value->stats->wr_bytes,
stats->value->stats->wr_operations,
- stats->value->stats->flush_operations,
stats->value->stats->wr_total_time_ns,
- stats->value->stats->rd_total_time_ns,
- stats->value->stats->flush_total_time_ns,
- stats->value->stats->rd_merged,
- stats->value->stats->wr_merged,
- stats->value->stats->idle_time_ns);
+ stats->value->stats->wr_merged);
+ monitor_printf(mon, "Flush: %24s %16" PRId64 " %24" PRId64 "\n",
+ "",
+ stats->value->stats->flush_operations,
+ stats->value->stats->flush_total_time_ns);
}
qapi_free_BlockStatsList(stats_list);
--
2.54.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-12 11:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12 11:27 [PATCH] block: Improve readability in HMP 'info blockstats' output Kevin Wolf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.