summaryrefslogtreecommitdiffstats
path: root/usr.bin/systat
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Back out rev 1.20; getbsize(3)'s original interface has been restored.mike2002-12-301-3/+1
| | | | Approved by: markm
* english(4) police.schweikh2002-12-271-2/+2
|
* Adjust for getbsize argument type change.markm2002-10-231-1/+3
|
* Remove unneeded function prototypes.markm2002-10-231-3/+0
|
* Widen struct sockbuf's sb_timeo member to int from short. Withjdp2002-07-241-4/+4
| | | | | | | | | | | | | non-default but reasonable values of hz this member overflowed, breaking NFS over UDP. Also, as long as I'm plowing up struct sockbuf ... Change certain members from u_long/long to u_int/int in order to reduce wasted space on 64-bit machines. This change was requested by Andrew Gallatin. Netstat and systat need to be rebuilt. I am incrementing __FreeBSD_version in case any ports need to change.
* ^Z suspends any and all programs that don't do anything special aboutkeramida2002-07-151-3/+0
| | | | | | it. There's really no reason to explicitly mention it here. Suggested by: Mark Valentine <mark@thuvia.demon.co.uk>
* ^Z doesn't "stop" systat, but it "suspends" it.keramida2002-07-151-1/+1
| | | | | PR: docs/40489 Submitted by: Dave McCammon <davemac11@yahoo.com>
* debug.{numvnodes,freevnodes} moved to vfs.des2002-06-061-2/+2
|
* Replace /kernel with /boot/kernel/kernel.joe2002-05-091-2/+2
| | | | | PR: docs/37757 Submitted by: Hiten Pandya <hiten@uk.FreeBSD.org>
* Use `The .Nm utility'charnier2002-04-201-2/+3
|
* Remove previously unneeded and now incorrect cast of user_from_uid()dwmalone2002-04-131-7/+7
| | | | | to a char *. Fix up vendor ID.
* unifdef __STDC__imp2002-03-231-16/+1
|
* remove __Pimp2002-03-227-111/+111
|
* Remove NO_WERRORs and WARNS=n's. To be revisited after GCC3.markm2002-02-081-1/+0
|
* WARNS=2 fixes with NO_WERROR set, as there are some header issuesmarkm2001-12-1222-404/+437
| | | | with namelists. use __FBSDID().
* Remove the 'irq' string from the irqN part of the "interrupts" display.markm2001-12-011-2/+10
| | | | This allows us to see the irq number when device names ate too long.
* Add #include <net/route.h> in order to get this to compile.jlemon2001-11-221-0/+2
| | | | | Spotted by: David Wolfskill Forgotten by: me
* Compensate for "Compensate for header dethreading" by backing it out.bde2001-10-101-1/+0
|
* Remove greatly outdated comment that systat(1) takes 2-10% of the CPU time.sobomax2001-10-091-1/+0
| | | | This isn't true nowadays.
* Re-enable mbtypes statistics in the mbuf allocator. I disabled thesebmilekic2001-09-301-32/+31
| | | | | | | | | | | | | | | | | when I changed the allocator bits. This implements per-CPU mbtypes stats by keeping net number of decrements/increments of a given mbtype per-CPU and then summing all of the per-CPU mbtypes to produce the total net number of allocated mbufs of the given mbtype. Counters are carefully balanced to avoid/prevent underflows/overflows. mbtypes stats are re-enabled with the idea that we may occasionally (although very rarely) observe slight inconsistencies in the stat reporting. Most of the time, we should be fine, though. Also make appropriate modifications to netstat(1) and systat(1) to do the necessary reporting. Submitted by: Jiangyi Liu <jyliu@163.net>
* Convert systat(1) to use the new devstat interface.ken2001-09-063-53/+46
| | | | Submitted by: "Sergey A. Osokin" <osa@freebsd.org.ru>
* - Do not handle the per-CPU containers in mbuf code as though the cpuidsbmilekic2001-07-261-8/+5
| | | | | | | | | | | | | | | | | were indices in a dense array. The cpuids are a sparse set and treat them as such, setting up containers only for CPUs activated during mb_init(). - Fix netstat(1) and systat(1) to treat the per-CPU stats area as a sparse map, in accordance with the above. This allows us to properly boot with certain CPUs disactivated. However, if we later decide to re-activate said CPUs, we will barf until we decide to implement CPU spinon/spinoff callback hooks to allow for said CPUs' per-CPU containers to get configured on their activation. Reported by: mjacob Partially (sys/ diffs) Submitted by: mjacob
* Remove whitespace at EOL.dd2001-07-151-8/+8
|
* mdoc(7) police: removed HISTORY info from the .Os call.ru2001-07-101-1/+1
|
* mdoc(7) police: sort SEE ALSO xrefs (sort -b -f +2 -3 +1 -2).ru2001-07-061-3/+3
|
* Make sure to try hw.ncpu if kern.smp.cpus doesn't exist (i.e. on UP) whenbmilekic2001-06-231-1/+2
| | | | getting number of CPUs.
* Introduce numerous SMP friendly changes to the mbuf allocator. Namely,bmilekic2001-06-221-22/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | introduce a modified allocation mechanism for mbufs and mbuf clusters; one which can scale under SMP and which offers the possibility of resource reclamation to be implemented in the future. Notable advantages: o Reduce contention for SMP by offering per-CPU pools and locks. o Better use of data cache due to per-CPU pools. o Much less code cache pollution due to excessively large allocation macros. o Framework for `grouping' objects from same page together so as to be able to possibly free wired-down pages back to the system if they are no longer needed by the network stacks. Additional things changed with this addition: - Moved some mbuf specific declarations and initializations from sys/conf/param.c into mbuf-specific code where they belong. - m_getclr() has been renamed to m_get_clrd() because the old name is really confusing. m_getclr() HAS been preserved though and is defined to the new name. No tree sweep has been done "to change the interface," as the old name will continue to be supported and is not depracated. The change was merely done because m_getclr() sounds too much like "m_get a cluster." - TEMPORARILY disabled mbtypes statistics displaying in netstat(1) and systat(1) (see TODO below). - Fixed systat(1) to display number of "free mbufs" based on new per-CPU stat structures. - Fixed netstat(1) to display new per-CPU stats based on sysctl-exported per-CPU stat structures. All infos are fetched via sysctl. TODO (in order of priority): - Re-enable mbtypes statistics in both netstat(1) and systat(1) after introducing an SMP friendly way to collect the mbtypes stats under the already introduced per-CPU locks (i.e. hopefully don't use atomic() - it seems too costly for a mere stat update, especially when other locks are already present). - Optionally have systat(1) display not only "total free mbufs" but also "total free mbufs per CPU pool." - Fix minor length-fetching issues in netstat(1) related to recently re-enabled option to read mbuf stats from a core file. - Move reference counters at least for mbuf clusters into an unused portion of the cluster itself, to save space and need to allocate a counter. - Look into introducing resource freeing possibly from a kproc. Reviewed by (in parts): jlemon, jake, silby, terry Tested by: jlemon (Intel & Alpha), mjacob (Intel & Alpha) Preliminary performance measurements: jlemon (and me, obviously) URL: http://people.freebsd.org/~bmilekic/mb_alloc/
OpenPOWER on IntegriCloud