From 75cbc26d500fc5f7e36f6203c9b8e08b9c6f007c Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 13 Jul 2023 12:44:54 -0700 Subject: [PATCH] diskutil: Report how many sectors have been read and written It is useful to know how much data has been read and/or written. Report this information. Signed-off-by: Bart Van Assche --- HOWTO.rst | 4 +++- fio.1 | 2 +- stat.c | 7 +++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/HOWTO.rst b/HOWTO.rst index b047877e..7ae8ea7b 100644 --- a/HOWTO.rst +++ b/HOWTO.rst @@ -4528,13 +4528,15 @@ For each data direction it prints: And finally, the disk statistics are printed. This is Linux specific. They will look like this:: Disk stats (read/write): - sda: ios=16398/16511, merge=30/162, ticks=6853/819634, in_queue=826487, util=100.00% + sda: ios=16398/16511, sectors=32321/65472, merge=30/162, ticks=6853/819634, in_queue=826487, util=100.00% Each value is printed for both reads and writes, with reads first. The numbers denote: **ios** Number of I/Os performed by all groups. +**sectors** + Amount of data transferred in units of 512 bytes for all groups. **merge** Number of merges performed by the I/O scheduler. **ticks** diff --git a/fio.1 b/fio.1 index 86cb2af6..da875276 100644 --- a/fio.1 +++ b/fio.1 @@ -4184,7 +4184,7 @@ They will look like this: .P .nf Disk stats (read/write): - sda: ios=16398/16511, merge=30/162, ticks=6853/819634, in_queue=826487, util=100.00% + sda: ios=16398/16511, sectors=32321/65472, merge=30/162, ticks=6853/819634, in_queue=826487, util=100.00% .fi .P Each value is printed for both reads and writes, with reads first. The diff --git a/stat.c b/stat.c index 015b8e28..ced73645 100644 --- a/stat.c +++ b/stat.c @@ -1030,11 +1030,14 @@ void print_disk_util(struct disk_util_stat *dus, struct disk_util_agg *agg, if (agg->slavecount) log_buf(out, " "); - log_buf(out, " %s: ios=%llu/%llu, merge=%llu/%llu, " - "ticks=%llu/%llu, in_queue=%llu, util=%3.2f%%", + log_buf(out, " %s: ios=%llu/%llu, sectors=%llu/%llu, " + "merge=%llu/%llu, ticks=%llu/%llu, in_queue=%llu, " + "util=%3.2f%%", dus->name, (unsigned long long) dus->s.ios[0], (unsigned long long) dus->s.ios[1], + (unsigned long long) dus->s.sectors[0], + (unsigned long long) dus->s.sectors[1], (unsigned long long) dus->s.merges[0], (unsigned long long) dus->s.merges[1], (unsigned long long) dus->s.ticks[0], -- 2.25.1