aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/top
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Fix more AddressSanitizer violations in usr.bin/topDimitry Andric2019-02-201-30/+24
| | | | | | | | | | | | | | | In line_update(), set lastcol correctly after moving to any non-zero column, so the "overwrite old stuff" part does not attempt to address negative offsets in the current line. Rewrite setup_buffer() to always allocate at least 80 characters, otherwise various calls to summary_format() will overwrite the end of the buffers, if the screen width gets small enough. MFC after: 1 week Notes: svn path=/head/; revision=344381
* Fix the first couple of AddressSanitizer violations in usr.bin/top.Dimitry Andric2019-02-101-4/+18
| | | | | | | | | | | Avoid setting zero bytes beyond the length of the 'thisline' parameters in i_process() and u_process(), and don't attempt to memset a negative number of bytes. MFC after: 1 week Notes: svn path=/head/; revision=343959
* Fix multiple warnings in usr.bin/top about variables shadowing globalDimitry Andric2019-02-103-10/+6
| | | | | | | | | declarations from base gcc, by renaming those variables. MFC after: 1 week Notes: svn path=/head/; revision=343958
* Fix multiple warnings in usr.bin/top about discarded qualifiers fromDimitry Andric2019-02-107-17/+12
| | | | | | | | | | both clang and gcc, by either constifying variables, or when that is not possible, using __DECONST. MFC after: 1 week Notes: svn path=/head/; revision=343957
* Fix top(1) long options handlingJustin Hibbits2019-01-181-1/+2
| | | | | | | | | | | | getopt_long(3) requires the long options be terminated by a NULL block. Without the terminator, an invalid long option results in a segmentation fault. Reported by: Brandon Bergren MFC after: 1 week Notes: svn path=/head/; revision=343165
* Add missing display messages when toggling modes.Mark Johnston2018-11-301-0/+9
| | | | | | | | | | PR: 233667 Submitted by: James Wright <james.wright@jigsawdesign.com> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18331 Notes: svn path=/head/; revision=341346
* top(1): Rework DESCRIPTION OF MEMORY section.Mateusz Piotrowski2018-10-021-52/+58
| | | | | | | | | | | | | | | | Due to markup issues, the DESCRIPTION OF MEMORY section is rather unreadable; rework it a bit, using subsections for different lines of the top output, and move it closer to description. While here, pet manlint ordering other sections as expected. Submitted by: Yuri Pankov <yuripv@yuripv.net> Reviewed by: eadler Approved by: re (gjb), krion (mentor) Differential Revision: https://reviews.freebsd.org/D17369 Notes: svn path=/head/; revision=339080
* Fix column alignment in per-thread mode.Mark Johnston2018-08-251-0/+2
| | | | | | | | | PR: 230872 Approved by: re (marius) MFC after: 1 week Notes: svn path=/head/; revision=338315
* top(1): Use warnx and errx instead of fprintfEitan Adler2018-08-224-56/+22
| | | | | | | This also makes make "-v" exit without error, since it isn't. Notes: svn path=/head/; revision=338189
* top(1): issue warning on invalid delayEitan Adler2018-08-221-1/+8
| | | | | | | | | | | When top -sH is run it continually updates. It should issue an warning instead. Reported by: jmg PR: 230803 Notes: svn path=/head/; revision=338187
* fix top after arc accounting changeMatt Macy2018-08-111-1/+5
| | | | Notes: svn path=/head/; revision=337661
* top(1): hide THR column in separate-thread mode.Eitan Adler2018-08-081-1/+4
| | | | | | | | | It does not make sense to show a "thread count" column when displaying threads separately. In fact we don't, but do show the header for this column. Fix this. Notes: svn path=/head/; revision=337448
* top(1): fix a buffer overflow copying states to display while they were ↵Daichi GOTO2018-07-271-0/+5
| | | | | | | | | | | | | | incremented - fix an AddressSanitizer error Submitted by: devnexen@gmail.com Reviewed by: eadler Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D16183 Notes: svn path=/head/; revision=336756
* top(1): fixed the empty output problem in non-interactive mode (-n, -b) ↵Daichi GOTO2018-07-271-0/+3
| | | | | | | | | | | | | regressed in r336028 PR: 229842 Reported by: Ali Abdallah <aliovx@gmail.com> Reviewed by: eadler, cy Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D16455 Notes: svn path=/head/; revision=336753
* top(1): forgot in r336160Daichi GOTO2018-07-261-1/+0
| | | | | | | | Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D16452 Notes: svn path=/head/; revision=336737
* top(1): increase number of columns for memoryEitan Adler2018-07-252-4/+4
| | | | | | | | | | | | The original intention was 4 columns but with a usable a result. In practice this was not the case. Increase the number of columns to 5 until humanize_number learns alternative ways of presenting the number. Requested by: many Ref D15801 Notes: svn path=/head/; revision=336707
* Fix thread state summary line display after r334918.Mark Johnston2018-07-101-4/+4
| | | | Notes: svn path=/head/; revision=336174
* top(1): rollback r335836Daichi GOTO2018-07-105-113/+15
| | | | | | | | | | | | Encoding-specific processing introduced in r335836 is not recommended. And doing getenv("LANG") and assuming an encoding based on it is a very bad practice to internationalize software. Submitted by: hrs Differential Revision: https://reviews.freebsd.org/D16203 Notes: svn path=/head/; revision=336160
* top(1): Fix the prompt bug and core dump problem in o / p mode that occurred ↵Daichi GOTO2018-07-101-4/+11
| | | | | | | | | | | by r336028 Reviewed by: cy Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D16174 Notes: svn path=/head/; revision=336150
* r336028 changed next_msg to a char * from char [] of fixed size. ChangeSean Bruno2018-07-061-1/+1
| | | | | | | | | | | | | | | | | | | 2nd argument of vsnprintf() to get the strlen of next_msg so that the appropriate size is used. Found with gcc. /usr.bin/top/display.c: In function 'new_message': /usr.bin/top/display.c:963:31: error: argument to 'sizeof' in 'vsnprintf' call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess] vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); Reviewed by: daichi Notes: svn path=/head/; revision=336031
* Changed to eliminate the upper limit of command length displayedDaichi GOTO2018-07-064-46/+84
| | | | | | | | | | | by "-a" and expand to match terminal width Reviewed by: eadler Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D16083 Notes: svn path=/head/; revision=336028
* top: do not fall to the thread name if kernel cache of the processKonstantin Belousov2018-07-041-1/+0
| | | | | | | | | | | | | | args is empty. Instead, use kvm_getargv() unconditionally to obtain the process arguments. It means that one additional sysctl(2) is performed there. Submitted by: Thomas Munro MFC after: 1 week Differential revision: https://reviews.freebsd.org/D16111 Notes: svn path=/head/; revision=335937
* Fix build: utf8strvisx() does signed data comparisons, but 'char' typeRuslan Bukin2018-07-031-1/+1
| | | | | | | | | is unsigned in riscv GCC, so use guaranted signed char type. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=335889
* When toggling the display using the "m" command to toggle from 'cpu'Cy Schubert2018-07-031-0/+1
| | | | | | | | | | | mode to 'io' mode, an artifact remains because the buffer is not "finished" with a NULL terminator using sbuf_finish(). An example of this is, when the "m" command is entered, the title line will contain COMMANDND instead of COMMAND. This commit fixes this. Notes: svn path=/head/; revision=335881
* top(1): permit infinite length for commandEitan Adler2018-07-011-6/+1
| | | | | | | | | There isn't any need to limit the size of the screen. Utilities like 'less -S' don't have a (meaningful) limit anyways. This also makes the way to dynamically changing the column widths based on the screen width. Notes: svn path=/head/; revision=335850
* top(1) - support UTF-8 displayDaichi GOTO2018-07-016-15/+114
| | | | | | | | | Reviewed by: eadler Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D16006 Notes: svn path=/head/; revision=335836
* top(1): increased the maximum length of command shown by "-a"Daichi GOTO2018-06-271-1/+1
| | | | | | | | | Reviewed by: eadler Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D16006 Notes: svn path=/head/; revision=335685