bin/91034: minor fix to iostat so that columns line up with 128KB xfers

Bruce Evans bde at zeta.org.au
Tue Jan 3 03:40:21 PST 2006


On Tue, 3 Jan 2006, Giorgos Keramidas wrote:

> On 2005-12-28 21:16, Robert Cousins <rec at RCousins.com> wrote:
> > Iostat's output can be kind of ugly under USF2 with 128KB
> > transfers. Here is an example:
> > ...
> > The patch I'm submitting notices when this value is >= 100 and
> > drops from 2 decimals to 1 in this case. The result is an output
> > like this:
> >
> >       tty             ad0              ad1             cpu
> >  tin tout  KB/t tps  MB/s   KB/t tps  MB/s  us ni sy in id
> >    0   60  0.00   0  0.00   0.00   0  0.00  50  0  0  0 50
> >    0  180  0.00   0  0.00  128.0   8  1.00  48  0  0  0 51
> >    0   61  0.00   0  0.00   0.00   0  0.00  50  0  0  0 50
> >    0   60  0.00   0  0.00   0.00   0  0.00  49  0  0  0 51
>
> The misaligned dots seem a bit ugly.

Indeed.  They are like the -h (hideous or human-unreadable) output
in many utilities.  Exponential notation and columns that aren't
lined up are hard for humans to read.

> Is it ok to use %6.2Lf as
> the format specifier, widening the KB columns a bit to fit the
> new length of the text?

No.  There is space in the above, but most systems have more than 2 drives
(most of mine have 6, with 4 physical drives and extras from atapicam
duplicating acd0 and cam giving a virtual drive pass0).  Info about 3
drives just fits in 80 columns with %5.2Lf format.  It results in 77
coumns being used.  %6.2Lf format would result in 80 columns being used
and thus ugly line wrap on some terminals (or the number of drives being
limited to 2).

A normal number of drives also causes congestion problems in systat -v.
With just 5 drives (including ones like pass0 that might never be used),
there is not quite enough space for the misdocumented/undocumented
extended vm stats and these stats are not displayed (except for zfod which
is isn't really an extended vm stat and is displayed almost in its old
place in this case); thus the actually-extended vm stats are not displayed
on most systems.  The misdocumentation includes still saying that zfod is
in its old place after "cow" although it is now either before "cow" (to
avoid its loss and minimize ugliness) if there is no space for the
extended stats and in the extended stats otherwise.

Bruce


More information about the freebsd-bugs mailing list