aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/top
Commit message (Collapse)AuthorAgeFilesLines
* top: improve sort field storage/lookupKyle Evans2025-08-095-71/+142
| | | | | | | | | | Switch up comparator mapping to avoid these kinds of errors, use a simple array of (name, comparator) pairs rather than having to maintain entries in two separate arrays that must have matching indices. Reviewed by: obiwac MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D37083
* top.1: Fix incorrect default value for -s optionArtem Bunichev2025-07-241-1/+1
| | | | | | | | | The default delay between screen updates was incorrectly transfered from roff(7) register that was used in previous version of man page. Reviewed by: ziaee Fixes: 9d6cce02a78c (initial pass to freebsdize) Differential Revision: https://reviews.freebsd.org/D51503
* top.1: Document the THR columnAlexander Ziaee2025-07-151-1/+2
| | | | | | | MFC after: 3 days Fixes: 32efd26355e2 (Add a THR column) Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D50754
* ps(1), top(1): Priority: Let 0 be the first timesharing levelOlivier Certner2025-06-181-1/+1
| | | | | | | | | | | | Change the origin from PZERO to PUSER. Doing so allows users to immediately detect if some thread is running under a high priority (kernel or realtime) or under a low one (timesharing or idle). MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation
* systat/top: Update ZFS sysctl namesAlexander Motin2025-05-251-3/+3
| | | | | | | Some of ARC statistic sysctls changed years ago, but those tools are still using legacy shims, that are going to be removed. MFC after: 3 days
* top.1: Add HISTORYAlexander Ziaee2025-04-191-0/+4
| | | | | | | | | top was added in 511d9c656578 for FreeBSD 2.2.2. MFC after: 3 days Reviewed by: carlavilla, imp, joerg Approved by: carlavilla (mentor) Differential Revision: https://reviews.freebsd.org/D49591
* top.1: top does not accept uidsAlexander Ziaee2025-04-191-2/+2
| | | | | | | MFC after: 3 days Reviewed by: carlavilla, imp Approved by: carlavilla (mentor) Differential Revision: https://reviews.freebsd.org/D49631
* top: Sync usage and synopsisAlexander Ziaee2025-03-282-3/+3
| | | | | | | | | | Switching between io and cpu sorting uses a great example in the usage. [-m io | cpu]. Use that everywhere. MFC after: 3 days Reviewed by: mhorne Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D49515
* top: Polish key bindings in usage and manualAlexander Ziaee2025-03-252-104/+105
| | | | | | | | | | | | | Organize key bindings by ascii(7) for consistency and maintainability, mark them as Interactive Commands, wordsmith them, and sync their organization between the manual and help screen. MFC after: 3 days PR: 282734 Fixes: c8aa5e526 (move command mapping to commands.c) Reviewed by: imp, mhorne, Jim Brown <jpb@jimby.name> Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D49462
* top: Make locale issues non-fatal.Dag-Erling Smørgrav2025-03-061-2/+2
| | | | | | | | | | | | If the `setlocale()` call fails, emit a warning and sleep briefly so the user has a chance to see the warning before we redraw the screen. Note that we have no way of knowing exactly what is wrong, but at least we can suggest that they check their environment. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D49230
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* usr.bin/top: fix displaying load average for loads of at least 100Piotr Kubaj2024-05-221-2/+2
| | | | | | | | | | After top registers load average of at least 100 which then gets reduced to below 100, there are left stray digits. Supporting load over 100 requires increasing the width only to 6, but since we support over 1000 CPU's now, let's increase it to 7. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45284
* top: Avoid printing a blank line when the ZFS ARC is emptyMark Johnston2024-01-111-5/+15
| | | | | PR: 275994 MFC after: 2 weeks
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-161-1/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-1613-26/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* top(8): restore erronously removed SWAIT array elementKonstantin Belousov2023-06-211-0/+1
| | | | | | | | | due to bad rebase. Noted by: kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Fixes: 6a5e6a50bd55c3fb4933abe1edaad3a928700c42ESC
* top(8): add missed SLOCK state to the sorted_state[]Konstantin Belousov2023-06-211-1/+1
| | | | | | | | | | Put it near/after the sleep state. Noted by: Mark Millard <marklmi@yahoo.com> Reviewed by: kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D40607
* top(8): document the actual sort order for process sortingKonstantin Belousov2023-06-211-3/+3
| | | | | | | | Noted by: Mark Millard <marklmi@yahoo.com> Reviewed by: kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D40607
* top(8): use designated initializers for sorted_state[]Konstantin Belousov2023-06-211-7/+6
| | | | | | | | | | | Also correct comments for individual state, duplicating the S* constants descriptions from sys/proc.h [*]. Reviewed by: kevans (previous version) Noted by: Mark Millard <marklmi@yahoo.com> [*] Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D40607
* top(8): designate the sorted_state[] array as constantKonstantin Belousov2023-06-211-1/+1
| | | | | | | Reviewed by: kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D40607
* top: Use a cpuset_t to represent a CPU maskMark Johnston2023-05-261-10/+9
| | | | | | | The code attempts to detect holes in the CPU ID space, but previously this would only work for up to sizeof(long)*8 CPUs. MFC after: 2 weeks
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-3/+3
|
* top: fix sorting by pid (-o pid)Kyle Evans2023-02-131-0/+1
| | | | | | | | | | | | | The 'pid' order was added, but the equivalent comparator was not back in 8b800d3af2d8c ("Add the PID column to the list of sort keys."). `ordernames` indices need to match `compares` indices in order for this to work. A future commit will restructure all of this to make it less error prone going forward (see D37083). MFC after: 3 days Reviewed by: pstef (D37083)
* top(1): Fix a typo in a source code commentGordon Bergling2022-04-021-1/+1
| | | | | | - s/accomodate/accommodate/ MFC after: 3 days
* top.1: Use the Dq macros instead of \*lq and \*rqMateusz Piotrowski2021-11-181-37/+107
| | | | MFC after: 3 days
* top.1: Improve description of -mMateusz Piotrowski2021-11-181-4/+10
| | | | | | Describe -m argument as "mode" instead of "display". MFC after: 3 days
* top: Sort flags in usage messageMateusz Piotrowski2021-11-181-2/+2
| | | | | | While here, fix the indentation of the second line in the message. MFC after: 3 days
* top.1: Sort options alphabeticallyMateusz Piotrowski2021-11-181-78/+77
| | | | | | While here, add a short sentence introducing the options. MFC after: 3 days
* top.1: Fix a typo in description of H interactive commandMateusz Piotrowski2021-11-181-2/+2
| | | | | | | | | B is listed as an interactive command to toggle the display of threads. This is a typo introduced during the conversion of the manual page to mdoc. Fixes: 9d6cce02a78c967e69b603d503545c4b43d7765f MFC after: 3 days
* ncurses: chase dependency changes in the source treeBaptiste Daroussin2021-10-041-1/+1
| | | | Differential Revision: https://reviews.freebsd.org/D32098
* top: Remove a duplicate extern declaration for show_args.John Baldwin2021-09-151-1/+0
| | | | | | | | This fixes a -Wnested-extern error with GCC 9. There is an existing extern declaration in top.h. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D31937
* top(1): indicate how to reset grep stringJohn Grafton2021-09-081-1/+1
| | | | | Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/536/files
* top(1): support command name and argument greppingJohn Grafton2021-06-297-1/+60
| | | | | | Obtained from: OpenBSD Reviewed by: imp@ Pull Request: https://github.com/freebsd/freebsd-src/pull/479
* top: VIS_SAFE turned out to be unsafeYuri Pankov2020-07-141-1/+1
| | | | | | | | | | | | | Unset VIS_SAFE flag as it turned out to be actually unsafe for continuos top display as it's passing through sequences resulting cursor movement (backspace, tab, carriage-return), and explicitly set VIS_TAB for the same reason. Reported by: Mark Millard <marklmi@yahoo.com>, swills Tested by: Mark Millard <marklmi@yahoo.com>, swills Notes: svn path=/head/; revision=363207
* top: do not try to use sysctl machdep.smp_active.Konstantin Belousov2020-06-281-4/+1
| | | | | | | | | | The sysctl was removed by r76078 in 2001. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=362711
* Fix up r359594: -m takes an argument.Mark Johnston2020-04-031-1/+1
| | | | | | | | | PR: 244153 Reported by: 0mp MFC with: r359594 Notes: svn path=/head/; revision=359597
* Fix the description of the -m flag in top.1.Mark Johnston2020-04-031-1/+1
| | | | | | | | | PR: 244153 Submitted by: fehmi noyan isi <fnoyanisi@yahoo.com> MFC after: 3 days Notes: svn path=/head/; revision=359594
* top: display battery capacity remainingPhilip Paeps2019-12-215-0/+31
| | | | | | | | | Submitted by: Antranig Vartanian <antranigv@freebsd.am> Reviewed by: imp, philip Differential Revision: https://reviews.freebsd.org/D22871 Notes: svn path=/head/; revision=355978
* Add a "B" suffix to memory quantities in top(1) output.Mark Johnston2019-11-181-5/+6
| | | | | | | | | | | | | Otherwise small quantities look nonsensical. For instance, when swapping in a single page we would print "4096 In". Fix code indentation while here. MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=354829
* Allow entering fractional delays in top(1) interactive mode.Dimitry Andric2019-09-271-4/+14
| | | | | | | | | | | This uses the same logic as with the -s option, first validating the entered value, then storing the result in a struct timeval. MFC after: 3 days X-MFC-With: r352818 Notes: svn path=/head/; revision=352819
* Make fractional delays for top(1) work for interactive mode.Dimitry Andric2019-09-272-24/+28
| | | | | | | | | | | | | | | | | In r334906, the -s option was changed to allow fractional times, but this only functioned correctly for batch mode. In interactive mode, any delay below 1.0 would get floored to zero. This would put top(1) into a tight loop, which could be difficult to interrupt. Fix this by storing the -s option value (after validation) into a struct timeval, and using that struct consistently for delaying with select(2). Next up is to allow interactive entry of a fractional delay value. MFC after: 3 days Notes: svn path=/head/; revision=352818
* Correct the final argument name in the top(1) manpage.Dimitry Andric2019-09-271-1/+1
| | | | | | | | | | | The description talks about 'number', while the final argument was 'count'. Since 'count' is already used for the count of displays, change the final argument name to 'number'. MFC after: 3 days Notes: svn path=/head/; revision=352804
* Impove wording and move descriptions aboutHiroki Sato2019-09-211-5/+10
| | | | | | | locale to LC_CTYPE in the ENVIRONMENT section. Notes: svn path=/head/; revision=352568
* top(1): support multibyte characters in command names (ARGV array)Daichi GOTO2019-09-205-29/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | depending on locale. - add setlocale() - remove printable() function - add VIS_OCTAL and VIS_SAFE to the flag of strvisx() to display non-printable characters that do not use C-style backslash sequences in three digit octal sequence, or remove it This change allows multibyte characters to be displayed according to locale. If it is recognized as a non-display character according to the locale, it is displayed in three digit octal sequence. Reference: https://www.mail-archive.com/svn-src-all@freebsd.org/msg165751.html https://www.mail-archive.com/svn-src-all@freebsd.org/msg165766.html https://www.mail-archive.com/svn-src-all@freebsd.org/msg165833.html https://www.mail-archive.com/svn-src-all@freebsd.org/msg165846.html https://www.mail-archive.com/svn-src-all@freebsd.org/msg165891.html Submitted by: hrs Differential Revision: https://reviews.freebsd.org/D16204 Notes: svn path=/head/; revision=352558
* Fix layout. -C needs to be styled as a flag here, not as a new list item.Tijl Coosemans2019-07-121-1/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=349957
* top(1): Don't show the swap line when there are no swap devicesAllan Jude2019-06-202-8/+23
| | | | | | | | | | | Submitted by: antranigv@freebsd.am Reviewed by: bapt MFC after: 1 month Sponsored by: Klara Systems Differential Revision: https://reviews.freebsd.org/D18928 Notes: svn path=/head/; revision=349235
* Fix regression in top(1) after r344381, causing informational messagesDimitry Andric2019-04-021-5/+11
| | | | | | | | | | | | | to no longer be displayed. This was because the reimplementation of setup_buffer() did not copy the previous contents into any reallocated buffer. Reported by: James Wright <james.wright@jigsawdezign.com> PR: 236947 MFC after: 3 days Notes: svn path=/head/; revision=345807