Commit Graph

344 Commits

Author SHA1 Message Date
Simon J. Gerraty
3b8f084595 Merge head 2014-04-28 07:50:45 +00:00
Brooks Davis
38e233371c Merge from CheriBSD:
commit c1acf022c5
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date:   Fri Jan 17 21:46:44 2014 +0000

    Add an option WITHOUT_NCURSESW to suppress building and linking to
    libncursesw.  While wide character support it useful we'd like to
    only need one ncurses library on embedded systems.

MFC after:	4 weeks
Sponsored by:	DARPA, AFRL
2014-01-30 21:08:36 +00:00
Kevin Lo
482d883100 Use INADDR_NONE instead of -1 to check inet_addr() result.
Reviewed by:	glebius
2013-10-15 07:37:30 +00:00
Simon J. Gerraty
d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00
Gleb Smirnoff
2898a92a21 Nuke "systat -mbuf". It was broken since FreeBSD 5, and since there
haven't been any complaints, no one used it.
2013-07-15 12:15:14 +00:00
Simon J. Gerraty
69e6d7b75e sync from head 2013-04-12 20:48:55 +00:00
Alexander Motin
8d2419b571 Make systat -vmstat to use suffixes to display big floating point numbers
that are not fitting into the specified field width, same as done for ints.
In particular that allows to properly display disk tps above 100k, that are
reachable with modern SSDs.
2013-03-23 13:11:54 +00:00
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Joel Dahl
ed88bcd300 Remove EOL whitespace. 2013-02-25 17:32:10 +00:00
Alexander V. Chernikov
297c1ec124 Fix several new & old style issues.
Pointed by:	ae, pluknet, zont
MFC with:	r247036
2013-02-20 14:19:09 +00:00
Alexander V. Chernikov
b021472399 Add interface name filtering via 'match' cmd.
Add 'pps' cmd for switching beetween interface packets/bytes statistics.

Submitted by:	vsevolod
MFC after:	2 weeks
2013-02-20 13:47:05 +00:00
Philippe Charnier
00c31a91ef Remove old-style function definition 2013-02-19 12:57:07 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
David E. O'Brien
d9a447559b Sync with HEAD. 2013-02-08 16:10:16 +00:00
Andrey Zonov
9c02dc3399 - Show page faults requiring I/O on vmstat display.
Reviewed by:	alc
MFC after:	2 weeks
2013-01-28 12:57:42 +00:00
Simon J. Gerraty
23090366f7 Sync from head 2012-11-04 02:52:03 +00:00
Alexander V. Chernikov
8b3daf895a Make systat(1) accept fractional number of seconds.
Make old alarm(3)-based code use select(2).

