summaryrefslogtreecommitdiff
path: root/usr.bin/top
AgeCommit message (Collapse)Author
2015-11-05allow "kill" from top, by using proc instead of idMarc Espie
(event though the documentation does not yet state that proc allows setpriority for renice) Problem found by me, tweak suggested by theo buehler Committed prompted by deraadt@
2015-11-04replace setbuf with setvbuf, from Frederic NowakTed Unangst
2015-10-30top renice command requires pledge "id", from Michael LesniewskiTheo de Raadt
2015-10-26remove the silly username cache here and use libc user_from_uid.Ted Unangst
libc isn't (yet) any better, but it can improve with time.
2015-10-26print uptime too. ok deraadtTed Unangst
2015-10-25need "getpw" pledge; spotted by matthieuTheo de Raadt
2015-10-23With new pledge "ps" and "vminfo" requests, ps/top/w become possible.Theo de Raadt
2015-08-20Do not cast result of malloc/calloc/realloc* if stdlib.h is in scopeTheo de Raadt
ok krw millert
2015-05-06Display thread IDs instead of the name of the process's owner when "-H"Martin Pieuchot
is used. The rationnal is that when you're looking at threads you're generally already filtereing by PID and this allow you to see which thread is a pig. Written some time ago with mikeb@ ok sthen@, krw@, guenther@
2015-02-28Reduce usage of predefined strings in manpages.Anthony J. Bentley
Predefined strings are not very portable across troff implementations, and they make the source much harder to read. Usually the intended character can be written directly. No output changes, except for two instances where the incorrect escape was used in the first place. tweaks + ok schwarze@
2015-01-19Kill loadavg.h and just use the fscale value directly.Todd C. Miller
There's no need for crazy casts of p_pctcpu in ORDERKEY_PCTCPU since kinfo_proc exports it as uint32_t. OK deraadt@
2015-01-19like in ps(1), fetch the FSCALE value using sysctl rather than usingTheo de Raadt
the header version ok guenther
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-11-27All cpus -> N CpusMarc Espie
"makes sense" theo
2014-09-17try to document that the -1 option will be selected by default if moreDavid Gwynne
than 8 cpus are detected in the system.
2014-09-17be more explicit about what '1' toggles betweenDavid Gwynne
2014-09-17if there are more than 8 cpus, default to combined cpu stats (likeDavid Gwynne
you passed -1 on the command line). ok kettenis@ tedu@
2014-09-15Remove non-standard <sys/dkstat.h> header. It has not contained anythingMiod Vallat
related to disk stastics for almost 17 years, and the remaining userland-visible defines duplicate those found in <sys/sched.h>. Move the remaining _KERNEL defines to <sys/tty.h> where they belong, and update all users to cope with this. ok kettenis@
2014-09-08obvious cases of missing .An;Ingo Schwarze
found with the new mandoc(1) MANDOCERR_AN_MISSING warning; no text changes
2014-07-16zap trailing newlines; "go for it" deraadtOkan Demirmen
2014-07-04Track whether a process is a zombie or not yet fully built via flagsPhilip Guenther
PS_{ZOMBIE,EMBRYO} on the process instead of peeking into the process's thread data. This eliminates the need for the thread-level SDEAD state. Change kvm_getprocs() (both the sysctl() and kvm backends) to report the "most active" scheduler state for the process's threads. tweaks kettenis@ feedback and ok matthew@
2014-04-08Use VM_UVMEXP instead of VM_METER for memory usages and directlyMartin Pieuchot
include <sys/vmmeter.h> where it is needed instead of relying on it being included by <uvm/uvm_extern.h>. miod@ likes it, ok guenther@
2014-04-07Just exit if we get an error or HUP when poll()ing the keyboard.Todd C. Miller
Otherwise, top may spin when its tty goes away. OK deraadt@
2014-01-14getnstr() returns KEY_RESIZE if there was a pending resize event, so loopPhilip Guenther
until it stops returning that, resetting the cursor position each time. hint from Gregor Best (gbe (at) ring0.de) problem noted by and ok sthen@
2013-11-28unsigned char for ctypeTheo de Raadt
ok krw okan
2013-09-21more reasonable MAX_COLS for modern displaysMarc Espie
(5 arrays of that size, so we're talking a data increase of 2.5K) okay otto@
2013-04-02Handle big time_tPhilip Guenther
ok deraadt@
2013-03-23wchan is no longer exposed, just check if wmesg is not empty.Ted Unangst
(wmesg hasn't itself been a pointer since conversion to kinfo_proc.) noticed by sthen. ok deraadt jsing millert sthen
2013-01-14Remove an unnecessary function castPhilip Guenther
ok jsing@
2013-01-14When showing threads, say so. Fix up some comments and names at the same time.Philip Guenther
original diff by zhuk@ ok jsing@ mpi@ zhuk@
2012-12-18We no longer use struct eproc for kinfo_proc in sysctl.h so thereTodd C. Miller
is no direct need for sys/proc.h or sys/resource.h. Some consumers of kinfo_proc need these for the proc flags and rlimit defines like RLIM_INF so add the appropriate includes to them. OK deraadt@ sthen@
2012-12-05Remove excessive sys/cdefs.h inclusionTheo de Raadt
ok guenther millert kettenis
2012-07-09According to miod, KERNBASE used as a userland symbol should dieTheo de Raadt
in a fire. Start by removing the definitions, before we clean the headers later.
2012-06-08Add checks for command line input (or the TOP environment var)lum
ommitted from 1.78. Now a $ top -U -username -U username command will behave the same as interactive mode. ok brynet@
2012-06-06tweak previous;Jason McIntyre
2012-06-05Add support for hiding a user's processes in top.Bryan Steele
feedback & ok lum@
2012-04-21Remove a check made superfluous by the KERN_PROC_SHOW_THREADS flag.Philip Guenthe
This lets new binaries work (at least w/o the -H option) with old kernels. ok pirofti@ deraadt@
2012-04-20Silence warnings. Okay deraadt@.Paul Irofti
2012-04-17Make it optional for kvm_getprocs() (and related sysctl) to returnPaul Irofti
thread information. Add a KERN_PROC_SHOW_THREADS flag that has to be set in order to get the thread info and make it off by default. This creates backwards compatibility for applications that relied on a given size/number of items to be returned. Modify ps(1) and top(1) accordingly. Okay guenther@.
2012-04-15Move the check for a <0 number of process display_lines to a better place.lum
This makes: This terminal can only display -N processes. a thing of the past.
2012-04-12Add per thread accounting, mainly for usage & friends.Paul Irofti
This expands the already bloated FILL_KPROC macro to take an extra parameter that indicates if the callee is a thread or a process. The userland bits are adjusted accordingly and ps(1) and top(1) now display per thread usage times when -H is used. Also pkill(1) had to be adjusted so that duplicates don't pop up. libkvm does basically the same thing as the kernel bits. Okay guenther@.
2011-12-16Use H to make top show process threads, instead of the current T. This isJoel Sing
consistent with our ps(1) and top(1) on other operating systems. ok deraadt@ mikeb@ millert@
2011-07-12print out the amount of memory used for cache. ok ottoTed Unangst
2011-04-10Switch back from KERN_PROC2/kinfo_proc2 to KERN_PROC/kinfo_proc nowPhilip Guenthe
that we've got name we want for the API we want "ZAP!" deraadt@
2011-03-25clarify the description of the `1' command;Jason McIntyre
from David Vasek and Glen Anderson
2010-08-10add a description for bsd.sp where appropriate; while here, writeIgor Sobrado
"multiprocessor" in a consistent way. written with lots of good advice from jmc@, who noted that changing hier(7) was not enough and carefully reviewed this diff. ok jmc@
2010-04-26more portable codeTheo de Raadt
2010-04-24delete two extra ; that got inserted somewhere along the lineTheo de Raadt
2010-04-23mention hostname, prompted by lum@Otto Moerbeek
2010-04-23show hostname in header line; ok lum@ phessler@Otto Moerbeek