stat: add diskutil aggregated sectors to normal output
authorVincent Fu <vincent.fu@samsung.com>
Fri, 14 Jul 2023 16:58:34 +0000 (12:58 -0400)
committerVincent Fu <vincent.fu@samsung.com>
Fri, 14 Jul 2023 17:53:46 +0000 (13:53 -0400)
Since we are now collecting sectors in the disk utilization data we
should include them in the aggregated data as well.

I tested this with an LVM mirror. I also tested this on an mdadm mirror
but all the aggregated and slave data was zero.

Fixes: 75cbc26d500fc5f7e36f6203c9b8e08b9c6f007c ("diskutil: Report how
many sectors have been read and written")
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
stat.c

diff --git a/stat.c b/stat.c
index fc73930d9aaf6e9878c075fc8b281e63ba5e06d4..7fad73d139b14470e943eee9cf47ef96f628c1f5 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -957,11 +957,13 @@ static void show_agg_stats(struct disk_util_agg *agg, int terse,
                return;
 
        if (!terse) {
-               log_buf(out, ", aggrios=%llu/%llu, aggrmerge=%llu/%llu, "
-                        "aggrticks=%llu/%llu, aggrin_queue=%llu, "
-                        "aggrutil=%3.2f%%",
+               log_buf(out, ", aggrios=%llu/%llu, aggsectors=%llu/%llu, "
+                        "aggrmerge=%llu/%llu, aggrticks=%llu/%llu, "
+                        "aggrin_queue=%llu, aggrutil=%3.2f%%",
                        (unsigned long long) agg->ios[0] / agg->slavecount,
                        (unsigned long long) agg->ios[1] / agg->slavecount,
+                       (unsigned long long) agg->sectors[0] / agg->slavecount,
+                       (unsigned long long) agg->sectors[1] / agg->slavecount,
                        (unsigned long long) agg->merges[0] / agg->slavecount,
                        (unsigned long long) agg->merges[1] / agg->slavecount,
                        (unsigned long long) agg->ticks[0] / agg->slavecount,