MFC after:	2 weeks
2012-09-17 13:36:47 +00:00
Ed Schouten
902d9eafbf Rework all non-contributed files that use `struct timezone'.
This structure is not part of POSIX. According to POSIX, gettimeofday()
has the following prototype:

	int gettimeofday(struct timeval *restrict tp, void *restrict tzp);

Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is
not used). Remove dead error handling code. Also use NULL for a
nul-pointer instead of integer 0.

While there, change all pieces of code that only use tv_sec to use
time(3), as this provides less overhead.
2012-09-01 14:45:15 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Ed Schouten
627d915e25 Whitespace fixes.
- Remove redundant empty lines.
- Replace ^L by \014. This allows you to safely cat/grep/etc this file
  without causing confusion.
2012-02-05 09:17:49 +00:00
Ed Schouten
b3608ae18f Replace index() and rindex() calls with strchr() and strrchr().
The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.
2012-01-03 18:51:58 +00:00
Ulrich Spörlein
487ac9ac21 Spelling fixes for usr.bin/ 2011-12-30 11:02:40 +00:00
Ed Schouten
03d26e9e38 Use integer to store the result of getch().
We need to use an integer to make the comparison against ERR work.

MFC after:	3 months
2011-10-16 08:36:10 +00:00
Ed Schouten
2bd338d6c4 Fix whitespace inconsistencies in systat(1).
According to md5(1), the resulting binary is the same.
2011-10-15 13:20:36 +00:00
Kevin Lo
aa7e4bb466 Remove duplicated header files 2011-06-24 07:18:44 +00:00
Joel Dahl
da52b4caaf Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with:	imp, rwatson
2010-12-11 08:32:16 +00:00
Alexander Motin
4b06d6510d For total interrupt count on -vm screen count all interrupts, but not only
those which fit the screen.
2010-09-08 07:30:46 +00:00
Joel Dahl
c2025a7660 Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages.  Minor corrections by me.

Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
2010-08-16 15:18:30 +00:00
Alexander Motin
f91b7a2526 Partially revert r209312, restoring ability to fit "stray irqX" names into
into available 10 characters by dropping "irq" in the middle of string.
2010-07-19 02:26:59 +00:00
Alexander Motin
cb9c9783b4 Do not print first digits of IRQ number if whole number doesn't fit. 2010-06-18 18:18:03 +00:00
Ruslan Ermilov
bee10047c0 Fixed dependencies (make checkdpadd). 2010-02-25 20:24:19 +00:00
Ed Schouten
ab90a4d1e2 Perform all trivial ports to utmpx for usr.bin/.
They were already converted to use libulog, so it's easy to convert them
to utmpx.
2010-01-13 18:09:54 +00:00
Ed Schouten
b7946da96b Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
Xin LI
821df508e8 Revert most part of 200420 as requested, as more review and polish is
needed.
2009-12-13 03:14:06 +00:00
Xin LI
6f2d322192 Remove unneeded header includes from usr.bin/ except contributed code.
Tested with:	make universe
2009-12-11 23:35:38 +00:00
Ed Schouten
3487b13416 Let systat's vmstat use utmpx. 2009-12-05 20:52:11 +00:00
Hajimu UMEMOTO
347c7f559c Use ncursesw to output the date field of vmstat display
with multi-byte string, correctly.
2009-11-13 03:59:44 +00:00
Jaakko Heinonen
c2dbb0de27 - Catch SIGHUP to perform cleanup before exiting.
- Exit if getch() returns with an error other than EINTR. Otherwise
  systat(1) may get stuck in an infinite loop if it doesn't receive
  SIGHUP when terminal closes. [1]
- Remove attempt to clear stdio error indicators. getch() doesn't use
  stdio, making it useless. [2]
- Remove unneeded masking of getch() return value. [2]

PR:		bin/107171
Reviewed by:	bde
Approved by:	trasz (mentor)
Obtained from:	OpenBSD [1]
Suggested by:	bde [2]
MFC after:	1 month
2009-10-11 12:32:25 +00:00
Robert Watson
ad71fe3c35 Correct a number of evolved problems with inp_vflag and inp_flags:
certain flags that should have been in inp_flags ended up in inp_vflag,
meaning that they were inconsistently locked, and in one case,
interpreted.  Move the following flags from inp_vflag to gaps in the
inp_flags space (and clean up the inp_flags constants to make gaps
more obvious to future takers):

  INP_TIMEWAIT
  INP_SOCKREF
  INP_ONESBCAST
  INP_DROPPED

Some aspects of this change have no effect on kernel ABI at all, as these
are UDP/TCP/IP-internal uses; however, netstat and sockstat detect
INP_TIMEWAIT when listing TCP sockets, so any MFC will need to take this
into account.

MFC after:      1 week (or after dependencies are MFC'd)
Reviewed by:    bz
2009-03-15 09:58:31 +00:00
John Baldwin
a0b9e7e332 Update top and systat for vfs.bufcache now being a long rather than an int. 2009-03-10 15:25:19 +00:00
Xin LI
93b9f50404 ANSIfy and remove register.
Resulting binary verified with strip(1)+md5(1).
2008-01-16 19:27:43 +00:00
Xin LI
5abb148f43 - Handle the case where interface from "middle" is missing by
more carefully inspecting the return value from sysctl(3). [1]
 - Use calloc instead of malloc+memset of zero.

Submitted by:	Alexander Chernikov <admin su29 net> [1]
PR:		bin/119581
MFC after:	2 weeks
2008-01-12 00:11:26 +00:00
Alexander Leidinger
9f05d312b3 Backout sensors framework.
Requested by:	phk
Discussed on:	cvs-all
2007-10-15 20:00:24 +00:00
Ruslan Ermilov
8f96b509a2 Bump document date for the last change. 2007-10-14 19:12:36 +00:00
Alexander Leidinger
99f6b270e3 Import OpenBSD's sysctl hardware sensors framework.
This commit includes the following core components:

 * sample configuration file for sensorsd
 * rc(8) script and glue code for sensorsd(8)
 * sysctl(3) doc fixes for CTL_HW tree
 * sysctl(3) documentation for hardware sensors
 * sysctl(8) documentation for hardware sensors
 * support for the sensor structure for sysctl(8)
 * rc.conf(5) documentation for starting sensorsd(8)
 * sensor_attach(9) et al documentation
 * /sys/kern/kern_sensors.c
   o sensor_attach(9) API for drivers to register ksensors
   o sensor_task_register(9) API for the update task
   o sysctl(3) glue code
   o hw.sensors shadow tree for sysctl(8) internal magic
 * <sys/sensors.h>
 * HW_SENSORS definition for <sys/sysctl.h>
 * sensors display for systat(1), including documentation
 * sensorsd(8) and all applicable documentation

The userland part of the framework is entirely source-code
compatible with OpenBSD 4.1, 4.2 and  -current as of today.

All sensor readings can be viewed with `sysctl hw.sensors`,
monitored in semi-realtime with `systat -sensors` and also
logged with `sensorsd`.

Submitted by:	Constantine A. Murenin <cnst@FreeBSD.org>
Sponsored by:	Google Summer of Code 2007 (GSoC2007/cnst-sensors)
Mentored by:	syrinx
Tested by:	many
OKed by:	kensmith
Obtained from:	OpenBSD (parts)
2007-10-14 10:45:31 +00:00
Jeff Roberson
b61ce5b0e6 - Move all of the PS_ flags into either p_flag or td_flags.
- p_sflag was mostly protected by PROC_LOCK rather than the PROC_SLOCK or
   previously the sched_lock.  These bugs have existed for some time.
 - Allow swapout to try each thread in a process individually and then
   swapin the whole process if any of these fail.  This allows us to move
   most scheduler related swap flags into td_flags.
 - Keep ki_sflag for backwards compat but change all in source tools to
   use the new and more correct location of P_INMEM.

Reported by:	pho
Reviewed by:	attilio, kib
Approved by:	re (kensmith)
2007-09-17 05:31:39 +00:00
Ruslan Ermilov
8be3f374a7 - Stop computing %CPU for the imaginary idle process; we now
have real idle processes for that.

- Fix the display on SMP by not scaling the sum of %CPU down
  to 1.  Instead, display raw data as computed by the kernel,
  like in top(1).

Reviewed by:	bde
Approved by:	re (bmah)
MFC after:	1 week
2007-09-11 07:51:03 +00:00
John Baldwin
5900369697 Expand TCP counters from 9 digits to 12.
MFC after:	1 week
PR:		bin/112881
2007-06-15 18:12:58 +00:00
John Baldwin
595bf788f6 Consistently indent the R() macro for fields on the right-side of the
display to make the code easier to read.

PR:		bin/112881
2007-06-15 18:00:10 +00:00
John Baldwin
02a50a14b3 Add a new counter for retransmitted packets due to SACK.
PR:		bin/112881
Submitted by:	Phil Rosenthal <pr  isprime com>
2007-06-15 17:55:44 +00:00
Ruslan Ermilov
bc68fcf37c Fix definitions of kilobits etc.
PR:		bin/106116
Nudged by:	Rostislav Krasny
MFC after:	3 days
2007-01-18 09:24:08 +00:00
Yaroslav Tykhiy
499a1062fa Add missing things: a prototype and a const qualifier.
Found by:	WARNS=4
2006-12-23 22:39:38 +00:00
Yaroslav Tykhiy
c19a20a7d1 Dynamically resize the Disk column. It was too narrow for modern
disk device names such as da0s1b.  So we also get rid of the nasty
constant 5 scattered over the code.

Implementing this change is a good chance to improve other bits
around it: init saved lengths early, always check return value from
kvm_getswapinfo().
2006-12-23 18:54:49 +00:00
Yaroslav Tykhiy
d668a4922f Clear to EOL after the end of meter so that its reading can decrease. 2006-12-23 18:03:10 +00:00
Yaroslav Tykhiy
b20870dbb5 Make it possible for meter to reach 100% mark when swap is totally full. 2006-12-23 17:46:32 +00:00
Yaroslav Tykhiy
c1b118da86 Improve style:
- Don't define vars inside loops.
- Avoid useless casts.
- Use C idioms.
- Do alike things in a consistent way.
2006-12-23 17:02:09 +00:00
Yaroslav Tykhiy
aee701a96e Reposition the "(swap not configured)" sign WRT the new layout. 2006-12-23 16:48:29 +00:00
Yaroslav Tykhiy
a3600374b4 Eliminate a couple of screen coordinate variables
that were useless and just obfuscated the code.
2006-12-23 16:39:09 +00:00
Yaroslav Tykhiy
12912b5a4a Add some vertical whitespace for easier reading. 2006-12-23 16:31:06 +00:00
Yaroslav Tykhiy
cb059cfe92 Fix the swap display further:
1) Resize the Used column to avoid screen overflow if BLOCKSIZE is long.
2) Track the current swap configuration so that its changes don't break
   the display.

Suggested by:	bde (1)
2006-12-23 15:40:41 +00:00
Yaroslav Tykhiy
7fb2f46a48 Fix the Total line shown if there are >1 swap devices. 2006-12-23 14:30:50 +00:00
Yaroslav Tykhiy
1f4d2a1d84 Start fixing the "swap" display by saving one horizontal position.
Now the display won't overflow the 80-char row if BLOCKSIZE=1024.
The new spacing is also consistent with the "pigs" display.
2006-12-23 14:25:17 +00:00
Ruslan Ermilov
bad4d172b4 - Revert signedness type changes to "struct vmtotal"; by making
them unsigned I made the possible overflows hard to detect,
  and it only saved 1 bit which isn't principal, even less now
  that the underlying issue with the total of virtual memory has
  been fixed.  (For the record, it will overflow with >=2T of
  VM total, with 32-bit ints used to keep counters in pages.)

- While here, fix printing of other "struct vmtotal" members
  such as t_rq, t_dw, t_pw, and t_sw as they are also signed.

Reviewed by:	bde
MFC after:	3 days
2006-11-28 12:46:02 +00:00
Yaroslav Tykhiy
d3985f17d4 Back out rev. 1.17: arch-dependent WARNS level.
The policy is that the WARNS level should characterize the
quality of a piece of code irrespective of any conditions.
Otherwise the code doesn't deserve the WARNS level assigned.

Requested by:	ru
2006-11-27 21:30:38 +00:00
Yaroslav Tykhiy
65b02a0f4b Consistently mark percentage scales as such.
PR:		bin/101975
MFC after:	3 days
2006-11-27 20:19:05 +00:00
Yaroslav Tykhiy
c3d6542fd0 systat(1) reaches WARNS=6 on i386 and amd64. This is good
for catching general regressions in future.  Unfortunately,
it still displays some problems at WARNS=6 on architectures
with stricter alignment requirements, e.g., ia64.
2006-11-27 17:54:28 +00:00
Yaroslav Tykhiy
599cc46d95 The logic of fetchnetstat_sysctl() isn't too complex: if idx is 0,
we set and use xtp; if idx is 1, we set and use xip; the other cases
are impossible.  However, GCC cannot see that xip and xtp are always
initialized before use because they are initialized and used in
different if/else blocks.  So setting them to NULL at the very
beginning won't hurt.
2006-11-27 17:34:40 +00:00
Yaroslav Tykhiy
6549e8c62e + WARNS=4 reminds that nlist.n_name isn't const.
+ Use C99 initializers to be WARNS-clean.
+ The last element in a namelist should have its n_name set to NULL,
  not to an empty string.
2006-11-27 17:24:36 +00:00
Yaroslav Tykhiy
9540596e83 Don't discard a const qualifier from constant strings. 2006-11-27 17:01:31 +00:00
Yaroslav Tykhiy
2506efa78c Remove a wrong "const" qualifier.
Spotted by:	WARNS=6
2006-11-27 16:59:08 +00:00
Yaroslav Tykhiy
dfaa9125d8 Add the Tera scale factor, which is an easy job now.
More scale factors would overflow the command line where
the help for "scale" were shown.
2006-11-27 16:33:44 +00:00
Yaroslav Tykhiy
afe7b9fbb5 Stop exposing things that can be private to convtbl.c. 2006-11-27 16:23:09 +00:00
Yaroslav Tykhiy
aee371e363 Keep all convtbl-related constants and strings in convtbl.[ch]. 2006-11-27 16:14:32 +00:00
Yaroslav Tykhiy
f5d4751c8a Allow for large scale factors. C99 warrants that
ULLONG_MAX is not less than 2^64-1; and uintmax_t
cannot be more narrow than unsigned long long.
This allows for scale factors up to Exa inclusively.

Use plain int for the scale index to be consistent
with ifcmds.c and enum.
2006-11-27 15:26:26 +00:00
Yaroslav Tykhiy
41af362198 Return back one initializer, it is needed. 2006-11-27 15:14:50 +00:00
Yaroslav Tykhiy
f301488570 + Drop useless initializers.
+ style(9).
2006-11-27 15:11:30 +00:00
Yaroslav Tykhiy
ce1bff762d Drop useless #includes. 2006-11-27 14:48:46 +00:00
Yaroslav Tykhiy
0230383747 Use C99 initializers so that we don't really have to worry
about the order of related things at several places.
2006-11-27 14:18:54 +00:00
Yaroslav Tykhiy
ab5c9a0d0a C can enumerate things for us. 2006-11-27 14:16:40 +00:00
Yaroslav Tykhiy
00603ea268 There is no reason to use __inline here because we are rather far
from a path critical to performance.
2006-11-26 20:14:47 +00:00
Yaroslav Tykhiy
a3736d312c Don't overflow from the gigabyte scale to the bit scale if the
number to auto-scale is >= 1024 Gb.  Could be triggered on arches
where ifdata counters had 64 bits.

Reported by:	Miroslav Slavkov on -net
MFC after:	3 days
2006-11-26 20:08:40 +00:00
Yaroslav Tykhiy
91857186f2 The real contents of this file were repeated twice.
The repetition was harmless due to a usual #ifndef _FOO_H_ wrapper.
Fortunately, nobody started to hack the second copy,
so just remove it from the file.

MFC after:	3 days
2006-11-26 19:25:10 +00:00
Ruslan Ermilov
20739dfa44 Fix the format specifier suitable for uintmax_t. 2006-11-23 11:51:23 +00:00
Ruslan Ermilov
5c88a11e6e - Fix types of "struct vmmeter" members so they are unsigned.
- Fix overflow bugs in sysctl(8), systat(1), and vmstat(8)
  when printing values of "struct vmmeter" in kilobytes as
  they don't necessarily fit into 32 bits.  (Fix sysctl(8)
  reporting of a total virtual memory; it's in pages too.)
2006-11-20 16:04:41 +00:00
Ruslan Ermilov
c01e1768d9 Memory utilization subscreen in "vmstat" display lists numbers in KB,
not in number of pages.

PR:		docs/71690
Submitted by:	Jan Srzednicki

(A patch is only partially merged, the rest was already fixed by bde@
in rev. 1.51.)
2006-10-12 10:54:34 +00:00
Yaroslav Tykhiy
2cc3124e10 Obey MK_INET6_SUPPORT. 2006-07-27 14:20:14 +00:00
Robert Watson
df3e013b3e Remove MT_FTABLE printout in systat, as MT_FTABLE mbufs are no longer
used in the kernel.
2006-07-24 01:49:24 +00:00
Brad Davis
eaa9b5ef09 s/on a crt//
systat is working great on this LCD ;)

Submitted by:	Ben Haga <tuximus AT absoludicrous DOT com>
MFC after:	3 days
2006-05-25 06:05:04 +00:00
Bruce Evans
04984aac91 For the vmstat sub-display:
vmstat.c:
Move totfr to be under daefr and prcfr since it logically belongs there.

Move all the count fields (wire, act, inact, cache and free) to near
the bottom of the sub-display (after all the rate fields) to reduce
competition with adjoining sub-displays.

systat.1:
Move things as above.

Attempt to improve missing and poor wording in the description of the
fields.  The long sentence was hard to parse and didn't say anything
about the different units.

Increment .Dd.
2006-05-01 07:02:52 +00:00
Bruce Evans
74a2149c90 Unbreak the support for 24-row terminals in the vmstat display. The
part that handled the 17th and 18th rows of the vmstat-proper subdisplay
was deleted in rev.1.10 when these rows stopped being used and was not
restored when the 17th row was used again.  For such terminals, we now
lose the `buf' field instead of making a mess with it.  Terminals with
fewer than 24 rows have never been supported.

