aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/systat
Commit message (Collapse)AuthorAgeFilesLines
* systat: fix build with newer ncursesBaptiste Daroussin2024-06-272-2/+2
| | | | (cherry picked from commit 35e941ce5520b8ef710bb388bd63460aa0ce63eb)
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-231-1/+0
| | | | | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/ Similar commit in main: (cherry picked from commit b2c76c41be32)
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-232-2/+0
| | | | | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/ Similar commit in main: (cherry picked from commit d0b2dbfa0ecf)
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-235-10/+0
| | | | | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/ Similar commit in main: (cherry picked from commit 1d386b48a555)
* Remove $FreeBSD$: two-line .c patternWarner Losh2023-08-2316-48/+0
| | | | | | | Remove /^#include\s+<sys/cdefs.h>.*$\n\s+__FBSDID\("\$FreeBSD\$"\);\n/ Similar commit in main: (cherry picked from commit e5d258c9e599)
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-232-2/+0
| | | | | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/ Similar commit in main: (cherry picked from commit 42b388439bd3)
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-236-12/+0
| | | | | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/ Similar commit in main: (cherry picked from commit b3e7694832e8)
* systat: Remove obsolete copyright stringWarner Losh2023-08-231-6/+0
| | | | | | | | | This is unused, so remove it. We don't put a copyright string in most of the other binaries. This one doesn't need one either. Sponsored by: Netflix (cherry picked from commit bf46512a54cdf9a5b2e4f520be860add21efbfd5)
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-07-254-4/+4
| | | | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix (cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
* systat: Fix a bunch of use after frees in fetch_ifstat().John Baldwin2023-06-281-1/+1
| | | | | | | | | | | | | | I think this was probably just a typo. initifstat() continues around a similar loop if the mib data fails to fetch, and fetch_ifstat() was already using a FOREACH_SAFE loop here so expected to keep going. Calling clearifstat() from the fetch routine also seems wrong, and the sort_interface_list() call triggered by the existing needsort = 1 will itself set needclear to trigger a future clearifstat(). Reported by: GCC 12 -Wuse-after-free Differential Revision: https://reviews.freebsd.org/D36823 (cherry picked from commit f6fdf9214a657351e78c68aac1888e674c0481f6)
* systat: Display seconds in vmstat modePeter Jeremy2022-03-051-1/+1
| | | | | | | | | | Providing a timestamp with seconds granularity helps make it obvious that the display is updating. Reviewed by: mckusick Differential Revision: https://reviews.freebsd.org/D29181 (cherry picked from commit c9d1fa7003d5def224e9cfa5d38314f187487eb9)
* systat -vm: Humanize output for ease of reading.Kirk McKusick2022-01-181-37/+37
| | | | | | | | | | | Using 8 width is too wide for large numbers like 1379991K; 1330M is easier to read. Submitted by: ota_j.email.ne.jp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D33495 (cherry picked from commit a115a4aa51ae891330c9c4404dd4df13b601556f)
* systat: clean up code assuming network classesMike Karels2021-12-101-17/+5
| | | | | | | | | Similar to netstat, clean up code that uses inet_lnaof() to check for binding to "host 0" (lowest host on network) as a "network" bind. Such things don't happen, and current networks are seldom if ever found in /etc/networks. (cherry picked from commit a2e7dfca86497e535039a42cfc44cfc48209abf5)
* systat: Handle SIGWINCH to properly window resizing and adjust -swap disk ↵Michael Reifenberger2021-11-014-10/+22
| | | | | | stat based on new size. (cherry picked from commit 66483838039b21a20d748448f8916a73ec419691)
* Augment systat(1) -swap to display large swap space processesKonstantin Belousov2021-11-016-36/+361
| | | | (cherry picked from commit 57e5da2c98003e5ab77a337e9fbe22ab7e512ba7)
* Clean up copyright messages.Kirk McKusick2021-05-172-10/+8
| | | | (cherry picked from commit 9e16b9530aab5e1c4efee2a8fe2feaf33340c764)
* Improve size readability.Michael Reifenberger2021-04-213-89/+49
| | | | | | | | | | | | | Preserve more space for swap devise names. Prevent line overflow with long devise name. Don't draw a bar when swap is not used at all. Simplify and optimize code. Change the label to end at end of 100%. PR: 251655 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27496 (cherry picked from commit 8d06c3e7a40831ac139d83b85b282206229b426f)
* systat.1: Remove Tn macrosMateusz Piotrowski2021-04-171-41/+14
| | | | | | | | They are no longer supported by mdoc(7). MFC after: 1 week (cherry picked from commit fcbaf46b763a91bb41fe68afdcf59a7d210bc2f7)
* systat.1: Fix synopsisMateusz Piotrowski2021-04-171-1/+1
| | | | | | | systat does not have a "-display" flag. Use Ar to indicate that "display" is meant to be substituted with an actual display command. (cherry picked from commit e6f59be239aa17f80b44ded4779e29f5d5352b28)
* Adjust to display more than 999 sleeping threadsStefan Eßer2020-12-271-5/+5
|
* Statistics are for threads, not processesStefan Eßer2020-12-271-1/+1
|
* Improve number reading by rounding up to a next unit earlier for memory display.Michael Reifenberger2020-11-211-12/+12
| | | | | | | | Submitted by: ota@j.email.ne.jp Differential Revision: https://reviews.freebsd.org/D26503 Notes: svn path=/head/; revision=367922
* Handle device removal and removal+add cases to fix infinity rate.Michael Reifenberger2020-07-113-46/+75
| | | | | | | | | | | PR: 219829 Submitted by: ota@j.email.ne.jp Reported by: rezo@live.cn MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25226 Notes: svn path=/head/; revision=363095
* Introduce sysputpage() to display large page size with human readable format.Michael Reifenberger2020-05-154-28/+71
| | | | | | | | | | | | | | | Using UI units allows to fit larger numbers in columns. Stop calling v_page_size - this is a value that doesn't change at runtime. Renamed WINDOW *wnd to *wd to avoid conflict with global *wnd variable. Use bit-shift to convert page size to byte. PR: 246458 Submitted by: ota@j.email.ne.jp MFC after: 2 weeks Differential Revision: D24834 Notes: svn path=/head/; revision=361084
* Add missing sysput.cMichael Reifenberger2020-05-111-0/+77
| | | | | | | | | PR: 237664 Submitted by: ota@j.email.ne.jp Reported by: imb, cy Notes: svn path=/head/; revision=360929
* Patch systat -zarc to display cumulative rate and round down large numbers ↵Michael Reifenberger2020-05-114-46/+49
| | | | | | | | | | | by SI units PR: 237664 Submitted by: ota@j.email.ne.jp MFC after: 2 weeks Notes: svn path=/head/; revision=360919
* systat: remove redundant definition of kdKyle Evans2020-03-291-2/+0
| | | | | | | | | | kd is already properly declared in extern.h and defined in main.c, rendering this definition useless. This fixes the -fno-common build. MFC after: 3 days Notes: svn path=/head/; revision=359416
* Sync with r356645. desiredvnodes is now maxvnodes.Cy Schubert2020-01-131-4/+4
| | | | Notes: svn path=/head/; revision=356678
* As of r356642 desiredvnodes is u_long.Cy Schubert2020-01-131-1/+1
| | | | Notes: svn path=/head/; revision=356677
* Add stat counter for ipv6 atomic fragmentsTom Jones2019-04-191-19/+21
| | | | | | | | | | | | | | | | Add a stat counter to track ipv6 atomic fragments. Atomic fragments can be generated in response to invalid path MTU values, but are also a potential attack vector and considered harmful (see RFC6946 and RFC8021). While here add tracking of the atomic fragment counter to netstat and systat. Reviewed by: tuexen, jtl, bz Approved by: jtl (mentor), bz (mentor) Event: Aberdeen hackathon 2019 Differential Revision: https://reviews.freebsd.org/D17511 Notes: svn path=/head/; revision=346398
* systat -zarc to display disk activities like -vmMichael Reifenberger2019-04-027-180/+248
| | | | | | | | | | PR: 213310 Submitted by: ota MFH: 4 weeks Differential Revision: https://reviews.freebsd.org/D18726 Notes: svn path=/head/; revision=345804
* Fix systat's :only command parser for the multiple arguments caseOleksandr Tymoshenko2019-01-231-2/+2
| | | | | | | | | | | | | According to systat(1) :only option is supposed to accept multiple drives but the parser for its arguments stops after first entry. Fix the parser logic to accept multiple drives. PR: 59220 Reported by: Andy Farkas <andyf@speednet.com.au> MFC after: 1 week Notes: svn path=/head/; revision=343338
* Fix inconsistency in return values introduced by r343222Oleksandr Tymoshenko2019-01-201-1/+1
| | | | | | | | | | | Consistently return 1 or the case of missing arguments in both functions PR: 219689 MFC after: 1 week X-MFC-With: 343222 Notes: svn path=/head/; revision=343223
* Fix crash in systat(4) when certain commands are called without argumentsOleksandr Tymoshenko2019-01-201-0/+10
| | | | | | | | | | | Add check for missing arguments to dsmatchselect and dsselect PR: 219689 Submitted by: Marko Turk <mt@markoturk.info> MFC after: 1 week Notes: svn path=/head/; revision=343222
* Fix printing of 64-bit counters on 32-bit ppc platforms.Michael Tuexen2018-11-126-19/+23
| | | | | | | | | | | | Several statistic counters are uint64_t values and are printed by systat using %lu. This results in displaying wrong numbers. Use PRIu64 instead. While there, print variables of size_t using %zd. MFC after:i 3 days Differential Revision: https://reviews.freebsd.org/D17838 Notes: svn path=/head/; revision=340361
* Chasing r337661, fix systat after arc accounting change.Cy Schubert2018-08-121-1/+6
| | | | Notes: svn path=/head/; revision=337680
* Don't leak tmpstr.Xin LI2018-06-211-1/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=335469
* Reduce <sys/queue.h> pollution.Dag-Erling Smørgrav2018-05-112-0/+2
| | | | | | | | | | | | While <sys/sysctl.h> includes <sys/queue.h> unconditionally, it is only actually used in code which is conditional on _KERNEL. Make the #include itself conditional as well, and fix userland code that uses <sys/queue.h> for other purposes but relied on <sys/sysctl.h> to bring it in. MFC after: 1 week Notes: svn path=/head/; revision=333475
* Don't show the number of currently established SCTP associations,Michael Tuexen2018-04-101-51/+48
| | | | | | | | | | since this is not monotonically increasing. It's number can be derived from the other counters shown. MFC after: 3 days Notes: svn path=/head/; revision=332353
* Retire SCTP_WITH_NO_CSUM option.Michael Tuexen2017-12-071-2/+0
| | | | | | | | | | | This option was used in the early days to allow performance measurements extrapolating the use of SCTP checksum offloading. Since this feature is now available, get rid of this option. This also un-breaks the LINT kernel. Thanks to markj@ for making me aware of the problem. Notes: svn path=/head/; revision=326672
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-275-4/+14
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* Order declarations alphabetically.Konstantin Belousov2017-11-221-2/+2
| | | | | | | | | | Match signess of the format and the value. Noted by: bde Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=326108
* systat: use and correctly display 64bit counters.Konstantin Belousov2017-11-212-21/+41
| | | | | | | | | | | | | | | | Following struct vmtotal changes, make systat use and correctly display 64-bit counters. Switch to humanize_number(3) to overcome homegrown arithmetics limits in pretty printing large numbers. Use 1024 as a divisor for memory fields to make it consistent with other tools and users expectations. Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com> Sponsored by: Mysterious Code Ltd. PR: 2137 Differential revision: https://reviews.freebsd.org/D13105 Notes: svn path=/head/; revision=326073
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2019-1/+39
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Hide struct socket and struct unpcb from the userland.Gleb Smirnoff2017-10-021-0/+1
| | | | | | | | | | | | | | | | | | | Violators may define _WANT_SOCKET and _WANT_UNPCB respectively and are not guaranteed for stability of the structures. The violators list is the the usual one: libprocstat(3) and netstat(1) internally and lsof in ports. In struct xunpcb remove the inclusion of kernel structure and add a bunch of spare fields. The xsocket already has socket not included, but add there spares as well. Embed xsockbuf into xsocket. Sort declarations in sys/socketvar.h to separate kernel only from userland available ones. PR: 221820 (exp-run) Notes: svn path=/head/; revision=324227
* Fix systat(1) regression. It was broken by r317061.Jung-uk Kim2017-04-201-26/+26
| | | | Notes: svn path=/head/; revision=317231
* Hide struct inpcb, struct tcpcb from the userland.Gleb Smirnoff2017-03-213-40/+41
| | | | | | | | | | | | | | | | | | | | | | | This is a painful change, but it is needed. On the one hand, we avoid modifying them, and this slows down some ideas, on the other hand we still eventually modify them and tools like netstat(1) never work on next version of FreeBSD. We maintain a ton of spares in them, and we already got some ifdef hell at the end of tcpcb. Details: - Hide struct inpcb, struct tcpcb under _KERNEL || _WANT_FOO. - Make struct xinpcb, struct xtcpcb pure API structures, not including kernel structures inpcb and tcpcb inside. Export into these structures the fields from inpcb and tcpcb that are known to be used, and put there a ton of spare space. - Make kernel and userland utilities compilable after these changes. - Bump __FreeBSD_version. Reviewed by: rrs, gnn Differential Revision: D10018 Notes: svn path=/head/; revision=315662
* Renumber copyright clause 4Warner Losh2017-02-2822-22/+22
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Fix error in the example sectionSevan Janiyan2016-12-051-8/+11
| | | | | | | | | | | | | | Adjust formatting highlighted by igor. PR: 214683 Submitted by: Anindya Mukherjee <anindya49 AT hotmail DOT com> Reviewed by: jilles Approved by: bcr (mentor) MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D8591 Notes: svn path=/head/; revision=309552