summaryrefslogtreecommitdiffstats
path: root/usr.bin/top
Commit message (Collapse)AuthorAgeFilesLines
* - Document the -H option and 'H' key alongside other options and keysjhb2011-05-311-4/+0
| | | | | | | | | | | rather than at the bottom of the manpage. - Remove an obsolete comment about SWAIT being a stale state. It was resurrected for a different purpose in FreeBSD 5 to mark idle ithreads. - Add a comment documenting that the SLEEP and LOCK states typically display the name of the event being waited on with lock names being prefixed with an asterisk and sleep event names not having a prefix. MFC after: 1 week
* Add a new option to toggle the display of the system idle process (per-CPUjhb2011-05-311-0/+7
| | | | | | | | | | | idle threads). The process is displayed by default (subject to whether or not system processes are displayed) to preserve existing behavior. The system idle process can be hidden via the '-z' command line argument or the 'z' key while top is running. When it is hidden, top more closely matches the behavior of FreeBSD <= 4.x where idle time was not accounted to any process. MFC after: 2 weeks
* Add missing header file.pluknet2011-05-201-0/+1
| | | | MFC after: 1 week
* Touch up the sample memory usage numbers a bit, to avoid wrappingkeramida2011-01-231-3/+6
| | | | | | | | | on terminal boundary. While here add definition for 'G' and fix the indentation of 'K' units. Submitted by: plunket PR: docs/153614 MFC after: 3 days
* Memory stats are reported in bytes, not pages.brucec2010-11-131-10/+10
| | | | | | PR: docs/151283 Submitted by: Bas Smeelen <b.smeelen at ose.nl> MFC after: 3 days
* Build usr.bin/ with WARNS=6 by default.ed2010-01-021-0/+2
| | | | Also add some missing $FreeBSD$ to keep svn happy.
* Update top and systat for vfs.bufcache now being a long rather than an int.jhb2009-03-101-1/+1
|
* Right align the CPU column header.rpaulo2008-12-261-2/+2
|
* Make the CPU column in top always be 2 characters and print in decimaljhb2008-10-011-3/+3
| | | | | | rather than hex. Requested by: rwatson
* Display the sum of the runtime of all the threads in a process when it'ssepotvin2008-09-121-0/+1
| | | | | | | | multithreaded instead of picking the time of the first thread found. Reviewed by: jhb Approved by: kan (mentor) MFC after: 1 month
* system_info.cpustates isn't sparse, so a bitmask of available CPU statesru2008-04-111-2/+0
| | | | is redundant (I think it's a leftover from an older implementation).
* Allocate enough memory for pcpu_cp_time[] to stop sysctl() fromru2008-04-111-1/+1
| | | | | writing outside of array bounds. This fully fixes -P display on i386, where kern.cp_times prints zeroes for non-existing CPUs.
* Fix "top -P" (`&' mistyped as `&&' and a botched logic).ru2008-04-101-2/+3
| | | | | | | | | The bug was unnoticed on non-i386 because mp_maxid is initialized differently, kern.cp_times doesn't print zeroes for non-existing CPUs, so no "writing outside of array bounds" happens. MFC after: 3 days
* Use calloc() when requesting zero'ed memory allocation rather than rollingdelphij2008-01-291-8/+4
| | | | our own.
* Add a -P flag to display per-cpu cpu usage stats.peter2008-01-181-5/+95
|
* Improve -u (limit uid lookups) behavior.obrien2008-01-091-2/+8
| | | | | Submitted by: David Frascone <dave@frascone.com> PR: 119490
* Introduce a way to make pure kernal threads.julian2007-10-261-48/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | kthread_add() takes the same parameters as the old kthread_create() plus a pointer to a process structure, and adds a kernel thread to that process. kproc_kthread_add() takes the parameters for kthread_add, plus a process name and a pointer to a pointer to a process instead of just a pointer, and if the proc * is NULL, it creates the process to the specifications required, before adding the thread to it. All other old kthread_xxx() calls return, but act on (struct thread *) instead of (struct proc *). One reason to change the name is so that any old kernel modules that are lying around and expect kthread_create() to make a process will not just accidentally link. fix top to show kernel threads by their thread name in -SH mode add a tdnam formatting option to ps to show thread names. make all idle threads actual kthreads and put them into their own idled process. make all interrupt threads kthreads and put them in an interd process (mainly for aesthetic and accounting reasons) rename proc 0 to be 'kernel' and it's swapper thread is now 'swapper' man page fixes to follow.
* - Move all of the PS_ flags into either p_flag or td_flags.jeff2007-09-171-1/+1
| | | | | | | | | | | | | | - 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)
* Inactive pages don't have to be dirty plus improve description ofru2007-09-021-2/+3
| | | | | | | the cache queue. Submitted by: alc Approved by: re (kensmith)
* Fix the description of the "Cache" memory and clarify theru2007-09-011-2/+2
| | | | | | | description of the "Inact" memory. (They count pages in the cache/inactive page queues, respectively.) Approved by: re (kensmith)
* Third stage of unbreaking printing of pseudo-nice values (realtimebde2007-06-151-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | priorities, etc.) in the NICE field: Use a combination of pri_native and pri_user instead of pri_level to guess the original realtime priority. Using pri_level here has been wrong since 2001/02/12. Using only pri_native here would be correct if the kernel actually initialized it reasonably. (The kernel exports its raw td_base_priority as pri_native, but userland mostly wants a refined base priority). Give up on waiting pri_native to work correctly and only use it when there is nothing better (for kthreads). This should reduce printing of bizarre pseudo-nice values. Bizarre values are still printed if we observe a transient borrowed priority for a kthread (transient borrowing is the main thing that makes the raw td_base_priority almost useless in userland), or if there is a kernel bug. One current kernel bug involves the kernel idprio thread pagezero permanently changing its priority from PRI_MAX_IDLE (255) to PUSER (160). Then the bizarre value "ki-6" is printed instead of "ki31". Here "-6" is PRI_MIN_IDLE - PUSER = -64 truncated to 2 characters. We are observing a transient borrowed priority that has become permanent due to a bug. ps/print.c:priorityr() needs similar changes (including ones in stage 2 here).
* - Add a new 'j' switch and runtime option to toggle display jail id forrafan2007-04-171-10/+47
| | | | | | | | | | each process. - While I'm here, keep help message sorted by keys PR: 98489, 98975 Submitted by: clsung Approved by: delphij (mentor) MFC after: 2 weeks
* - Add new 'a' switch and runtime option that allows 'top' to display processstas2007-04-141-3/+70
| | | | | | | | | titles extracted from argv vector instead of the real executable names. This is useful when you want to watch applications that set their status information via setproctitle(3). Approved by: alfred MFC after: 2 weeks
* The sigconv.awk script generates a sigdesc.h header file, whichkeramida2006-12-012-55/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | contains a sigdec[] vector of structures, but the generated output is missing braces around the initializer of each struct, which triggers warnings in WARNS=3: src/usr.bin/top/sigdesc.h:10: warning: missing braces around initializer src/usr.bin/top/sigdesc.h:10: warning: (near initialization for `sigdesc[0]') * Fix the sigconv.awk script to generate a header with initializers which look better. * Add rules to usr.bin/top/Makefile that rebuilds a new sigconv.h header which matches the correct signal set from the build-time version of `${DESTDIR}/usr/include/signal.h' (so sigconv.h doesn't get stale once changes are made to the header). * Remove the old sigconv.h header, now that it is autoupdated at build time. * Various Makefile style fixes (the committed Makefile was kindly submitted by Ruslan): - Reorder .PATH, PROG, SRCS and CFLAGS to match style.Makefile(5) - Split off the generated sources (sigdesc.h top.local.h) in an SRCS+= line of their own. - Add entries to CLEANFILES near the rules that generate the respective files. - Move the explicit rule which builds top.1 after the implicit rules which generate its dependencies. Reviewed by: ru, bde Submitted by: ru (Makefile) MFC after: 2 weeks
* Second stage of unbreaking thr formatting of the NICE field: decode thebde2006-11-071-15/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | priority class and use this to: - print "-" instead of a garbage value for ithreads. Print "-" instead of the unused nice value for kthreads which are (mis)classified as PRI_TIMESHARE. For such threads, the nice value can be set to nonzero by root, but it is never used (at least by the 4bsd scheduler). For ithreads, we didn't even print the unused value. - print "i<priority>" and "r<priority>" instead of a biased "<priority>" for idletime and realtime threads, Here <priority> is the priority parameter to idprio/rtprio(1). Just add the prefix and remove the bias for now. <priority> has been stored indirectly in the kernel since 2001/02/12, and even the kernel cannot recover the original value in all cases. Here we need to handle more cases than pri_to_rtp(), but actually handle fewer cases, and end up printing garbage after a thread changes its current priority while in the kernel. - for idletime and realtime threads, if they are kthreads then add a prefix of "k" to the previous string. - for idletime and realtime threads, if they in the FIFO scheduling class then add a suffix of "F" to the previous string (if it fits; the other parts of the string are sure to fit unless <priority> is garbage).
* Fix display of idle processes, which had been broken since rev. 1.56 ofse2006-06-111-1/+2
| | | | | | | | | | | machine.c. The traditional condition was (pctcpu > 0 || SRUN), but the negation of the condition logic (from select to skip) made this come out as (pctcpu > 0 && SRUN), leading to a very erratic display, except for purely CPU bound processes. This has been discussed in the mail lists some time ago and I have used top with this patch on my systems for more than a year without problems (just forgot to commit it earlier, since my systems were all fixed ...).
* Move the formatting of the NICE column to a new function format_nice()bde2006-05-041-20/+30
| | | | | | | | so that it can be more easily unbroken and extended. Try to use `static', `const' (as appropriate), prototypes declared together, and parameter names in prototypes for all private functions, not just the new one.
* Fixed some style bugs (mainly missing and wrong splitting of long lines).bde2006-05-041-48/+54
|
* (1) Revert unnecessary indentation changes I committed as part of thekeramida2005-05-181-11/+9
| | | | | | | last version and (2) remove a disabled debugging fprintf() that I accidentally committed here. Noticed by: simon (2)
* Merge the CPU and WCPU columns in a single %6.2f column, add a new 'C'keramida2005-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)
* Hardcode username to 8 characters. This makes top(1) output sane whenobrien2005-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
* Reduce the width of the THR column to 4 characters, to avoid wrap-aroundkeramida2005-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
* - Add a THR column to the process listing, that shows the number ofkeramida2005-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>
* Include <string.h> and <strings.h> for various functions.stefanf2005-04-041-0/+2
|
* This patch merges the sort fields for both pages, so you can (foralfred2004-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
* Comment some of the 'io' functions.alfred2004-08-011-0/+29
|
* Adjust the show_self code (the test got inadvertantly reversed a couple ofdes2004-07-121-3/+3
| | | | | | revisions ago) Submitted by: Alex Vasylenko <lxv@omut.org>
* Cache a pointer to the old proc (as well as negative cache) to makealfred2004-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.
* Build upon the nice work of Alfred and add sorting capabilities tokeramida2004-07-081-3/+77
| | | | | | the -m "io" mode of top. Approved by: alfred
* Additional preemptive unsigned -> signed casts.des2004-07-051-4/+4
|
* ki_pctcpu is unsigned, so we cast to long before subtracting.des2004-07-051-1/+1
|
* Unhealthy amount of manual code cleanup. Some long lines still remain.des2004-07-051-187/+143
|
* Apply consistent indentation. Long lines will be fixed in a separatedes2004-07-051-544/+543
| | | | commit.
* Protoize.des2004-07-051-45/+19
|
* Sort out the #include mess. In particular, do not #include "os.h", sincedes2004-07-051-18/+10
| | | | all it does is provide broken prototypes for standard library functions.
* Mechanical whitespace cleanup.des2004-07-051-26/+25
|
* My previous commit fixed uid filtering, but broke io mode. Unravel thedes2004-07-051-35/+49
| | | | process filtering logic to prevent this from happening again.
* Fix selecting processes by uid, which was broken in the previous commit.des2004-07-051-1/+1
|
* Tell what percentage of the total IO a process is doing.alfred2004-07-011-5/+37
| | | | TODO: Show system totals.
* New feature, provide a display that shows the amount of IO processesalfred2004-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.
OpenPOWER on IntegriCloud