aboutsummaryrefslogtreecommitdiff
path: root/contrib/top
Commit message (Collapse)AuthorAgeFilesLines
* top(1): Migrate top to usr.binEitan Adler2018-05-1940-8383/+0
| | | | | | | | | | | | | | | | We've been maintaining top(1) for a long time, and the upstream hasn't existed/been used in similarly as long. Make it clear that we own top(1) Tested with 'make universe'. Everything passed except MIPS which failed for unrelated reasons. Install also tested for amd64. Reviewed by: sbruno No objections: imp, mmacy Differential Revision: https://reviews.freebsd.org/D15387 Notes: svn path=/head/; revision=333898
* top: fix warnings from clang/gccKurt Lidl2018-04-184-35/+26
| | | | | | | | | | | | | | | Add includes for <curses.h> and <termcap.h> where necessary, and rename a few internal functions to have a "top_" prefix to avoid clashes with standard names from curses.h/termcap.h headers. Top now compiles without warnings on both gcc and clang. Reviewed by: emaste, imp, jhb MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15115 Notes: svn path=/head/; revision=332671
* top: use __mips__ and __NetBSD__ for consistencyEd Maste2017-08-231-1/+1
| | | | | | | | | | | | r322767 fixed the mips64 build failure with Clang with a minimal change to use __FreeBSD__ instead of FreeBSD in a #if test. For consistency and to facilitate possible upstreaming change the other macros in the test to their canonical form. Discussed with: jhb Notes: svn path=/head/; revision=322820
* Fix FreeBSD-presence macro to fix the build on mips with clang.John Baldwin2017-08-211-1/+1
| | | | | | | | | GCC doesn't define 'mips' which is why it doesn't trip over this. Sponsored by: DARPA / AFRL Notes: svn path=/head/; revision=322767
* Enhance top(1) to filter on multiple usernamesPietro Cerutti2017-08-073-31/+114
| | | | | | | | | | | Reviewed by: cognet, bapt Approved by: cognet MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D11840 Notes: svn path=/head/; revision=322139
* Add -w to usage string.Dag-Erling Smørgrav2017-05-201-1/+1
| | | | | | | | Reported by: Jamie Landeg-Jones <jamie@catflap.org> MFC after: 1 week Notes: svn path=/head/; revision=318587
* Provide proper contemporary function prototypes for many of the functionsRobert Watson2017-03-262-14/+16
| | | | | | | | | | | | | | | | | implemented in top(1), rather than relying on K&R prototypes, which can cause problems on targets where there are multiple incompatible calling conventions and the compiler requires argument information to select the correct one. (There's a bit more to do here, since it looks like top(1) also sometimes provides prototypes for various curses functions rather than relying on the header file...) Sponsored by: DARPA, AFRL MFC after: 1 week Notes: svn path=/head/; revision=315990
* Add ZFS compressed ARC stats to top(1)Allan Jude2017-03-175-0/+64
| | | | | | | | | | | | | | | | | | | | | Provides: amount of compressed data logical size of compressed data (how much it would have taken uncompressed) compression ratio (logical size : total ARC size) Overhead (space consumed for compression headers) Example output: ARC: 31G Total, 18G MFU, 9067M MRU, 2236K Anon, 615M Header, 2947M Other 25G Compressed, 54G Uncompressed, 1.76:1 Ratio, 2265M Overhead Reviewed by: jpaetzel, smh, imp, jhb (previous version) MFC after: 2 week Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D9829 Notes: svn path=/head/; revision=315435
* Add a toggle to display the approximate amount of swap used by eachDag-Erling Smørgrav2016-09-054-14/+40
| | | | | | | | | | | | process. We don't *quite* pull that number out of our backside, as the actual number is difficult to determine without modifying the VM system to report it, but it's still useful to get an idea of what's going on when a machine unexpectedly starts swapping. MFC after: 1 week Notes: svn path=/head/; revision=305414
* The readme provides a high-level overview of how to upgrade top(1).Enji Cooper2016-05-261-0/+22
| | | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D6493 MFC after: 1 week Reviewed By: ngie Submitted by: Randy Westlund <rwestlun@gmail.com> Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=300714
* Silence top(1) compiler warningsEnji Cooper2016-05-2213-54/+207
| | | | | | | | | | | | | | | | | | | | The contrib/top code is no longer maintained upstream (last pulled 16 years ago). The K&R-style followed by the code spews -Wimplicit-int and -Wreturn-type warnings, amongst others. This silences 131 warnings with as little modification as possible by adding necessary return types, definitions, headers, and header guards, and missing header includes. The 5 warnings that remain are due to undeclared ncurses references. I didn't include curses.h and term.h because there are several local functions and macros that conflict with those definitions. MFC after: 3 weeks Reviewed by: cem, ngie Submitted by: Randy Westlund <rwestlun@gmail.com> Differential Revision: https://reviews.freebsd.org/D6468 Notes: svn path=/head/; revision=300395
* Fixup include protections for building on mips64 with clangKurt Lidl2015-12-111-2/+2
| | | | | | | | | Reviewed by: sbruno, imp Approved by: rpaulo (mentor) Differential Revision: https://reviews.freebsd.org/D4457 Notes: svn path=/head/; revision=292110
* Move contrib/top/top.X to contrib/top/top.xs and moveMarcel Moolenaar2015-06-082-0/+0
| | | | | | | | | | | | contrib/top/top.local.H to contrib/top/top.local.hs. This fixes a build breakage when src is on a case- insensitive file system -- we never properly create top.x nor top.local.h. Change the makefile accordingly. MFC after: 3 days Notes: svn path=/head/; revision=284165
* add an assert in case the sizeof int ever becomes bigger.. Then we willJohn-Mark Gurney2015-02-111-0/+1
| | | | | | | | | have issues, at least we'll know where one of them are.. Submitted by: Erich Dollansky Notes: svn path=/head/; revision=278560
* - Add J command to help.Bryan Drewery2014-05-021-0/+1
| | | | | | | | MFC after: 2 weeks X-MFC-with: r265249 Notes: svn path=/head/; revision=265251
* - Add a hint for 'u' and 'J' command that '+' displays all.Bryan Drewery2014-05-021-2/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=265250
* Add -J command/flag to filter by jail name/jid. This will automaticallyBryan Drewery2014-05-023-5/+80
| | | | | | | | | | | | | display the JID as well (the -j command/flag). 0 displays host. + displays all. MFC after: 2 weeks Relnotes: yes Notes: svn path=/head/; revision=265249
* Bump MAX_COLS to 512 to take advantage of wider terminals.Rui Paulo2012-12-131-1/+1
| | | | Notes: svn path=/head/; revision=244180
* Add "pid" to the help menu (sort keys section).Rui Paulo2012-11-111-2/+2
| | | | Notes: svn path=/head/; revision=242888
* Add a new line to top that provides a brief summary of the ZFS ARC memoryJohn Baldwin2012-06-274-0/+55
| | | | | | | | | | | | | usage on hosts using ZFS. The new line displays the total amount of RAM used by the ARC along with the size of MFU, MRU, anonymous (in flight), headers, and other (miscellaneous) sub-categories. The line is not displayed on systems that are not using ZFS. Reviewed by: avg, fs@ MFC after: 3 days Notes: svn path=/head/; revision=237656
* In batch mode, exit after receiving SIGINT, instead of immediateKonstantin Belousov2012-03-071-0/+4
| | | | | | | | | | output of the next display. Submitted by: Andrey Zonov <andrey zonov org> MFC after: 1 week Notes: svn path=/head/; revision=232660
* Fix a race in top non-interactive mode. Use plain sleep(3) call insteadKonstantin Belousov2012-02-271-15/+1
| | | | | | | | | | | of arming timer and then pausing. If SIGALRM is delivered before pause(3) is entered, top hangs. Submitted by: Andrey Zonov <andrey zonov org> MFC after: 1 week Notes: svn path=/head/; revision=232239
* Rework the dynamic per-CPU stats code a bit. Always set 'statics->ncpus'John Baldwin2011-07-182-3/+15
| | | | | | | | | | | | | | | to the maximum number of CPUs to ensure that lcpustates[] array is always allocated to the maximum size. Previously, if top was started without per-CPU stats it would allocate a smaller lcpustates[] array. When per-CPU stats were then enabled, it would overflow the array and trash the cpustates_columns[] array causing the CPU stats to be printed in the wrong locations. Approved by: re (kib) MFC after: 1 week Notes: svn path=/head/; revision=224205
* Tweak the interactive description of CPU vs WCPU.John Baldwin2011-07-181-2/+2
| | | | | | | | | PR: bin/158819 Submitted by: arundel Approved by: re (kib) Notes: svn path=/head/; revision=224204
* Add a leading space to the status messages output after toggling theJohn Baldwin2011-07-111-2/+2
| | | | | | | | | | | | | 'C' and 'H' flags at runtime. This matches messages output for other toggles which leave the first column in the message blank to hold the cursor. PR: bin/158775 Submitted by: arundel MFC after: 3 days Notes: svn path=/head/; revision=223937
* Allow per-CPU statistics to be toggled at runtime via the 'P' key.John Baldwin2011-07-114-8/+37
| | | | | | | | | | While here, make -P a toggle similar to other options such as -I. Reviewed by: arundel MFC after: 1 week Notes: svn path=/head/; revision=223936
* Note that -a, -C, -H, -j, and -z are also toggles.John Baldwin2011-07-081-1/+6
| | | | | | | | | PR: bin/158682 Reported by: arundel MFC after: 3 days Notes: svn path=/head/; revision=223870
* Revert r214857 pursudant to 9.0-RELEASE cycle.Xin LI2011-06-202-11/+3
| | | | | | | Requested by: jh Notes: svn path=/head/; revision=223342
* - Document the -H option and 'H' key alongside other options and keysJohn Baldwin2011-05-311-2/+12
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=222532
* Add a new option to toggle the display of the system idle process (per-CPUJohn Baldwin2011-05-314-7/+27
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=222530
* Output an appropriate amount of padding to line up per-CPU state columnsJohn Baldwin2011-02-011-7/+11
| | | | | | | | | | | rather than using a terminal sequence to move the cursor when drawing the initial screen. Requested by: arundel MFC after: 3 days Notes: svn path=/head/; revision=218171
* Add 'jid' as a possible sort order to the help screen.Sergey Kandaurov2010-11-121-2/+4
| | | | | | | | | | PR: bin/150992 Submitted by: Frederic Culot <frederic at culot dot org> Approved by: avg (mentor) MFC after: 5 days Notes: svn path=/head/; revision=215186
* Inverse display of top(1)'s table header when running in inactive mode.Xin LI2010-11-062-3/+11
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=214857
* Since top displays the uptime including seconds, there is no need to add 30Rebecca Cran2010-08-171-1/+0
| | | | | | | | | | | | onto it, which may have been used for rounding purposes in other utilities. PR: bin/147934 Submitted by: Janne Snabb <snabb at epipe.com> Approved by: rrs (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=211419
* Make these files compile with clang.Rui Paulo2010-07-221-0/+1
| | | | | | | Submitted by: Dimitry Andric <dimitry at andric.com> Notes: svn path=/head/; revision=210386
* Fix brokenness in top on big-endian 32-bit systems introduced whenNathan Whitehorn2010-04-191-1/+1
| | | | | | | | | | changing format_k2 to take a long long. Because itoa is defined as a K&R C function, without prototyping its arguments, format_k2 passed a 64-bit value, but itoa() received only the first word, showing '0' in all memory fields. Notes: svn path=/head/; revision=206842
* Specify the parameter in the format_k2 prototype.Rebecca Cran2010-04-011-1/+1
| | | | | | | | | This fixes top on ARM, which assumes that format_k2 takes an int. Approved by: rrs (mentor) Notes: svn path=/head/; revision=206056
* Change the 'amt' parameter in format_k2 from int to unsigned long longRebecca Cran2010-03-131-1/+1
| | | | | | | | | | | | to match the values passed in and prevent the SIZE field being corrupted when more than 2TB is allocated. PR: bin/129706 Approved by: rrs (mentor) MFC after: 1 week Notes: svn path=/head/; revision=205119
* Let top(1) use MAXLOGNAME instead of UT_NAMESIZE.Ed Schouten2009-12-251-3/+3
| | | | | | | The maximum user login length should have nothing to do with <utmp.h>. Notes: svn path=/head/; revision=200979
* Explicitly line up the CPU state labels with the calculated starting columnJohn Baldwin2009-08-191-0/+2
| | | | | | | | | | | | that takes into account the width of the largest CPU ID. On systems with > 10 CPUs the labels for the first 10 CPUs were not lined up properly otherwise. Approved by: re (kib) MFC after: 1 week Notes: svn path=/head/; revision=196382
* Merge r183430 from vendor/top/dist to head/contrib/top, although withRobert Watson2009-03-101-0/+0
|\ | | | | | | | | | | | | | | | | | | | | | | record-only mergeinfo because an automated merge is confused by the flattening that took place: Move install to install-sh to prevent name-clashes. MFC after: 3 days Notes: svn path=/head/; revision=189618
| * Move install to install-sh to prevent name-clashes.Edwin Groothuis2008-09-281-0/+0
| | | | | | | | Notes: svn path=/vendor/top/dist/; revision=183430
* | Removed the no-op -p; documented -P.Ruslan Ermilov2008-06-212-7/+6
| | | | | | | | | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=179911
* | system_info.cpustates isn't sparse, so a bitmask of available CPU statesRuslan Ermilov2008-04-111-1/+0
| | | | | | | | | | | | | | is redundant (I think it's a leftover from an older implementation). Notes: svn path=/head/; revision=178116
* | Add a -P flag to display per-cpu cpu usage stats.Peter Wemm2008-01-185-39/+107
| | | | | | | | Notes: svn path=/head/; revision=175420
* | Improve -u (limit uid lookups) behavior.David E. O'Brien2008-01-091-1/+1
| | | | | | | | | | | | | | | | Submitted by: David Frascone <dave@frascone.com> PR: 119490 Notes: svn path=/head/; revision=175195
* | - s/jail id/jail ID/, acronyms should be in uppercase in general. Also,Rong-En Fan2007-05-044-5/+5
| | | | | | | | | | | | | | | | | | | | it is written this way in jail(8). Suggested by: brueffer Approved by: delphij (mentor, implicit) Notes: svn path=/head/; revision=169257
* | - Add documentation notes for the 'a' option, forgotten in the previousStanislav Sedov2007-05-032-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | commit. commands.c [1] top.X Suggested by: rafan [1] Notes: svn path=/head/; revision=169237
* | - Add new 'a' and 'j' options into usageRong-En Fan2007-04-191-1/+1
| | | | | | | | | | | | | | | | Approved by: delphij (mentor, implicit) Forgotten by: stas ('a') and rafan ('j') Notes: svn path=/head/; revision=168863
* | - Add a new 'j' switch and runtime option to toggle display jail id forRong-En Fan2007-04-174-8/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=168799