summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2006-02-14 07:44:21 +0000
committerbde <bde@FreeBSD.org>2006-02-14 07:44:21 +0000
commitb5c5a6eb328ddd1def3cc99cf8c6968b6d91b401 (patch)
treee2188d406c4e5bbc1aa05685140afc33cb5c3a27 /usr.bin
parenta77fb4360bb170f10b7e19e403fe1d6fbd7a20b1 (diff)
downloadFreeBSD-src-b5c5a6eb328ddd1def3cc99cf8c6968b6d91b401.zip
FreeBSD-src-b5c5a6eb328ddd1def3cc99cf8c6968b6d91b401.tar.gz
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.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/systat/vmstat.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index 4654f90..708230c 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -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);
OpenPOWER on IntegriCloud