The problem is not avoided by using curses since we use the last line
for data entry and don't use a separate subwindow for this line.
Some other things in the vmstat display could be handled better using
subwindows.
2006-05-01 00:26:43 +00:00
Bruce Evans
1247d9c61c Sort the ex-extended vmstat fields into their documented order in the
output too.

Fine tune all coordinates and most field widths in the vmstat (sub)display
for this and previous changes now that we have to change almost all of them
just to move the ex-extended fields:
- change VMSTATROW back to 7.  It was 6 due to a hack in the extended vm
  stats changes.
- reduce the maximum field width that we try for from 9 to 8.  4 or 5 is
  enough for most fields but we try to use the same width for all fields.
  8 is enough to display everything without changing units memory sizes
  exceed 100GB.

Fix some unrelated coordinates and field widths in comments.
2006-04-30 23:52:16 +00:00
Bruce Evans
de9a857e4c Eliminate the "extended" vm stats. Move all fields in the extended
vm stats to the normal vm stats.  Sort them into the normal stats
according to the man page only in the source code so that diffs are
almost readable.  Reduce style bugs in printing the value of %ozfod.
2006-04-30 22:34:54 +00:00
Bruce Evans
71ae810140 Update for moving some fields to the new vnstat display.
Don't say that `cache' is for the buffer cache.

