diff options
author | bde <bde@FreeBSD.org> | 2006-04-30 07:27:23 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2006-04-30 07:27:23 +0000 |
commit | 601ee9993aa18a97c65a6b58b7be9501198c5fca (patch) | |
tree | 11f57bb9110980574e008b41476e32950f62b2bb /usr.bin/systat | |
parent | e3a87fd595ba1ed181fbc8ecbbcf6145918ace68 (diff) | |
download | FreeBSD-src-601ee9993aa18a97c65a6b58b7be9501198c5fca.zip FreeBSD-src-601ee9993aa18a97c65a6b58b7be9501198c5fca.tar.gz |
Fix "slow (on-the-fly) zero fills percentage (`%slo-z')" some more. The
value printed is actually the optimized (i.e., the non-slow, not-on-the-fly
zero fills percentage) except in overflow cases. Describe it as %ozfod
in the display. Move the field descriptor 1 to the left so that there
is space for 5 characters after the % sign (this leaves no space between
the number and the descriptor but the % character serves well as a
separator).
Fixed integer overflow at z.ozfod = UINT_MAX/100 in the calculation of
%ozfod. This value can be reached just a few hours or minutes after
booting, so %ozfod was usually garbage in boot mode. Now %ozfod is
correct in boot mode for a few days or hours.
Print a non-dummy %ozfod when the division for it isn't division by 0
instead of when the result will be less than 100%. A result of 100%
may be correct, though a result of more than 100% indicates overflow
of one or both counters.
Diffstat (limited to 'usr.bin/systat')
-rw-r--r-- | usr.bin/systat/systat.1 | 2 | ||||
-rw-r--r-- | usr.bin/systat/vmstat.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1 index f0002e0..dff7ad4 100644 --- a/usr.bin/systat/systat.1 +++ b/usr.bin/systat/systat.1 @@ -367,7 +367,7 @@ memory system which list the average number of pages copied on write (`cow'), pages zero filled on demand (`zfod'), pages optimize zero filled on demand (`ozfod'), -slow (on-the-fly) zero fills percentage (`%sloz'), +the ratio ozfod / zfod as a percentage (`%ozfod'), total pages freed (`totfr'), pages wired down (`wire'), active pages (`act'), diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index a836fce..2ca4e8a 100644 --- a/usr.bin/systat/vmstat.c +++ b/usr.bin/systat/vmstat.c @@ -392,7 +392,7 @@ labelkre() */ mvprintw(VMSTATROW + 11, VMSTATCOL - 6, "zfod"); mvprintw(VMSTATROW + 12, VMSTATCOL - 6, "ozfod"); - mvprintw(VMSTATROW + 13, VMSTATCOL - 6, "%%sloz"); + mvprintw(VMSTATROW + 13, VMSTATCOL - 7, "%%ozfod"); mvprintw(VMSTATROW + 14, VMSTATCOL - 6, "totfr"); extended_vm_stats = 1; } else { @@ -530,8 +530,8 @@ showkre() PUTRATE(v_zfod, VMSTATROW + 11, VMSTATCOL - 16, 9); PUTRATE(v_ozfod, VMSTATROW + 12, VMSTATCOL - 16, 9); putint( - ((s.v_ozfod < s.v_zfod) ? - s.v_ozfod * 100 / s.v_zfod : + ((s.v_zfod != 0) ? + (int)(s.v_ozfod * 100.0 / s.v_zfod) : 0 ), VMSTATROW + 13, |