]> granicus.if.org Git - sysstat/commitdiff
Add unit to areq-sz values when --human option has been used
authorSebastien GODARD <sysstat@users.noreply.github.com>
Wed, 7 Jun 2017 12:01:28 +0000 (14:01 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Wed, 7 Jun 2017 12:01:28 +0000 (14:01 +0200)
When iostat and sar display areq-sz, rareq-sz and wareq-sz fields, they
also display the unit if the user has entered option --human.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
iostat.c
pr_stats.c

index 1b7cd7a8cd485d3178c085e58d8a55eff024d365..0c219cd64bf06b0323d5bb1ad52ef1c10d88b47c 100644 (file)
--- a/iostat.c
+++ b/iostat.c
@@ -1043,7 +1043,7 @@ void write_plain_ext_stat(unsigned long long itv, int fctr,
                cprintf_f(NO_UNIT, 1, 6, 2,
                          S_VALUE(ioj->rq_ticks, ioi->rq_ticks, itv) / 1000.0);
                /* areq-sz (in kB, not sectors) */
-               cprintf_f(NO_UNIT, 1, 8, 2,
+               cprintf_f(DISPLAY_UNIT(flags) ? UNIT_KILOBYTE : NO_UNIT, 1, 8, 2,
                          xds->arqsz / 2);
                /*
                 * %util
@@ -1082,7 +1082,7 @@ void write_plain_ext_stat(unsigned long long itv, int fctr,
                cprintf_f(NO_UNIT, 1, 6, 2,
                          S_VALUE(ioj->rq_ticks, ioi->rq_ticks, itv) / 1000.0);
                /* rareq-sz  wareq-sz (in kB, not sectors) */
-               cprintf_f(NO_UNIT, 2, 8, 2,
+               cprintf_f(DISPLAY_UNIT(flags) ? UNIT_KILOBYTE : NO_UNIT, 2, 8, 2,
                          xios->rarqsz / 2, xios->warqsz / 2);
                /* svctm - The ticks output is biased to output 1000 ticks per second */
                cprintf_f(NO_UNIT, 1, 6, 2, xds->svctm);
index d0b1e37ddc66e9fa5f6e02fa42b79b5aeffebf54..3c40e960b5a171223db2cce7f7c63eb822be47e9 100644 (file)
@@ -1025,9 +1025,10 @@ __print_funct_t print_disk_stats(struct activity *a, int prev, int curr,
                cprintf_f(unit, 2, 9, 2,
                          S_VALUE(sdp->rd_sect, sdc->rd_sect, itv) / 2,
                          S_VALUE(sdp->wr_sect, sdc->wr_sect, itv) / 2);
-               cprintf_f(NO_UNIT, 4, 9, 2,
-                         /* See iostat for explanations */
-                         xds.arqsz / 2,
+               /* See iostat for explanations */
+               cprintf_f(unit, 1, 9, 2,
+                         xds.arqsz / 2);
+               cprintf_f(NO_UNIT, 3, 9, 2,
                          S_VALUE(sdp->rq_ticks, sdc->rq_ticks, itv) / 1000.0,
                          xds.await,
                          xds.svctm);