Describe the uselessnes of `buf'.
2006-04-30 22:05:02 +00:00
Bruce Evans
9177eda617 Reduce the namei (sub)display by 5 columns to make enough space for a
new vnstat display to the right of the namei display.

Move the non-vmstat fields {des,num,fre}vn from the vmstat display to a
new vnstat display.  Move the dtbuf field there too.  The buf and dtbuf
fields are non-vmstat and non-vnstat, so there is no good place to
display them.  I need to move at least 1 of them out of the vm stats
for further cleanups of the vm stats, and there is only space for 1
of them in the vn stats.  (The best place for the current buf field
is actually /dev/null, since it has been completely broken for about
10 years and broken for longer.  It gives an uninteresting virtual
memory count where an interesting real memory count is wanted.)
2006-04-30 20:31:00 +00:00
Bruce Evans
b16f944633 Removed the description of the nonexistent want_fd command. want_fd existed
for only 2 weeks in 1998-1999.  It was replaced by general commands to
select the set of disk drives displayed.
2006-04-30 09:23:11 +00:00
Bruce Evans
3bccedcdf8 Don't redraw the disk names on every update. This was apparently done
to handle changes to the set of disks selected, but it is unnecessary
for that since the whole screen is redrawn when this set is changed.
It was also buggy:
- MAXDRIVES*6 = 42 was hard-coded as only 30 spaces in a string literal,
  the last 2 disk names were not cleared as intended
- when the extended vmstats are active, clearing of even 30 columns
  overruns the ozfod value field by 3 columns.  This was harmless because
  the field is much wider than necessary.
2006-04-30 09:13:59 +00:00
Bruce Evans
6e977072c6 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.
2006-04-30 07:27:23 +00:00
Bruce Evans
43f2757a27 If DEBUG is defined, then fill numeric fields with asterisks instead of
spaces and numbers for temporary(?) debugging.
2006-04-30 05:54:21 +00:00
Bruce Evans
a9a3dcd64f Remove trailing whitespace.
Submitted by:	Se=E1n Farley <sean-freebsd at farley dot org>
PR:		bin/81874
2006-04-30 04:47:23 +00:00
Bruce Evans
8aa22952a9 Show the load average in the tcp display (it was already shown, perhaps
not very usefully, in all other displays).  This was the original point
of the PR.

Move the load average up by 2 so that it starts in row 0 for all windows
(2 lines above it were wasted for all other windows except vmstat).
Move everything below it up by 2 or 3 (3 for icmp and icmp6 which had
an extra blank line due from not compensating for the foot-shooting in
note (3); only ip and ip6 compensated).  Reduce the magic numbers related
to this.

Notes by the submitter:
%%%
1. All the subwin() calls are identical using #define MAINWIN_ROW 3
    (systat.h).
2. The load average is at the top of the window.
3. Each display starts on the fourth line.  I made changes to those
    displays that shifted the start line (i.e., icmp).  This entailed a
    lot of changes within the comments at the top of those displays.
4. For ip6, I shifted the "Input next-header histogram" column down one
    row to separate it from "IPv6 Output".  I raised "bad scope packets"
    and "address selection failed" up one row to stay with "IPv6 Input"
    (valid?).  They were down one row to probably line up at the bottom,
    but I think they should stick with their fellow items in a column.
5. I condensed ifstat a bit.  It had a lot of empty rows.
%%%

Submitted by:	Se=E1n Farley <sean-freebsd at farley dot org>
PR:		bin/81874
2006-04-30 04:26:46 +00:00