Page MenuHomeFreeBSD

[systat] Improve number reading by rounding up to a next unit earlier for memory display.
ClosedPublic

Authored by ota_j.email.ne.jp on Sep 20 2020, 11:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 19, 11:44 AM
Unknown Object (File)
Oct 5 2024, 4:33 PM
Unknown Object (File)
Oct 5 2024, 4:33 PM
Unknown Object (File)
Oct 5 2024, 2:56 PM
Unknown Object (File)
Oct 3 2024, 7:37 PM
Unknown Object (File)
Oct 3 2024, 4:03 PM
Unknown Object (File)
Oct 3 2024, 1:51 PM
Unknown Object (File)
Oct 3 2024, 12:00 PM

Details

Summary

For example like below, display 669MB instead of 689999KB.

Old
Act 161164K 0 684352K 0 113436K
All 161376K 176128 684808K 299008

New
Act 158M 0 669M 0 111M
All 158M 172K 669M 292K

Test Plan

Run systat -vm 10 and compare/check the memory numbers at top left.

Old screen.

 3 users    Load  0.19  0.19  0.19                  Sep 17 20:12
Mem usage:  94%Phy 29%Kmem                           VN PAGER   SWAP PAGER

Mem: REAL VIRTUAL in out in out

Tot   Share      Tot    Share    Free  count

Act 161164K 0 684352K 0 113436K pages
All 161376K 176128 684808K 299008 ioflt Interrupts
Proc: cow 56 total

r   p   d   s   w   Csw  Trp  Sys  Int  Sof  Flt        zfod      4 atkbd0 1
2         105       155        1K    4    9   80        ozfod       psm0 12
                                                       %ozfod       ata1 15

0.6%Sys 0.0%Intr 0.0%User 0.0%Nice 99.4%Idle daefr pcm0 le1

prcfr mpt0 ehci0
                 totfr       uhci0 18
6 dtbuf          react    13 cpu0:timer

Namei Name-cache Dir-cache 111527 maxvn pdwak 18 cpu1:timer

Calls    hits   %    hits   %     92392 numvn      191 pdpgs     4 cpu2:timer
    3       3 100                  1622 frevn          intrn     4 cpu3:timer
                                                  576M wire      4 cpu4:timer

Disks ada0 ada1 cd0 pass0 pass1 pass2 1013M act 9 cpu5:timer
KB/t 0.00 0.00 0.00 0.00 0.00 0.00 275M inact ahci0 24
tps 0 0 0 0 0 0 0 laund xhci0 26
MB/s 0.00 0.00 0.00 0.00 0.00 0.00 111M free
%busy 0 0 0 0 0 0 76566K buf

New screen.

 3 users    Load  0.16  0.19  0.19                  Sep 17 20:13
Mem usage:  94%Phy 29%Kmem                           VN PAGER   SWAP PAGER

Mem: REAL VIRTUAL in out in out

Tot   Share     Tot    Share     Free   count

Act 158M 0 669M 0 111M pages
All 158M 172K 669M 292K ioflt Interrupts
Proc: cow 172 total

r   p   d   s   w   Csw  Trp  Sys  Int  Sof  Flt     14 zfod      3 atkbd0 1
          107       731   18   2K  109   19   21        ozfod    94 psm0 12
                                                       %ozfod     1 ata1 15

0.7%Sys 0.0%Intr 0.3%User 0.0%Nice 98.9%Idle daefr pcm0 le1

prcfr 2 mpt0 ehci0
totfr     2 uhci0 18
6 dtbuf          react    31 cpu0:timer

Namei Name-cache Dir-cache 111527 maxvn pdwak 6 cpu1:timer

Calls    hits   %    hits   %     92392 numvn      432 pdpgs     7 cpu2:timer
   11      11 100                  1622 frevn          intrn     5 cpu3:timer
                                                  576M wire      7 cpu4:timer

Disks ada0 ada1 cd0 pass0 pass1 pass2 1013M act 7 cpu5:timer
KB/t 0.00 0.00 0.00 0.00 0.00 0.00 275M inact ahci0 24
tps 0 0 0 0 0 0 0 laund 7 xhci0 26
MB/s 0.00 0.00 0.00 0.00 0.00 0.00 111M free
%busy 0 0 0 0 0 0 76566K buf

% systat -vm 10

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable