Bug 219829 - "systat -if 1" Peak has wrong display
Summary: "systat -if 1" Peak has wrong display
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.0-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: FreeBSD bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-07 02:14 UTC by rezo
Modified: 2017-06-07 09:21 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rezo 2017-06-07 02:14:52 UTC
My uname -a:
FreeBSD GIEPHER-PHP 11.0-RELEASE-p4 FreeBSD 11.0-RELEASE-p4 #0 r309666: Thu Dec  8 17:44:40 CST 2016     giepher@GIEPHER-PHP:/usr/obj/usr/src/sys/GIEPHER_PHP_DEBUG  amd64

I use "systat -if 1" last night before I leave my office, today it shows a very large numbers that are impossible just like below:
                    /0   /1   /2   /3   /4   /5   /6   /7   /8   /9   /10
     Load Average   ||   

      Interface           Traffic               Peak                Total
       vboxnet0  in      0.000 KB/s          2.868 MB/s          120.139 MB
                 out     0.000 KB/s          0.204 KB/s          782.491 KB

        bridge0  in      0.000 KB/s          0.000 KB/s          450.108 MB
                 out     0.432 KB/s     16777216.000 TB/s          1.078 GB

            lo0  in      0.000 KB/s     16777216.000 TB/s          2.694 MB
                 out     0.000 KB/s     16777216.000 TB/s          2.694 MB

            re0  in      4.678 KB/s     16777216.000 TB/s         10.189 GB
                 out     0.432 KB/s     16777216.000 TB/s          1.226 GB
Comment 1 Fabian Keil 2017-06-07 09:21:28 UTC
systat uses gettimeofday() calls to measure the time difference
between updates.

If the system time jumps, the "elapsed" time can appear to be
less than a second in which case the devisions in fetchifstat()
will result in the devided variables becoming larger.

systat should probably be changed to use clock_gettime()
with a monotonic clock.