aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/systat
Commit message (Collapse)AuthorAgeFilesLines
* systat: Handle SIGWINCH to properly window resizing and adjustMichael Reifenberger2021-04-214-10/+22
| | | | | | | | | | -swap disk stat based on new size. Display corrupts after resizing a window. Process SIGWINCH to redraw all window. Submitted by: Yoshihiro Ota ota@j.email.ne.jp Differential Revision: https://reviews.freebsd.org/D29337
* systat: Avoid incorrect reallocation in pigs.cMichael Reifenberger2021-04-211-10/+7
| | | | | | | | | | | | Stop free() even if kvm_getprocs as we can come back but set nprocs = 0. Check nprocs in showpigs() to ensure not try displaying with kvm_getprocs failed. Current code can have pt with non-null after kvm_getprocs() failure. Replace to realloc for simpler operations. Submitted by: Yoshihiro Ota ota@j.email.ne.jp Reviewed by: mckusick@ Differential Revision: https://reviews.freebsd.org/D29303
* Improve size readability.Michael Reifenberger2021-02-153-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
* systat.1: Fix synopsisMateusz Piotrowski2021-02-101-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. MFC after: 1 week
* systat.1: Remove Tn macrosMateusz Piotrowski2021-02-101-41/+14
| | | | | | They are no longer supported by mdoc(7). MFC after: 1 week
* 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
* Add the laundry page count to the displays of systat, top, and vmstat.Mark Johnston2016-11-102-7/+7
| | | | | | | | Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D8467 Notes: svn path=/head/; revision=308489
* Use nitems() from sys/param.h.Marcelo Araujo2016-08-161-3/+3
| | | | | | | MFC after: 2 weeks. Notes: svn path=/head/; revision=304225
* Use macro MIN() from sys/param.h.Marcelo Araujo2016-04-271-1/+1
| | | | | | | MFC after: 2 weeks. Notes: svn path=/head/; revision=298684
* Use NULL instead of 0 for pointers.Marcelo Araujo2016-04-203-10/+10
| | | | | | | | | gethostbyname(3) will return NULL for error status. MFC after: 2 weeks. Notes: svn path=/head/; revision=298324
* Augment struct tcpstat with tcps_states[], which is used for book-keepingGleb Smirnoff2016-01-271-1/+1
| | | | | | | | | | the amount of TCP connections by state. Provides a cheap way to get connection count without traversing the whole pcb list. Sponsored by: Netflix Notes: svn path=/head/; revision=294869
* Add on systat -vm the ability to display the physical and kernel memoryMarcelo Araujo2015-12-281-1/+13
| | | | | | | | | | | | percent usage. PR: bin/203917 Submitted by: ota <ota@j.email.ne.jp> Approved by: bapt (mentor) Differential Revision: https://reviews.freebsd.org/D4281 Notes: svn path=/head/; revision=292817
* Update dependencies after r291406 added libelf to libkvm.Bryan Drewery2015-12-011-0/+1
| | | | | | | | | | | Unfortunately filemon/meta mode tracks all indirect dependencies here since ld(1) is reading libelf when linking in libkvm. Churn would be reduced if this was able to be limited to direct dependencies. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291558
* Bump date. Missed in r289873.Michael Tuexen2015-10-241-1/+1
| | | | | | | | MFC after: 1 week X-MFC with: r289873 Notes: svn path=/head/; revision=289874
* Add support to systat to display SCTP statistics.Michael Tuexen2015-10-245-1/+374
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=289873
* Use _PATH_DEVNULL instead of direct hardcoding.Xin LI2015-09-281-1/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=288344
* Add support to systat to display zfs arc cache status/infoMichael Reifenberger2015-09-277-3/+272
| | | | | | | | PR: 195460 Submitted by: ota Notes: svn path=/head/; revision=288306
* - Avoid accessing window properties directly, instead, use accessors.Xin LI2015-09-104-21/+16
| | | | | | | | | | | This should be no-op for now, but allows the code to work if we move to NCURSES_OPAQUE. - Use calloc() instead of malloc+bzero. MFC after: 2 weeks Notes: svn path=/head/; revision=287633
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+23
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172