aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* Makefiles: remove outdated commentsEitan Adler2018-06-241-5/+0
| | | | Notes: svn path=/head/; revision=335598
* 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
* su(1): build with WARNS=6Eitan Adler2018-06-221-2/+0
| | | | | | | Tested with full make universe Notes: svn path=/head/; revision=335535
* 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
* Rename usr.bin/elfcopy to usr.bin/objcopyEd Maste2018-06-213-1/+1
| | | | | | | | | | | | We always install ELF Tool Chain's elfcopy as objcopy, so to avoid confusion rename the src directory containing our reach-over Makefile to match. Requested by: jhb Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=335482
* Don't leak tmpstr.Xin LI2018-06-211-1/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=335469
* usr.bin/ar: use standard 2-Clause FreeBSD licenseEd Maste2018-06-203-36/+42
| | | | | | | | | | | | | | Many licenses on ar files contained small variations from the standard FreeBSD license text. To avoid license proliferation switch to the usual 2-clause FreeBSD license after obtaining permission from all copyright holders. Approved by: jkoshy, kaiw, kientzle Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14561 Notes: svn path=/head/; revision=335454
* Rework how the ld link is handled in WORLDTMP from r322811.Bryan Drewery2018-06-201-1/+2
| | | | | | | | | | | | | | LLD_BOOTSTRAP (build) is independent of LLD_IS_LD (installed) so they should not be based on each other. This is related to upcoming WITH_SYSTEM_LINKER work. Reviewed by: emaste Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D15836 Notes: svn path=/head/; revision=335447
* sort(1): Fix -m when only implicit stdin is used for inputKyle Evans2018-06-203-5/+9
| | | | | | | | | | | | | | | | | | | | | Observe: printf "a\nb\nc\n" > /tmp/foo # Next command results in no output cat /tmp/foo | sort -m # Next command results in proper output cat /tmp/foo | sort -m - # Also works: sort -m /tmp/foo Some const'ification was done to simplify the actual solution of adding "-" explicitly to the file list if we didn't have any file arguments left over. PR: 190099 MFC after: 1 week Notes: svn path=/head/; revision=335404
* sort(1): Add bits to allow easy checking against NetBSD testsKyle Evans2018-06-202-0/+17
| | | | | | | I'm looking at sort(1) failures, for better or worse. Notes: svn path=/head/; revision=335403
* Use capsicum helpers to cache NLS data.Mariusz Zaborski2018-06-202-15/+2
| | | | Notes: svn path=/head/; revision=335397
* Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.Mariusz Zaborski2018-06-1930-36/+38
| | | | | | | No functional change intended. Notes: svn path=/head/; revision=335395
* 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
* usr.bin/ar: remove incorrect SPDX tagsEd Maste2018-06-193-6/+0
| | | | | | | | | | Three ar files have a non-standard variation of the BSD license, so remove their SPDX tags. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=335377
* usr.bin/ar: use standard 2-Clause FreeBSD licenseEd Maste2018-06-194-48/+48
| | | | | | | | | | | | | Many licenses on ar files contained small variations from the standard FreeBSD license text. To avoid license proliferation switch to the usual standard 2-clause FreeBSD license for those files where I have obtained permission from all of the listed copyright holders. Approved by: jkoshy, kaiw Differential Revision: https://reviews.freebsd.org/D14561 Notes: svn path=/head/; revision=335376
* 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
* dc: make use of caph_enterEitan Adler2018-06-181-2/+2
| | | | | | | We already use caph library so this makes sense. Notes: svn path=/head/; revision=335312
* 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
* units: fix some nitsEitan Adler2018-06-161-4/+5
| | | | | | | | | - prefer braces to abusing the `,` operator - mark dead function as dead - remove dead break Notes: svn path=/head/; revision=335265
* Rework ofed build.Konstantin Belousov2018-06-1641-0/+420
| | | | | | | | | | | | | | Aligns the build with the FreeBSD traditional approach to not build in contrib/, and to track inter-dependencies between libraries. With help from: bdrewery Reviewed by: bdrewery, hselasky Sponsored by: Mellanox Technologies MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D15648 Notes: svn path=/head/; revision=335253
* ldd: reference readelf instead of objdump in warning messageEd Maste2018-06-151-1/+1
| | | | | | | | | | | | | We have an obsolete GNU objdump 2.17.50 in the base system, which will be removed in the future. Suggest readelf(1) for examining ELF files instead; for most use cases it is the preferred tool anyhow. PR: 229046 MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=335213
* bsdgrep(1): Remove redundant initialization; unconditionally assigned laterKyle Evans2018-06-151-1/+0
| | | | Notes: svn path=/head/; revision=335188
* 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
* 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