aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/top
Commit message (Collapse)AuthorAgeFilesLines
* MFC: Several top '-P' fixes originally from ru@. This fixes top -PJohn Baldwin2008-10-271-12/+7
| | | | | | | | | on i386. Approved by: re (kensmith) Notes: svn path=/releng/6.4/; revision=184363
* MFC: backport -P (per-cpu) stats for %user/%system/%idle etc.Peter Wemm2008-04-091-5/+95
| | | | Notes: svn path=/stable/6/; revision=178045
* MFC the top -j switch:Rong-En Fan2007-05-011-10/+48
| | | | | | | | | | | | | | | | | | - Add a new 'j' switch and runtime option to toggle display jail id for each process. src/contrib/top/commands.c: 1.13 src/contrib/top/machine.h: 1.8 src/contrib/top/top.X: 1.18 src/contrib/top/top.c: 1.21 and 1.22 (-j part) src/usr.bin/top/machine.c: 1.80 PR: 98489, 99631 Submitted by: clsung Approved by: delphij (mentor) Notes: svn path=/stable/6/; revision=169176
* MFC: 1.77 Fix logic for skipping of idle processes.Stefan Eßer2006-09-011-1/+2
| | | | Notes: svn path=/stable/6/; revision=161829
* (1) Revert unnecessary indentation changes I committed as part of theGiorgos Keramidas2005-05-181-11/+9
| | | | | | | | | | last version and (2) remove a disabled debugging fprintf() that I accidentally committed here. Noticed by: simon (2) Notes: svn path=/head/; revision=146343
* Merge the CPU and WCPU columns in a single %6.2f column, add a new 'C'Giorgos Keramidas2005-05-181-17/+23
| | | | | | | | | | | | | | command that toggles between the two and update the ORDER_PCTCPU() macro to sort correctly by the visible "cpu" value. This saves 6 more columns in 80-column terminals, making things a lot better for the COMMAND column. Tested on: i386, sparc64 (panther), amd64 (sledge) Approved by: davidxu (in principle) Notes: svn path=/head/; revision=146342
* Hardcode username to 8 characters. This makes top(1) output sane whenDavid E. O'Brien2005-05-161-7/+7
| | | | | | | | | | | | there are users on the system (even if not running a single process) with a login > 8 chars. I'm not all that happy limiting the username width like this, but it restores sanity to top(1) output. Discussed with: keramida Notes: svn path=/head/; revision=146291
* Reduce the width of the THR column to 4 characters, to avoid wrap-aroundGiorgos Keramidas2005-04-161-5/+5
| | | | | | | | | | | of lines in SMP machines (which are wider), until we have a better way of handling window sizes & columns in top. Caught by: ache, Andre Guibert de Bruet <andy@siliconlandmark.com> Point hat: keramida Notes: svn path=/head/; revision=145155
* - Add a THR column to the process listing, that shows the number ofGiorgos Keramidas2005-04-141-12/+57
| | | | | | | | | | | | threads a process has. The THR column is disabled and disappears when 'H' is hit, because then every thread gets its own output line. - Allow sorting processes by "threads". Approved by: davidxu Inspired by: Jiawei Ye <leafy7382@gmail.com> Notes: svn path=/head/; revision=145073
* Include <string.h> and <strings.h> for various functions.Stefan Farfeleder2005-04-041-0/+2
| | | | Notes: svn path=/head/; revision=144636
* This patch merges the sort fields for both pages, so you can (forAlfred Perlstein2004-08-161-37/+57
| | | | | | | | | | | example) view io stats while sorting by process size. Also adds voluntary and involuntary context-switch stats to the io page because there was lots of room. Submitted by: Dan Nelson dnelson at allantgroup.com Notes: svn path=/head/; revision=133817
* Comment some of the 'io' functions.Alfred Perlstein2004-08-011-0/+29
| | | | Notes: svn path=/head/; revision=132955
* Adjust the show_self code (the test got inadvertantly reversed a couple ofDag-Erling Smørgrav2004-07-121-3/+3
| | | | | | | | | revisions ago) Submitted by: Alex Vasylenko <lxv@omut.org> Notes: svn path=/head/; revision=132024
* Cache a pointer to the old proc (as well as negative cache) to makeAlfred Perlstein2004-07-121-2/+13
| | | | | | | | | computing the io statistics over and over not as expensive. This is a bit of a cop out, as I should just allocate a struct with the computed values, but this will do for now. Notes: svn path=/head/; revision=132015
* Build upon the nice work of Alfred and add sorting capabilities toGiorgos Keramidas2004-07-081-3/+77
| | | | | | | | | the -m "io" mode of top. Approved by: alfred Notes: svn path=/head/; revision=131829
* Additional preemptive unsigned -> signed casts.Dag-Erling Smørgrav2004-07-051-4/+4
| | | | Notes: svn path=/head/; revision=131628
* ki_pctcpu is unsigned, so we cast to long before subtracting.Dag-Erling Smørgrav2004-07-051-1/+1
| | | | Notes: svn path=/head/; revision=131627
* Unhealthy amount of manual code cleanup. Some long lines still remain.Dag-Erling Smørgrav2004-07-051-172/+128
| | | | Notes: svn path=/head/; revision=131626
* Apply consistent indentation. Long lines will be fixed in a separateDag-Erling Smørgrav2004-07-051-491/+490
| | | | | | | commit. Notes: svn path=/head/; revision=131623
* Protoize.Dag-Erling Smørgrav2004-07-051-45/+19
| | | | Notes: svn path=/head/; revision=131622
* Sort out the #include mess. In particular, do not #include "os.h", sinceDag-Erling Smørgrav2004-07-051-18/+10
| | | | | | | all it does is provide broken prototypes for standard library functions. Notes: svn path=/head/; revision=131621
* Mechanical whitespace cleanup.Dag-Erling Smørgrav2004-07-051-26/+25
| | | | Notes: svn path=/head/; revision=131620
* My previous commit fixed uid filtering, but broke io mode. Unravel theDag-Erling Smørgrav2004-07-051-35/+49
| | | | | | | process filtering logic to prevent this from happening again. Notes: svn path=/head/; revision=131619
* Fix selecting processes by uid, which was broken in the previous commit.Dag-Erling Smørgrav2004-07-051-1/+1
| | | | Notes: svn path=/head/; revision=131617
* Tell what percentage of the total IO a process is doing.Alfred Perlstein2004-07-011-5/+37
| | | | | | | TODO: Show system totals. Notes: svn path=/head/; revision=131412
* New feature, provide a display that shows the amount of IO processesAlfred Perlstein2004-07-011-3/+140
| | | | | | | | | are doing. Toggle this mode by hitting "m" or passing the command line option "-m io" to top(1). This allows one to identify disk bandwidth hogs much easier. Notes: svn path=/head/; revision=131402
* style, remove register.Alfred Perlstein2004-06-301-87/+69
| | | | Notes: svn path=/head/; revision=131310
* Do not use KERN_PROC_PROC with kvm_getproc(3); instead, if only processBrian Feldman2004-06-061-4/+17
| | | | | | | | | | | | | | (and not thread) scope is to be displayed, use KERN_PROC_ALL and accrue CPU% ourselves, as the kernel makes no attempt to do so. Of course, this doesn't make most stats any less bogus when displaying threaded processes, but at least the CPU time is added up and not just always 0.00%. There are still issues with SCHED_ULE in top(1) that cause other processes to display 0.00% CPU when they in fact have used more. Notes: svn path=/head/; revision=130163
* Changes to allow top to decide whether or not to show multiple threads perJulian Elischer2003-07-172-1/+7
| | | | | | | | | | process. Option -H enables it and it is toggled at the interactive screen by 'H'. Submitted by: Jung-uk Kim <jkim@niksun.com> Notes: svn path=/head/; revision=117709
* Remove #include <sys/dkstat.h>Poul-Henning Kamp2003-02-161-1/+0
| | | | Notes: svn path=/head/; revision=111002
* Catch up to SMTX -> SLOCK changes.John Baldwin2002-10-021-5/+5
| | | | Notes: svn path=/head/; revision=104388
* Replace various spelling with FALLTHROUGH which is lint()ablePhilippe Charnier2002-08-251-1/+1
| | | | Notes: svn path=/head/; revision=102412
* remove __PWarner Losh2002-03-221-4/+4
| | | | Notes: svn path=/head/; revision=92922
* Remove NO_WERRORs and WARNS=n's. To be revisited after GCC3.Mark Murray2002-02-081-2/+0
| | | | Notes: svn path=/head/; revision=90416
* Add new option HAVE_STRERROR to CFLAGS.David Malone2002-01-241-1/+1
| | | | Notes: svn path=/head/; revision=89759
* Protect this against the coming WARNS=2 default.Mark Murray2001-12-121-0/+2
| | | | Notes: svn path=/head/; revision=87713
* Compensate for "Compensate for header dethreading" by backing it out.Bruce Evans2001-10-101-1/+0
| | | | Notes: svn path=/head/; revision=84768
* Generate top.local.h and manpage dynamically, with sed(1) script.Ruslan Ermilov2001-07-122-72/+16
| | | | | | | | | The generated manpage will now describe the actual behavior of top(1) WRT how many processes it displays. This also eliminates all troff(1) warnings. Notes: svn path=/head/; revision=79636
* Cast size_t variables before printing them to cope with the case ofThomas Moestl2001-05-311-2/+2
| | | | | | | sizeof(size_t) != sizeof(int). Notes: svn path=/head/; revision=77553
* We don't need to include <sys/conf.h>Poul-Henning Kamp2001-05-231-1/+0
| | | | Notes: svn path=/head/; revision=77098
* Compensate for header dethreading.Mark Murray2001-05-011-0/+1
| | | | Notes: svn path=/head/; revision=76169
* Check the new kern.smp.active sysctl rather than the non-existentJohn Baldwin2001-04-271-1/+1
| | | | | | | smp.smp_active sysctl to determine if we are running on an SMP machine. Notes: svn path=/head/; revision=76079
* Correct the top memory stats display: convert page counts to kB.Thomas Moestl2001-03-201-0/+5
| | | | | | | | | Submitted by: Andrea Campi <andrea@webcom.it> Approved by: rwatson Pointy hat to: myself Notes: svn path=/head/; revision=74524
* Fix top(1) display for SMP systems where the username is longer than 14Will Andrews2001-03-121-1/+3
| | | | | | | | | | | characters. This should avoid unattractive wrapping for people who are stuck in an 80x24 screen. :-) PR: 22270 Submitted by: William Carrel <williamc@go2net.com> Notes: svn path=/head/; revision=74142
* - An array of 4 32-bit ints for avenrun doesn't work on the alpha becauseAndrew Gallatin2001-02-271-15/+7
| | | | | | | | | | | | | fscale is a (64-bit) long. So just use a struct loadavg. This fixes the recent failure of top on alphas: top: sysctl(vm.loadavg...) failed: Cannot allocate memory - use size_t for sizeof() so as to fix a few int/long warnings on alpha Reviewed by: Thomas Moestl <tmoestl@gmx.net> Notes: svn path=/head/; revision=73164
* Remove directive to install top as group kmem. Remove directive toRobert Watson2001-02-231-2/+1
| | | | | | | install top with setgid bit. Notes: svn path=/head/; revision=72952
* Adapt the top utility to not use kmem_read to retrieve variables nowRobert Watson2001-02-231-166/+43
| | | | | | | | | | | available via sysctl(). As a result, top should now be able to run without setgid kmem. Submitted by: Thomas Moestl <tmoestl@gmx.net> Reviewed by: freebsd-audit Notes: svn path=/head/; revision=72951
* Adjust columns for wide nicenesses in 'top -S'.Mark Murray2001-02-181-4/+4
| | | | Notes: svn path=/head/; revision=72647
* Catch up to new priority interface.Jake Burkholder2001-02-121-6/+6
| | | | Notes: svn path=/head/; revision=72377
* Catch up to proc flag change.John Baldwin2001-01-241-1/+1
| | | | Notes: svn path=/head/; revision=71589