aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/top
Commit message (Collapse)AuthorAgeFilesLines
...
* top(1): increase field with width for W/CPU columnEitan Adler2018-06-241-2/+2
| | | | | | | | | This allows 3 digit CPU columns to look nice Reported by: feld Notes: svn path=/head/; revision=335601
* top(1): Restructure printing of process statesEitan Adler2018-06-231-77/+63
| | | | | | | | This avoids the need to have separate buffers and calls to sprintf for various calls. Notes: svn path=/head/; revision=335591
* top(1): Convert process listing to sbuf tooEitan Adler2018-06-231-57/+45
| | | | | | | | | | This also fixes -mio with 'T' set (thread-id instead of process-id). This can go further by removing the existing sprintf, and using sbuf directly. This will be done in a followup commit. Notes: svn path=/head/; revision=335590
* top(1): Use basename instead of a homegrown alternativeEitan Adler2018-06-231-5/+2
| | | | Notes: svn path=/head/; revision=335589
* top(1): show CPU state breakdown on first runEitan Adler2018-06-231-20/+1
| | | | | | | | | | | There is no documented reason for this not to be shown on the first run. I can't find any good reason, and it breaks batch mode. PR: 218889 Submitted by: "Jeremy C. Reed" <reed@reedmedia.net> Notes: svn path=/head/; revision=335576
* top(1): increase warningsEitan Adler2018-06-221-2/+2
| | | | | | | | | | top(1) now builds without cast-qual warnings, so remove the exemption for that. Tested with clang, gcc7, gcc9 Notes: svn path=/head/; revision=335552
* top(1): garbage collectEitan Adler2018-06-222-29/+6
| | | | | | | | - remove a now-unused function - remove needless indirection of handle type Notes: svn path=/head/; revision=335551
* top(1): increase size of 'C' columnEitan Adler2018-06-221-2/+2
| | | | | | | | | | On machines with more than 99 CPUs make room to display the entire number. Requested by: cperciva Notes: svn path=/head/; revision=335550
* top(1): remove special handling of load > 5Eitan Adler2018-06-223-20/+3
| | | | | | | | | | When the load is "high" (an arbitrary value) top(1) previously moved the cursor to the top-left of the screen as an acknowledgment. In practice, on modern machines, even relatively slow ones, it looked more like a glitch. Remove the logic. Notes: svn path=/head/; revision=335547
* top(1): reimplement header formatting as sbufEitan Adler2018-06-225-85/+47
| | | | | | | | | | | | | | | | | | | | | | The current header formatting is a giant format string that changes global state during the format process. Make the following changes: - use sbuf to build up the header rather than use the above pseudo-dynamic one - Change name length to 10 - Reduce size of RES and SIZE by making humanize more aggressive - Restore a version number line to the copyright. This may be required by the copyright (and may not be; its unclear) This is also a pre-req to implementing TOPCOLOR from newer versions of top(1) Discussed with: allanjude, rpolka, danfe, rgrimes Differential Revision: https://reviews.freebsd.org/D15801 Notes: svn path=/head/; revision=335539
* top(1): behave as documented for -tEitan Adler2018-06-221-1/+1
| | | | | | | Show top itself by default, unless -t is specified. Notes: svn path=/head/; revision=335517
* top(1): fix top -mioEitan Adler2018-06-191-0/+1
| | | | Notes: svn path=/head/; revision=335390
* top(1): Fix Coverity warningAlan Somers2018-06-191-1/+1
| | | | | | | | | | | | Don't call strerror on negative errnos Reported by: Coverity CID: 976708 Reviewed by: eadler Differential Revision: https://reviews.freebsd.org/D15909 Notes: svn path=/head/; revision=335381
* top(1): correct assertionEitan Adler2018-06-191-1/+1
| | | | Notes: svn path=/head/; revision=335360
* top(1): correct header in UP modeEitan Adler2018-06-191-2/+2
| | | | | | | | | | Fix an oversight from r334869 which made the same change, but only for SMP systems. This avoids a segfault while D15801 is being reviewed. Reviewed by: kevans Notes: svn path=/head/; revision=335359
* top(1): use more modern signal codeEitan Adler2018-06-181-7/+8
| | | | | | | | Rather than manually build signal masks use functions designed for that reason. Also use sigprocmask instead of sigblock. Notes: svn path=/head/; revision=335310
* top(1): remove myself from top.1Eitan Adler2018-06-141-1/+0
| | | | | | | I wrote some, but not enough for the man page. Notes: svn path=/head/; revision=335134
* Fix top(1) support for displaying ZFS Compressed ARC statisticsAllan Jude2018-06-141-1/+1
| | | | | | | | | | | | | Broken in r334514 sysctlbyname("vfs.zfs.compressed_arc_enabled", ...) would return ENOMEM while trying to read the sysctl (a boolean_t) into a bool, which is too small. Reviewed by: jhb (on irc) Sponsored by: Klara Systems Notes: svn path=/head/; revision=335099
* top(1): remove unneeded logicEitan Adler2018-06-131-9/+6
| | | | | | | | | | | | - remove __pure annotations I added earlier for some functions. One writes to the the arguments as "out" pointers. The other reads from an array, which while const within the function might be mutated externally. - total_change is modified to be at 1, if previously 0, so no if check is needed. Notes: svn path=/head/; revision=335049
* top(1): style(9)Eitan Adler2018-06-133-8/+14
| | | | | | | | - split return type from function name - Sprinkle a __pure where possible. Notes: svn path=/head/; revision=335043
* top(1): add myself to authorsEitan Adler2018-06-132-0/+2
| | | | | | | | At this point I've mucked enough with top(1) that all bugs should be blamed on me rather than William LeFebvre. Notes: svn path=/head/; revision=335042
* top(1): shift from atoi to non-deprecated functionEitan Adler2018-06-131-1/+1
| | | | Notes: svn path=/head/; revision=335040
* top(1): replace homegrown itoa with sprintfEitan Adler2018-06-131-30/+4
| | | | | | | | Much of this should be inlined to the callsite, but leave it here for now to make it easier to make it easier bisect later. Notes: svn path=/head/; revision=335039
* top(1): format_time, format_k, etc.Eitan Adler2018-06-134-85/+37
| | | | | | | | - Use humanize_number for format_k and format_k2 - Fix some style nits in format_time Notes: svn path=/head/; revision=335038
* top(1): format help more nicelyEitan Adler2018-06-131-5/+22
| | | | | | | | For entries that are duplicates present them nicely rather than showing two identical help entries. For ' ' present it as SPC Notes: svn path=/head/; revision=335037
* top(1): several small bugfixes and nitsEitan Adler2018-06-134-17/+22
| | | | | | | | | | | | | | - initialize all maybe uninitialized vars with bogus values. This shuts up the compiler, and causes crashes if it changes later. - mark noreturn as noreturn - removed unused macro - handle x_procstate as runtime rather than pre-processor - avoid using void functions in condtionals Tested with clang, gcc 7, gcc 9 Notes: svn path=/head/; revision=335024
* top(1): remove trailing whitespaceEitan Adler2018-06-125-32/+32
| | | | Notes: svn path=/head/; revision=334990
* top(1): style and relatedEitan Adler2018-06-126-13/+8
| | | | | | | | | | - style(9) - remove now-defunct comments - remove getuid check for low delay - expand range of format_k Notes: svn path=/head/; revision=334989
* top(1): move command mapping to commands.cEitan Adler2018-06-124-93/+88
| | | | | | | | | | | | | This eliminates the difficult to follow mapping of a string list. It moves numbers from "#define" into (more) debuggable enums. More generally, it follows the trend of moving more data into a more central mechanism. The help output is a little worse: " " is not rendered well, and there are duplicate entries, but that will be fixed in a followup. Notes: svn path=/head/; revision=334988
* top(1): handle 0 in "digits" functionsEitan Adler2018-06-112-5/+6
| | | | Notes: svn path=/head/; revision=334941
* top(1): use modern interfaces for nice and relatedEitan Adler2018-06-102-32/+10
| | | | | | | | - attempt and fail, rather than check for permission. - use macro rather than explicit "-20" Notes: svn path=/head/; revision=334922
* top(1): add command aliases; correct dumb supportEitan Adler2018-06-101-2/+5
| | | | Notes: svn path=/head/; revision=334921
* top(1): use sys_signame instead of hard coding signalsEitan Adler2018-06-103-74/+17
| | | | | | | | This enables the removal of the signal.h awk script. Shamelessly stolen from kill(1). Notes: svn path=/head/; revision=334920
* top(1): bring some structure to commandsEitan Adler2018-06-103-56/+57
| | | | | | | | Right now this is only used for help text but it'll eventually be used to build up long options array, dispatch commands, etc. Notes: svn path=/head/; revision=334919
* top(1): use correct word when displaying threadsEitan Adler2018-06-101-1/+1
| | | | | | | | PR: 182204 Reported by: "Brodey Dover" <doverosx@gmail.com> Notes: svn path=/head/; revision=334918
* top(1): filter fewer warnings; clean upEitan Adler2018-06-105-27/+12
| | | | | | | | | | | - remove WARNS?=6. It is default - we no longer have cast-qual problems - remove unused macros - remove unneeded casts - add include guard for loadavg.h Notes: svn path=/head/; revision=334917
* top(1): permit sending signal with any caseEitan Adler2018-06-101-6/+6
| | | | Notes: svn path=/head/; revision=334916
* top(1): permit sub-second delay timesEitan Adler2018-06-102-19/+16
| | | | | | | | | | This removes the getuid check for delay==0. It didn't prevent users from writing similar programs in the general case. In theory, if top(1) is among one of the few restricted programs you're allowed to run, it may have helped a little, but there are better ways of handling that case. Notes: svn path=/head/; revision=334906
* top(1): correctly reset per-cpu countersEitan Adler2018-06-092-15/+12
| | | | | | | | | | | | I had changed this from a for loop to a memset during an earlier cleanup. This change was incorrect so revert it. While here, clean up Reported by: flo Notes: svn path=/head/; revision=334903
* top(1): handle specific pids betterEitan Adler2018-06-092-10/+3
| | | | | | | | When told to watch a specific pid, don't filter idle, system, or self processes. The summary at the top will still flip correctly though. Notes: svn path=/head/; revision=334901
* top(1): implement additional missing long optionsEitan Adler2018-06-091-1/+3
| | | | Notes: svn path=/head/; revision=334899
* top(1): initial pass to freebsdize the man pageEitan Adler2018-06-091-383/+258
| | | | | | | | The previous man page used many conventions not typical in FreeBSD. Since we've forked top completely, convert the man page too. Notes: svn path=/head/; revision=334898
* top(1): Implement long optionsEitan Adler2018-06-091-1/+29
| | | | | | | | This also documents some reserved or differing options from top's original upstream. Notes: svn path=/head/; revision=334897
* top(1): allow starting with -T flagEitan Adler2018-06-091-1/+1
| | | | Notes: svn path=/head/; revision=334893
* top(1): correct header, align it.Eitan Adler2018-06-091-17/+32
| | | | | | | | | | | THR is always 6 digits or longer. Now that the PID/THR change is separated, use correct headers. PR: 228823 Reported by: Trond.Endrestol@ximalas.info Notes: svn path=/head/; revision=334869
* top(1): actually make change for tid vs pidEitan Adler2018-06-091-3/+1
| | | | Notes: svn path=/head/; revision=334866
* top(1): use a different command to toggle tid vs pidEitan Adler2018-06-096-30/+59
| | | | | | | | | | | | | | | - By popular demand, implement a different switch ("T") for toggling between thread id and process id. - Add an assert that the size of command chars is as expected. - Also clean up some messiness I found when implementing this. - Further document the new flag. Requested by: flo, ronald-lists@klop.ws, bapt PR: 139389 (for the record) X-MFC-With: r334474 Notes: svn path=/head/; revision=334864
* top(1): remove some unneeded indirectionEitan Adler2018-06-081-29/+11
| | | | Notes: svn path=/head/; revision=334823
* top(1): fix several style & const related issuesEitan Adler2018-06-085-41/+39
| | | | | | | | | - use parens for return - put function names on newline - sprinkle const where possible Notes: svn path=/head/; revision=334822
* top(1): fix err againEitan Adler2018-06-061-1/+1
| | | | | | | | I am amazed at my ability to get a one-line error reporting line wrong thrice. Notes: svn path=/head/; revision=334706