aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* 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
* vmstat(1): various nitsEitan Adler2018-06-132-7/+10
| | | | | | | | | | | Continue my parade on introspection tools by fixing: - failed to check for null after reallocf - avoid the comma operator - mark usage as dead - correct size of len Notes: svn path=/head/; revision=335036
* 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
* Fix memory leakBaptiste Daroussin2018-06-121-0/+1
| | | | | | | CID: 1393352 Notes: svn path=/head/; revision=335002
* Correctly test return value of pipe(2)Baptiste Daroussin2018-06-121-1/+2
| | | | | | | CID: 1393351 Notes: svn path=/head/; revision=335001
* 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
* indent(1): rename -nsac/-sac ("space after cast") to -ncs/-csPiotr Pawel Stefaniak2018-06-119-17/+17
| | | | | | | | | Also update tests and the manpage. GNU indent had the option earlier as -cs, let's not diverge unnecessarily. Notes: svn path=/head/; revision=334944
* top(1): handle 0 in "digits" functionsEitan Adler2018-06-112-5/+6
| | | | Notes: svn path=/head/; revision=334941
* indent(1): group global option variables into an options structurePiotr Pawel Stefaniak2018-06-107-243/+241
| | | | | | | | | It's clearer now when a variable represents a toggable command line option. Many options were stored in the parser's state structure, so fix also that. Notes: svn path=/head/; revision=334927
* 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
* Add myself to calendar.freebsdMichael Dexter2018-06-101-0/+1
| | | | | | | Approved by: bcr (mentor) Notes: svn path=/head/; revision=334915
* 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
* diff: Import fixes from OpenBSDBaptiste Daroussin2018-06-091-6/+6
| | | | | | | | | original commit log by miller@OpenBSD r1.46: Fix exit value when diffing directories with missing files and the -N or -P options are not used. From Ibrahim Khalifa Notes: svn path=/head/; revision=334896
* Add myself to the calendarGuangyuan Yang2018-06-091-0/+1
| | | | | | | | Requested by: mckusick Reviewed by: emaste Notes: svn path=/head/; revision=334895
* Isolate the pr(1) related code in its own source filesBaptiste Daroussin2018-06-094-81/+169
| | | | | | | | | | This keeps diffreg.c closer to what it is supposed to do: diffing regular files. It also allows my code to get a proper license Notes: svn path=/head/; revision=334894
* top(1): allow starting with -T flagEitan Adler2018-06-091-1/+1
| | | | Notes: svn path=/head/; revision=334893
* bsdgrep(1): Some more int -> bool conversions and name changesKyle Evans2018-06-091-20/+25
| | | | | | | | | Again motivated by upcoming work to rewrite a bunch of this- single-letter variable names and slightly misleading variable names ("lastmatches" to indicate that the last matched) are not helpful. Notes: svn path=/head/; revision=334889
* ncal: correct history sectionEitan Adler2018-06-091-5/+8
| | | | | | | | | | | | | | | | | | originally reported Todd C. Miller[0] Additional data see [1][2]. While here, pet igor. Closes #152 (github pr) Sbmitted by: Raf Czlonka [0] http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/cal/cal.1?rev=1.28&content-type=text/x-cvsweb-markup [1] https://www.bell-labs.com/usr/dmr/www/1stEdman.html [2] https://www.bell-labs.com/usr/dmr/www/man61.pdf Notes: svn path=/head/; revision=334873
* 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
* bsdgrep(1): Evict character sequence that moved inKyle Evans2018-06-081-1/+1
| | | | | | | Reported by: trasz Notes: svn path=/head/; revision=334837
* 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
* bsdgrep(1): Slooowly peel away the chunky onionKyle Evans2018-06-083-23/+27
| | | | | | | | | | | | | | | | | | | | (or peel off the band-aid, whatever floats your boat) This addresses two separate issues: 1.) Nothing within bsdgrep actually knew whether it cared about line numbers or not. 2.) The file layer knew nothing about the context in which it was being called. #1 is only important when we're *not* processing line-by-line. #2 is debatably a good idea; the parsing context is only handy because that's where we store current offset information and, as of this commit, whether or not it needs to be line-aware. Notes: svn path=/head/; revision=334821
* bsdgrep(1): Don't initialize fts_flags twiceKyle Evans2018-06-071-1/+1
| | | | | | | | | Admittedly, this is a clang-scan complaint... but it wasn't wrong. fts_flags is initialized by all cases in the switch(), which should be fairly obvious. Annotate this anyways. Notes: svn path=/head/; revision=334808
* bsdgrep(1): whoops, garbage collect the now write-only variableKyle Evans2018-06-071-2/+2
| | | | Notes: svn path=/head/; revision=334807
* bsdgrep(1): Do some less dirty things with return typesKyle Evans2018-06-073-23/+26
| | | | | | | | | | | | Neither procfile nor grep_tree return anything meaningful to their callers. None of the callers actually care about how many lines were matched in all of the files they processed; it's all about "did anything match?" This is generally just a light refactoring to remind me of what actually matters as I'm rewriting these bits to care less about 'stuff'. Notes: svn path=/head/; revision=334806
* Remove NLS support from BSD grepBaptiste Daroussin2018-06-0616-204/+12
| | | | | | | | | | | | | | | | | | | GNU grep as in actually in base does not have any translations support compiled in, so no functionnality loss. We do support 193 locales in base, we will never catch up on that number of translation with bsd grep. Removing NLS support make bsd grep consistent with the other binaries in base which are not translated, and also reduce a little bit the code. Reviewed by: kevans Approved by: kevans Discussed with: kevans @BSDCan Differential Revision: https://reviews.freebsd.org/D15682 Notes: svn path=/head/; revision=334744
* 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