aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/systat
Commit message (Collapse)AuthorAgeFilesLines
* systat: remove kvm(3) support for -netstat modeGleb Smirnoff2026-03-124-136/+14
| | | | | | | | | | | | | | | | | The kvm(3) mode was actually non-functional since FreeBSD 8 for kernels with VIMAGE, since FreeBSD 12 for the GENERIC kernel and since FreeBSD 14 for all kernels. The reason for that is that systat(1) tried to lookup symbol "tcb" to check if kvm(3) is working. The symbol no longer exist in the kernel. A side effect was that systat(1) lost true kvm(3) support for all other modes, e.g. -swap or -pigs. The tool was still working, but libkvm was just a shim to sysctl(3) API. So, contrary to what the header line says, this change actually restores the kvm(3) support for other modes. Now we read the "allproc" symbol. This was the last tool that abused _WANT_INPCB.
* systat: improve reporting of UDP statisticsMichael Tuexen2025-08-131-8/+12
| | | | | | | | | Report the undelivered multi and broadcast UDP packets separately. Reviewed by: rrs, cc MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51884
* Don't include netinet/tcp_timer.h when not neededMichael Tuexen2025-06-172-2/+0
| | | | | | | Reviewed by: glebius MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D50889
* systat/top: Update ZFS sysctl namesAlexander Motin2025-05-251-3/+3
| | | | | | | Some of ARC statistic sysctls changed years ago, but those tools are still using legacy shims, that are going to be removed. MFC after: 3 days
* Centralize and simpify implemention of some VM macrosBrooks Davis2025-01-141-2/+1
| | | | | | | | | | | | | These macros have substantially identical implementations on each platform. Use roundup2/rounddown2 for round_page/trunc_page. This version standardizes on not using explicit casts and instead preserving the original type. A couple of tweaks were required to make this work. Reviewed by: brooks, kib, markj Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D48450
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* systat: fix build with newer ncursesBaptiste Daroussin2024-06-202-2/+2
|
* inpcb: fully retire inp_ppcb pointerGleb Smirnoff2024-03-291-15/+13
| | | | | | | | | | | | | | | | | | | Before a protocol specific control block started to embed inpcb in self (see 0aa120d52f3c, e68b3792440c, 483fe96511ec) this pointer used to point at it. Retain kf_sock_inpcb field in the struct kinfo_file in <sys/user.h>. The exp-run detected a minimal use of the field in ports: * sysutils/lsof - patched upstream * net-mgmt/netdata - patch accepted upstream * emulators/qemu-user-static - upstream master branch seems not using the field anymore We can keep the field around for some time, but eventually it may be reused for something else. PR: 277659 (exp-run) Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D44491
* systat(1): Plug memory leakHiroki Sato2024-02-081-1/+2
| | | | | The procstat_getprocs() function call in procgetinfo() allocated a buffer but it was not freed properly.
* usr.bin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-275-7/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sccs: Manual changesWarner Losh2023-11-271-9/+0
| | | | | | | | | | | | | | | For the uncommon items: Go through the tree and remove sccs tags that didn't fit any nice pattern. If in the neighborhood, other SCM tags were removed when they were detritis of long-ago CVS somehow in the early mists of the project. Some adjacent copyrights stringswere removed (they duplicated the copyright notices in the file). This also removed non-standard formations of omission of SCCS tags (usually by adding an extra #if 0 somewhere. After this commit, a number of strings tagged with the 'what' @(#) prefix remain, but they are primarily copyright notices. Sponsored by: Netflix
* usr.bin: Remove ancient SCCS tags.Warner Losh2023-11-2720-55/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-165-10/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: two-line .c patternWarner Losh2023-08-1616-48/+0
| | | | Remove /^#include\s+<sys/cdefs.h>.*$\n\s+__FBSDID\("\$FreeBSD\$"\);\n/
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-166-12/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* systat: Remove obsolete copyright stringWarner Losh2023-08-161-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
* systat: Chase 70ea484e3ec5, removing vdev_cacheCy Schubert2023-06-271-9/+0
| | | | | | | | | | | As of 70ea484e3ec5 vdev_cache has been removed. Stop reporting on it. Without this systat reports: sysctl(kstat.zfs.misc.vdev_cache_stats.misses...) failed: No such file or directory Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D40742
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-124-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
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-3/+4
|
* tcp: retire TCPDEBUGGleb Smirnoff2022-12-141-1/+0
| | | | | | | | | | | | | This subsystem is superseded by modern debugging facilities, e.g. DTrace probes and TCP black box logging. We intentionally leave SO_DEBUG in place, as many utilities may set it on a socket. Also the tcp::debug DTrace probes look at this flag on a socket. Reviewed by: gnn, tuexen Discussed with: rscheff, rrs, jtl Differential revision: https://reviews.freebsd.org/D37694
* tcp: embed inpcb into tcpcbGleb Smirnoff2022-12-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the TCP protocol inpcb storage specify allocation size that would provide space to most of the data a TCP connection needs, embedding into struct tcpcb several structures, that previously were allocated separately. The most import one is the inpcb itself. With embedding we can provide strong guarantee that with a valid TCP inpcb the tcpcb is always valid and vice versa. Also we reduce number of allocs/frees per connection. The embedded inpcb is placed in the beginning of the struct tcpcb, since in_pcballoc() requires that. However, later we may want to move it around for cache line efficiency, and this can be done with a little effort. The new intotcpcb() macro is ready for such move. The congestion algorithm data, the TCP timers and osd(9) data are also embedded into tcpcb, and temprorary struct tcpcb_mem goes away. There was no extra allocation here, but we went through extra pointer every time we accessed this data. One interesting side effect is that now TCP data is allocated from SMR-protected zone. Potentially this allows the TCP stacks or other TCP related modules to utilize that for their own synchronization. Large part of the change was done with sed script: s/tp->ccv->/tp->t_ccv./g s/tp->ccv/\&tp->t_ccv/g s/tp->cc_algo/tp->t_cc/g s/tp->t_timers->tt_/tp->tt_/g s/CCV\(ccv, osd\)/\&CCV(ccv, t_osd)/g Dependency side effect is that code that needs to know struct tcpcb should also know struct inpcb, that added several <netinet/in_pcb.h>. Differential revision: https://reviews.freebsd.org/D37127
* systat: Fix a bunch of use after frees in fetch_ifstat().John Baldwin2022-11-221-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
* systat: remove INP_TIMEWAITGleb Smirnoff2022-10-071-11/+3
|
* Tcp progress timeoutRandall Stewart2022-09-271-4/+5
| | | | | | | | | | | Rack has had the ability to timeout connections that just sit idle automatically. This feature of course is off by default and requires the user set it on (though the socket option has been missing in tcp_usrreq.c). Lets get the progress timeout fully supported in the base stack as well as rack. Reviewed by: tuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D36716
* systat.1: Fix listsMateusz Piotrowski2022-04-011-7/+11
| | | | | | | | | Some of the lists were not displaying correctly. Fix that. Also, address linters errors. Fixes: 22054f88914b Report I/O stats from the CAM_IOSCHED_DYNAMIC extension MFC after: 1 week
* Report I/O stats from the CAM_IOSCHED_DYNAMIC extensionWarner Losh2022-02-286-1/+594
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Report, on a periodic basis, the I/O latencies the CAM I/O scheduler computes. These times are only for the hardware portion of the I/O as measured from the time the operation is scheduled with the SIM using xpt_action() until the SIM reports it has completed with xpt_dine(). Any time the I/O operation spends in a software queue is no included. The P50 (median), P90, P99 and P99.9 statistics about the latency of each of the read, write and trim operations that completed during the polling interval are reported. If there are fewer than 2, 10, 100 or 1000 operations during the polling interval, no statistic is reported and a single dash '-' is displayed. The read, write and trim commands (either on the command line or at run time) toggle display of these operations. The color command toggles color (it defaults to on, like gstat). When color is enabled, unknown statistics are reported in blue, high latency for a statistics is reported in red, medium in magenta and low in green (as with gstat). The med= and hi= commands can set these latency thresholds. Limitations: The entire sysctl space for all the devices is walked for each polling period. This should be optimized to remember the OIDs and only do such polling with the xpt generation changes. There is also no way to filter devices displayed. This command only works on physical devies that are connected to SCSI, ATA or NVME sims as those are the only ones that are instrumented in the CAM I/O scheduler (the CAM_IOSCHED_DYNAMIC option must be in the kernel, and the dynamic scheduler can't be disabled). MFC After: 1 month Relnotes: yes Sponsored by: Netflix Reviewed by: pauamma_gundo.com, chs Differential Revision: https://reviews.freebsd.org/D34259
* systat: Eliminate write-only unit variableWarner Losh2022-02-071-2/+1
| | | | Sponsored by: Netflix
* systat/iostat: Use bools for numbers and kbptWarner Losh2022-02-071-4/+5
| | | | | | These are really bools, declare them as such. Sponsored by: Netflix
* systat: Display seconds in vmstat modePeter Jeremy2022-01-291-1/+1
| | | | | | | | | Providing a timestamp with seconds granularity helps make it obvious that the display is updating. Reviewed by: mckusick MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29181
* systat -vm: Humanize output for ease of reading.Kirk McKusick2022-01-021-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 Reviewed by: mckusick MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D33495
* systat: clean up code assuming network classesMike Karels2021-11-091-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. MFC after: 1 month Reviewers: tuexen Differential Revision: https://reviews.freebsd.org/D32720
* systat: fix stack overflow when running -iostatMateusz Guzik2021-11-011-4/+4
| | | | | | The new buffer is arbitrarily sized to likely "big enough". Sponsored by: Rubicon Communications, LLC ("Netgate")
* systat: mostly clean up warnsMateusz Guzik2021-11-019-85/+65
| | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* Augment systat(1) -swap to display large swap space processesKonstantin Belousov2021-10-266-36/+361
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change updates the systat(1) -swap display to use libprocstat to obtain and display per-process swap space usage infomation following its existing swap devise/file statistics. It also incorporates the disk I/O information from the -vmstat display. The new screen looks like below with 'systat -swap': /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /10 Load Average | Device/Path Size Used |0% /10 /20 /30 /40 / 60\ 70\ 80\ 90\ 100| ada0s1b 2048M 2034M XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX zvol/sys/tempora 1024M 1015M XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX zvol/sys/swap 1024M 1014M XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Total 4096M 4063M XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Pid Username Command Swap/Total Per-Process Per-System 24153 hiro seamonkey 98M / 1G 7% 2% 23677 hiro xfce4-pane 28M / 81M 34% XXX 0% 23629 hiro xfce4-sess 25M / 118M 21% XX 0% 23681 hiro xfdesktop 20M / 58M 34% XXX 0% 23678 hiro thunar 15M / 43M 36% XXX 0% 23658 hiro at-spi-bus 14M / 23M 63% XXXXXX 0% 23660 hiro gvfsd 12M / 21M 56% XXXXX 0% Disks ada0 ada1 ada2 cd0 pass0 pass1 pass2 pass3 KB/t 8.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 tps 0 0 0 0 1 0 0 0 MB/s 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 %busy 0 0 0 0 0 0 0 0 Submitted by: Yoshihiro Ota MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29754
* ncurses: chase dependency changes in the source treeBaptiste Daroussin2021-10-041-1/+1
| | | | Differential Revision: https://reviews.freebsd.org/D32098
* Clean up copyright messages.Kirk McKusick2021-05-112-10/+8
| | | | | | Reported by: Yoshihiro Ota MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29354
* 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-45/+74
| | | | | | | | | | | 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