summaryrefslogtreecommitdiffstats
path: root/usr.bin/systat
Commit message (Collapse)AuthorAgeFilesLines
* Removed the description of the nonexistent want_fd command. want_fd existedbde2006-04-301-2/+0
| | | | | for only 2 weeks in 1998-1999. It was replaced by general commands to select the set of disk drives displayed.
* Don't redraw the disk names on every update. This was apparently donebde2006-04-301-6/+0
| | | | | | | | | | | 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.
* Fix "slow (on-the-fly) zero fills percentage (`%slo-z')" some more. Thebde2006-04-302-4/+4
| | | | | | | | | | | | | | | | | | | 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.
* If DEBUG is defined, then fill numeric fields with asterisks instead ofbde2006-04-301-0/+15
| | | | spaces and numbers for temporary(?) debugging.
* Remove trailing whitespace.bde2006-04-3011-38/+38
| | | | | Submitted by: Se=E1n Farley <sean-freebsd at farley dot org> PR: bin/81874
* Show the load average in the tcp display (it was already shown, perhapsbde2006-04-3014-321/+325
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Edit the interrupt name strings to shorten them. This is believed tobde2006-04-301-2/+33
| | | | | | | | | | | | | | | | | | | only affect amd64 and i386. alpha uses "intr N" instead of "irqN" and mostly has no device names. ia64 uses only device names. - Edit interrupt names once after they are read from the kernel and not every time they are displayed. - Discard bogus trailing spaces so that the next step doesn't move things to oblivion. - If an interrupt name starts with "irqN:" (as it usually does in on amd64 and i386), then move "irqN" to the end and strip ":", since we have no space for the ":" and don't want to start descriptions with "N" after stripping "irq" in the next step (since "N" would look like a count). This step may need reworking for interrupt names containing several device names -- then moving the irq number to the end would lose it instead of losing some device names. - Remove "irq" from an interrupt name if and only if the original name is too long to display.
* Backed out rev.1.49 since it had buffer overruns and only workedbde2006-04-301-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | accidentally. Read buffer overruns: The size of the target array (TSOTTA == 10) is a wrong limit to use for scanning the source string. Write buffer overruns: TSOTTA is also a wrong limit to use for copying to the target buffer, since we want to add a NUL terminator afterwards. TSOTTA was also 1 too small for holding both the desired number of visible characters and the NUL. Worked accidentally: There is error in the algorithm that tends to result in the space saved by stripping "irq" not actually being used, but some cases worked accidentally provided "irqN" is near the end of the source string and "N" is only 1 digit. Starting with 5.mumble-CURRENT, "irqN" is at the beginning of the string on all (?) arches that have it and the accidents don't happen. E.g. on i386's, the keyboard irq is now named "irq1: atkbd0<bogus blank padding>" by the kernel, and this name was converted to "1: atkb" -- not only the device number but part of the device name has been lost --, while before 5.mumble the kernel name was "atkbd0 irq1" and systat accidentally preserved the irq number to give "atkbd0 1". The ":" in the string wastes precious space, and stripping "irq" results in descriptions starting with numbers which makes them look too much like counts. This commit just fixes the last problem.
* Abbreviate long field descriptors at write time so that they don't getbde2006-04-292-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | clobbered at runtime: dirtybuf -> dtbuf desiredvnodes -> desvn numvnodes -> numvn freevnodes -> frevn The vmstats column has only 5 characters available for descriptors, but up to 13 were used. The extras get clobbered at runtime by interrupt values and/or descriptors on systems with more than 12 interrupt sources. %slo-z -> %sloz This one is in the "extended" vmstats area and doesn't get clobbered now. Removed stale documentation of desvn. Changed a descriptor: tfree -> totfr so that it is consistent with the abbreviations for other free counts (daefr and prcfr) and thus almost decodeable. Fixed missing documentation of tfree/totfr. This and everything else in the extended vmstats area is misdocumented as being in a certain place in the vmstats column.
* add an entry for ozfod..jmg2006-03-181-0/+1
| | | | MFC after: 3 days
* fix spelling of ozfod... I've been wondering why we'd need to fill a pagejmg2006-03-181-1/+1
| | | | | | | w/ non-zero data, and it turns out we don't... This is really optimized zero filled on demand, or pages that were already zero'd for us... MFC after: 3 days
* Move the "r p d s w" fields to the left to create space for expansion.bde2006-02-141-25/+26
| | | | | | | | | | | | | | | | | | | | | | 3 columns were wasted at the left, except these columns were used to make the header line up. Now there is no space on the same line for the "Proc:" part of the header. Try putting this on the line above although it clutters that line (there is already similar clutter for the "Interrupts" header). Leave 1 column between these fields. With the above and a previous change there is enough of space for this. Use 5 columns instead of 3 for the number of users since 3 is not quite enough and there was space to spare. This also fixes an off-by-2 error in a previous fix forthe column count in the comment on STATROW. Move all the pager fields 1 to the right so that the "count" and "pages" descriptors more clearly apply to the pager fields and not the memory fields. There was space to space. Waste some of the spare space at the right of the pager fields to expand all the pager field widths to their old values (but now with a column between the fields). There are fields more in need of expansion but most of them are not in places near spare space.
* Removed the frobbing of CPU percentages from > 99.9 to 99.9. Rev.1.35bde2006-02-141-2/+0
| | | | | | | | | | | | made it unnecessary. (Rev.1.6 had to reduce the field width to 4, and changed 100.0 and preposterous larger values down to 99.9 since 100.0 wouldn't have fitted. Rev.1.35 handles precentages > 99.9 well enough by changing the format to %.0f when the string given by the initial format is too wide.) Even with this change, during short testing I've never seen a percentage of 100 being displayed by systat -v, although top(1) displays percentages of 100 user or 100 idle for similar loads.
* Fix some minor bugs:bde2006-02-141-13/+21
| | | | | | | | | | | | | | | Always use snprintf()'s return value, since discarding it is a style bug at best and using it here gives slightly simpler code and better error checking. Use snprintf() in putlongdouble() the same as in putfloat(). (1.25 changed most sprintf()'s to snprintf()'s to fix non-bugs without changing the logic to use the result of snprintf(); 1.27 restored one of the sprintf()s by cloning a stale version of putfloat().) Don't print a too-long field in the unlikely case that the fallback to M units in putint() leaves the field still too long. (The fallback to printing stars was lost in rev.1.58 when the fallback to M units was added.)
* Reduce the field width by 1 for many numeric fields so that most fieldsbde2006-02-141-39/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | cannot run into other fields or field descriptors. If the value is too large to fit in the field width, then the output format is adjusted so that the value (usually) fits, but with fields running together externally this adjustment usually didn't help. Mostly it doesn't matter to lose 1 digit of precision, but switching the output format is bad if it happens often or gives bogus units. The loss of width is most serious for fields near "Csw" (which are also the ones which must often ran together) since these have a high variance and large values relative to the possible field widths so the switch occurs more often now, and for the memory size fields where the switch gives the bogus units kKB or MKB. Now only the fields for r, p, d, s and w can run into each other. These fields have width 3, and 3 cannot be reduced to 2 without losing all precision when the value is between 100 and 999. Trim "pdwake" to "pdwak" at think time now that it doesn't get clobbered at runtime. The manpage doesn't need to be changed for this because it documents the clobbered descriptor, unlike for 4 other too-long descriptors which only get clobbered if there are lots of interrupt sources. Trim "% busy" to "%busy" since most other descriptors for percentages are spelled without the space and this change makes changing the widths of the %busy fields unnecessary.
* Oops, the "excessive" {} removed in the previous commit was neededbde2006-02-141-1/+3
| | | | | | around PUTRATE() because PUTRATE() only looked like a function -- it was multiple statements. Use "do {...} while(0)" as usual in PUTRATE() so that it is a single statement that can be used like a function.
* Fixed all (?) bitrot in the comments about the number of columns used bybde2006-02-141-8/+8
| | | | various groups of fields.
* Fix all (?) cases where the field width of a numeric field was far toobde2006-02-141-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | large. In most cases it is still 1 too large, so fields tend to run together, but in the following cases it was more than 1 too large, and the starting column was too small too, so the field started inside the previous field or descriptor and clobbered that: - "wire": the number for this overwrote 2 characters of the number for "Flt". Reduce the field width by 3 (2 to avoid the overwrite and 1 so that the fields don't run together). This was already done for the preceding number for "cow". - "inact": the number for this overwrote 1 character of the descriptor "Idle". Reducing the field width by 2 is enough. - "cache:" the number for this overwrote 3 characters of the scale "...| |". The field width should be reduced by 4 to keep things from running together, but that is a lot and not so necessary here since the final "|" in the scale serves as a delimiter. Only reduce it by 3. - "free": the number for this overwrote 2 characters of the bar graph. The character position under the final "|" in the scale is apparently not used, so reducing the field width by 3 is enough. When "zfod" is in the main vmstat display: - use the normal field width of 9 (not 5) for it since there is no shortage of space. Fix style bugs (excessive {}) in the statement that conditionally writes it. Write all reduced field widths for vmstat fields as "9 - <reduction>" as a hint that we don't want to reduce them.
* Fixed style bugs in rev.1.12. Rev.1.12 arranged to display the interruptbde2006-02-141-7/+7
| | | | | | | | | | | | number in more cases by stealing 2 characters from the count field to give more space in the descriptor field, but it did the column adjustments for this strangely using an off-by-2 error in the base column and compensating off-by-2 errors in 6 offsets from the base column (4 new errors and 2 from not changing the offsets that actually changed). Print the "Interrupts" header directly at its offset from the base column instead of spacing it half using the offset and half by printing a space character.
* Fix all the spelling mistakes I could find in the man pages for wordskeramida2005-07-311-1/+1
| | | | | | | | that have at least 3 characters. MFC after: 1 week Thanks to: Music band ``Chingon'' for keeping me company while searching for these.
* Interlink systat(1), iostat(8) and vmstat(8) through their SEE ALSOkeramida2005-05-261-0/+1
| | | | sections, so that users of one can learn about the others easily.
* Include systat.h for cmdtab, to make gcc4 happy.delphij2005-05-021-0/+1
|
* Remove unused variables.stefanf2005-04-091-1/+0
|
* Fix an overflow when calculating the number of kilobytes from theps2005-02-211-1/+1
| | | | | | number of pages. Obtained from: Yahoo!
* simply ignore unknown address family.ume2005-02-191-3/+1
| | | | MFC after: 1 week
* teach IPv6 to `systat -netstat'.ume2005-02-191-29/+122
| | | | | Tested by: kuriyama MFC after: 1 week
* Sort sections.ru2005-01-181-11/+11
|
* Consistently use __inline instead of __inline__ as the former is an empty macrostefanf2004-07-041-1/+1
| | | | in <sys/cdefs.h> for compilers without support for inline.
* Deal with double whitespace.ru2004-07-031-6/+6
|
* Mechanically kill hard sentence breaks.ru2004-07-021-40/+79
|
* Removed trailing whitespace.ru2004-07-021-1/+1
|
* Bring in mbuma to replace mballoc.bmilekic2004-05-311-41/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mbuma is an Mbuf & Cluster allocator built on top of a number of extensions to the UMA framework, all included herein. Extensions to UMA worth noting: - Better layering between slab <-> zone caches; introduce Keg structure which splits off slab cache away from the zone structure and allows multiple zones to be stacked on top of a single Keg (single type of slab cache); perhaps we should look into defining a subset API on top of the Keg for special use by malloc(9), for example. - UMA_ZONE_REFCNT zones can now be added, and reference counters automagically allocated for them within the end of the associated slab structures. uma_find_refcnt() does a kextract to fetch the slab struct reference from the underlying page, and lookup the corresponding refcnt. mbuma things worth noting: - integrates mbuf & cluster allocations with extended UMA and provides caches for commonly-allocated items; defines several zones (two primary, one secondary) and two kegs. - change up certain code paths that always used to do: m_get() + m_clget() to instead just use m_getcl() and try to take advantage of the newly defined secondary Packet zone. - netstat(1) and systat(1) quickly hacked up to do basic stat reporting but additional stats work needs to be done once some other details within UMA have been taken care of and it becomes clearer to how stats will work within the modified framework. From the user perspective, one implication is that the NMBCLUSTERS compile-time option is no longer used. The maximum number of clusters is still capped off according to maxusers, but it can be made unlimited by setting the kern.ipc.nmbclusters boot-time tunable to zero. Work should be done to write an appropriate sysctl handler allowing dynamic tuning of kern.ipc.nmbclusters at runtime. Additional things worth noting/known issues (READ): - One report of 'ips' (ServeRAID) driver acting really slow in conjunction with mbuma. Need more data. Latest report is that ips is equally sucking with and without mbuma. - Giant leak in NFS code sometimes occurs, can't reproduce but currently analyzing; brueffer is able to reproduce but THIS IS NOT an mbuma-specific problem and currently occurs even WITHOUT mbuma. - Issues in network locking: there is at least one code path in the rip code where one or more locks are acquired and we end up in m_prepend() with M_WAITOK, which causes WITNESS to whine from within UMA. Current temporary solution: force all UMA allocations to be M_NOWAIT from within UMA for now to avoid deadlocks unless WITNESS is defined and we can determine with certainty that we're not holding any locks when we're M_WAITOK. - I've seen at least one weird socketbuffer empty-but- mbuf-still-attached panic. I don't believe this to be related to mbuma but please keep your eyes open, turn on debugging, and capture crash dumps. This change removes more code than it adds. A paper is available detailing the change and considering various performance issues, it was presented at BSDCan2004: http://www.unixdaemons.com/~bmilekic/netbuf_bmilekic.pdf Please read the paper for Future Work and implementation details, as well as credits. Testing and Debugging: rwatson, brueffer, Ketrien I. Saihr-Kesenchedra, ... Reviewed by: Lots of people (for different parts)
* Include <sys/proc.h> for the definition of PS_INMEM instead ofbde2004-04-141-3/+2
| | | | | | depending on namespace pollution in <sys/user.h>. Reduced nearby include messes.
* Fix the easy warnings:dwmalone2004-03-096-40/+27
| | | | | | | | | 1) Avoid shadowing index. 2) Constness. 3) Missing prototype for ifcmd. 4) Missing include of string.h. 5) Avoid shadowing error function. 6) ANSI definition for main.
* Demangled vendor ids. Fixed misplaced FreeBSD id.bde2004-02-251-6/+9
|
* Backed out rev.1.6. A bogus include was added to work around breakage ofbde2004-02-251-2/+0
| | | | | | <netinet/tcp_var.h>'s prerequisites. Prerequistes should not grow for userland headers, and <netinet/tcp_var.h> is unfortunately still needed in userland.
* Put libdevstat before libkvm, because the former depends on the latter.ru2004-02-041-2/+2
|
* Make systat -net aware of compressed time_wait sockets.silby2003-12-241-3/+11
|
* Copy cur's snap_time to last when refreshing statistics. Fixes problemtjr2003-11-011-0/+2
| | | | | | | | where MB/s and tps statistics would always be zero, presumably because they were being averaged out over the time between now and when the system booted instead of a few seconds. PR: 58683
* Use 'k' as suffix for Kilophk2003-10-241-1/+1
| | | | Pointed out by: several.
* When a numeric field overflows its width, try formatting the number inphk2003-10-202-6/+5
| | | | | 'kilo' or 'mega' with appropriate suffix instead of filling the field with stars.
* Add ip6 and icmp6 displays to systat.dwmalone2003-08-017-1/+632
| | | | MFC after: 2 weeks
* Let libdevstat calculate the device-busy % instead of home-rolling.phk2003-04-091-13/+5
|
* Run a revision of the devstat interface:phk2003-03-152-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kernel: Change statistics to use the *uptime() timescale (ie: relative to boottime) rather than the UTC aligned timescale. This makes the device statistics code oblivious to clock steps. Change timestamps to bintime format, they are cheaper. Remove the "busy_count", and replace it with two counter fields: "start_count" and "end_count", which are updated in the down and up paths respectively. This removes the locking constraint on devstat. Add a timestamp argument to devstat_start_transaction(), this will normally be a timestamp set by the *_bio() function in bp->bio_t0. Use this field to calculate duration of I/O operations. Add two timestamp arguments to devstat_end_transaction(), one is the current time, a NULL pointer means "take timestamp yourself", the other is the timestamp of when this transaction started (see above). Change calculation of busy_time to operate on "the salami principle": Only when we are idle, which we can determine by the start+end counts being identical, do we update the "busy_from" field in the down path. In the up path we accumulate the timeslice in busy_time and update busy_from. Change the byte_* and num_* fields into two arrays: bytes[] and operations[]. Userland: Change the misleading "busy_time" name to be called "snap_time" and make the time long double since that is what most users need anyway, fill it using clock_gettime(CLOCK_MONOTONIC) to put it on the same timescale as the kernel fields. Change devstat_compute_etime() to operate on struct bintime. Remove the version 2 legacy interface: the change to bintime makes compatibility far too expensive. Fix a bug in systat's "vm" page where boot relative busy times would be bogus. Bump __FreeBSD_version to 500107 Review & Collaboration by: ken
* mdoc(7) police: Scheduled sweep.ru2003-02-241-2/+1
|
* Add #include <sys/resource.h>phk2003-02-163-0/+3
|
* Remove #include <sys/dkstat.h>phk2003-02-164-4/+0
|
* Make 'sysctl vm.vmtotal' work properly using updated patch from Hiten.dillon2003-01-111-1/+1
| | | | | | | (the patch in the PR was stale). PR: kern/5689 Submitted by: Hiten Pandya <hiten@unixdaemons.com>
* Add "ifstat" display:phk2003-01-048-2/+785
| | | | | | | | | | | | | | | ifstat Display the network traffic going through active interfaces on the system. Idle interfaces will not be displayed until they receive some traffic. For each interface being displayed, the current, peak and total statistics are displayed for incoming and outgoing traffic. By default, the ifstat display will automatically scale the units being used so that they are in a human-read- able format. The scaling units used for the current and peak traffic columns can be altered by the scale command. Submitted by: Trent Nelson <trent@arpa.com>
* When we close a display, mark it as not-initialized so that we willphk2003-01-041-0/+1
| | | | | | properly open it again next time. Submitted by: Trent Nelson <trent@arpa.com>
OpenPOWER on IntegriCloud