Date: Mon, 25 Jun 2018 15:06:52 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> Cc: bugs@freebsd.org Subject: Re: [Bug 201685] top(1) with -m io produces garbage output for first update Message-ID: <20180625145141.O945@besplex.bde.org> In-Reply-To: <bug-201685-227-RNtaIP9On6@https.bugs.freebsd.org/bugzilla/> References: <bug-201685-227@https.bugs.freebsd.org/bugzilla/> <bug-201685-227-RNtaIP9On6@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 24 Jun 2018 a bug that does't want replies@freebsd.org wrote: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201685 > > --- Comment #4 from cstdenis@ctgameinfo.com --- > I encountered this error because I was trying to log periodic snapshots of top > output as part of tracking down some system issues. > > i.e. (/root/datestamp.sh; /usr/bin/top -j -t -mio -ototal) >> > /var/log/top_io.log > > Having it do a "dummy" run before outputting would be a great fix and make that > kind of logging possible. As it is, the above command is useless. The only bug here is misformatting of large values. top -m io just starts by displaying the counts since boot time. These can be very large after a long uptime. top uses fixed field widths, and has no space available for wider dynamic widths anyway, so it misaligns large values. The fix is not to display values in dehumanized (scientific) format like systat does by default and some utilities do when directed to do so by a -[hH] (dehumanize) flag. I use this feature to log benchmarks. top -SH -m io -o write 1000 gives non-interactive output. This is logged at the beginning and end of the benchmark. Only the delta-counts are of interest. These are hard to manage and I don't have any good scripts to manage them, but sometimes look at a couple of lines and compare the values. Any dehumanized output would break the resolutions. Counts of 1000000 and 1000001 would be indistinguishable if displayed as 1M. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180625145141.O945>