Fix all (?) cases where the field width of a numeric field was far too

large.  In most cases it is still 1 too large, so fields tend to run
together, but in the following cases it was more than 1 too large, and
the starting column was too small too, so the field started inside the
previous field or descriptor and clobbered that:
- "wire": the number for this overwrote 2 characters of the number for
  "Flt".  Reduce the field width by 3 (2 to avoid the overwrite and 1
  so that the fields don't run together).  This was already done for
  the preceding number for "cow".
- "inact": the number for this overwrote 1 character of the descriptor
  "Idle".  Reducing the field width by 2 is enough.
- "cache:" the number for this overwrote 3 characters of the scale
  "...|    |".  The field width should be reduced by 4 to keep things
  from running together, but that is a lot and not so necessary here
  since the final "|" in the scale serves as a delimiter.  Only reduce
  it by 3.
- "free": the number for this overwrote 2 characters of the bar graph.
  The character position under the final "|" in the scale is apparently
  not used, so reducing the field width by 3 is enough.

When "zfod" is in the main vmstat display:
- use the normal field width of 9 (not 5) for it since there is no shortage
  of space.  Fix style bugs (excessive {}) in the statement that
  conditionally writes it.

Write all reduced field widths for vmstat fields as "9 - <reduction>" as
a hint that we don't want to reduce them.
This commit is contained in:
Bruce Evans 2006-02-14 07:44:21 +00:00
parent ea9dce1461
commit dc8ccdf0dc

View File

@ -487,15 +487,14 @@ showkre()
putint(total.t_dw, PROCSROW + 1, PROCSCOL + 9, 3);
putint(total.t_sl, PROCSROW + 1, PROCSCOL + 12, 3);
putint(total.t_sw, PROCSROW + 1, PROCSCOL + 15, 3);
if (extended_vm_stats == 0) {
PUTRATE(v_zfod, VMSTATROW + 0, VMSTATCOL + 4, 5);
}
PUTRATE(v_cow_faults, VMSTATROW + 1, VMSTATCOL + 3, 6);
putint(pgtokb(s.v_wire_count), VMSTATROW + 2, VMSTATCOL, 9);
if (extended_vm_stats == 0)
PUTRATE(v_zfod, VMSTATROW + 0, VMSTATCOL, 9);
PUTRATE(v_cow_faults, VMSTATROW + 1, VMSTATCOL + 3, 9 - 3);
putint(pgtokb(s.v_wire_count), VMSTATROW + 2, VMSTATCOL + 3, 9 - 3);
putint(pgtokb(s.v_active_count), VMSTATROW + 3, VMSTATCOL, 9);
putint(pgtokb(s.v_inactive_count), VMSTATROW + 4, VMSTATCOL, 9);
putint(pgtokb(s.v_cache_count), VMSTATROW + 5, VMSTATCOL, 9);
putint(pgtokb(s.v_free_count), VMSTATROW + 6, VMSTATCOL, 9);
putint(pgtokb(s.v_inactive_count), VMSTATROW + 4, VMSTATCOL + 2, 9 - 2);
putint(pgtokb(s.v_cache_count), VMSTATROW + 5, VMSTATCOL + 3, 9 - 3);
putint(pgtokb(s.v_free_count), VMSTATROW + 6, VMSTATCOL + 3, 9 - 3);
PUTRATE(v_dfree, VMSTATROW + 7, VMSTATCOL, 9);
PUTRATE(v_pfree, VMSTATROW + 8, VMSTATCOL, 9);
PUTRATE(v_reactivated, VMSTATROW + 9, VMSTATCOL, 9);