From: Vincent Fu Date: Fri, 14 Jul 2023 16:36:20 +0000 (-0400) Subject: stat: add new diskutil sectors to json output X-Git-Tag: fio-3.36~61 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=fc2501310842cc2cd11168074e8f69cf39699263;p=fio.git stat: add new diskutil sectors to json output A recent commit added sectors read/written to the disk utilization data. Allow these counts to also appear in the JSON output. Fixes: 75cbc26d500fc5f7e36f6203c9b8e08b9c6f007c ("diskutil: Report how many sectors have been read and written") Signed-off-by: Vincent Fu --- diff --git a/stat.c b/stat.c index ced73645..fc73930d 100644 --- a/stat.c +++ b/stat.c @@ -1084,6 +1084,8 @@ void json_array_add_disk_util(struct disk_util_stat *dus, json_object_add_value_string(obj, "name", (const char *)dus->name); json_object_add_value_int(obj, "read_ios", dus->s.ios[0]); json_object_add_value_int(obj, "write_ios", dus->s.ios[1]); + json_object_add_value_int(obj, "read_sectors", dus->s.sectors[0]); + json_object_add_value_int(obj, "write_sectors", dus->s.sectors[1]); json_object_add_value_int(obj, "read_merges", dus->s.merges[0]); json_object_add_value_int(obj, "write_merges", dus->s.merges[1]); json_object_add_value_int(obj, "read_ticks", dus->s.ticks[0]); @@ -1101,6 +1103,10 @@ void json_array_add_disk_util(struct disk_util_stat *dus, agg->ios[0] / agg->slavecount); json_object_add_value_int(obj, "aggr_write_ios", agg->ios[1] / agg->slavecount); + json_object_add_value_int(obj, "aggr_read_sectors", + agg->sectors[0] / agg->slavecount); + json_object_add_value_int(obj, "aggr_write_sectors", + agg->sectors[1] / agg->slavecount); json_object_add_value_int(obj, "aggr_read_merges", agg->merges[0] / agg->slavecount); json_object_add_value_int(obj, "aggr_write_merge",