aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/vmstat
Commit message (Collapse)AuthorAgeFilesLines
* vmstat: Print the number of wired pages in each objectMark Johnston2025-10-101-1/+3
| | | | | | | | Reviewed by: alc, kib MFC after: 1 week Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D53008
* manpages: prefer linking to xo_options.7 over xo_parse_args.3Alan Somers2025-07-161-3/+3
| | | | | | | | | | | | | | | Most libxo-enabled utilities link to xo_parse_args.3. But that man page doesn't actually describe how to format command-line arguments. Rather, xo_options.7 does. I suspect that these utilities link to the former because the latter man page did not exist until libxo-0.7.2 (8a6eceff3ce). And newer utilities have probably been copy/pasting the same text from older ones. But the superior man page does exist now, so we should link to it instead. MFC after: 2 weeks Sponsored by: ConnectWise Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D51354
* vmstat: Add a column to vmstat -o output for laundry pagesMark Johnston2024-10-221-2/+3
| | | | | | Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47215
* Update Makefile.depend filesSimon J. Gerraty2024-10-141-0/+10
| | | | | | | After building packages we have a number of new and updated Makefile.depend files Reviewed by: stevek
* vmstat: Fix column header alignment in -o outputMark Johnston2024-10-131-1/+1
| | | | MFC after: 1 week
* vmstat(8): Complete libxo transitionYan-Hao Wang2024-10-121-11/+15
| | | | | | Reviewed by: des MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41432
* vmstat -o: report objects backing posix shm segmentsKonstantin Belousov2024-10-081-0/+2
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46970
* vmstat: Add NOFREE page count to -s reportBojan Novković2024-10-071-0/+4
| | | | | | | | This change adds the number of permanently allocated pages to the 'sum' structure report. Differential Revision: https://reviews.freebsd.org/D46980 Reviewed by: markj
* vmstat -o: report objects backing SysV shm segmentsKonstantin Belousov2024-10-071-0/+3
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46959
* Fix xo_emit format string for percentagesJohn F. Carr2024-09-221-1/+1
| | | | | | | | The "%lld" format string was used with a value of type long. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278532. Reviewed by: imp, mmel Pull Request: https://github.com/freebsd/freebsd-src/pull/1344
* vmstat: Add root element to libxo outputBram Ton2024-09-031-1/+3
| | | | | | | | | | | Current libxo output does not have a root element. Valid XML requires a single root element. This commit adds this root element. The libxo output version bumped accordingly. PR: 254635 MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1330
* Remove residual blank line at start of MakefileWarner Losh2024-07-152-2/+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
* vmstat: Rely on libxo for numbers humanizationAlexander Motin2023-12-081-116/+51
| | | | | | | This makes code cleaner, plus fixes such nonsense as humanized JSON and XML, making all numbers raw without quotes, spaces, suffixes, etc. MFC after: 2 weeks
* vmstat: Let libxo properly humanize -m numbersAlexander Motin2023-12-071-6/+8
| | | | | | Raw numbers can be seen in json/xml or with --libxo=no-humanize. MFC after: 2 weeks
* vmstat: Improve -z formatting for large names/valuesAlexander Motin2023-12-061-11/+10
| | | | MFC after: 2 weeks
* vmstat: fix column names broken in c168508655720Maxim Sobolev2023-12-051-1/+1
| | | | | | Loss of the trailing space in the multi-line format string has resulted in column name being emitted as "FAILSLEEP", instead of two columns "FAIL" and "SLEEP".
* Remove copyright strings ifdef'd outWarner Losh2023-11-271-10/+0
| | | | | | | | | | | We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals. These copyright strings are present in the comments and are largely from CSRG's attempt at adding their copyright to every binary file (which modern interpretations of the license doesn't require). Sponsored by: Netflix
* usr.bin: Remove ancient SCCS tags.Warner Losh2023-11-273-6/+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
* Add interface NVME to devstatAlexander Motin2023-11-161-0/+2
| | | | | This allows to list only NVMe devices in systat, iostat, vmstat, etc. Previously those were counted as OTHER.
* vmstat: Make disks reporting some more reasonableAlexander Motin2023-11-161-14/+20
| | | | MFC after: 1 month
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-163-3/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-3/+1
|
* vmstat: fix overflow of interrupt name bufferElliott Mitchell2023-01-201-1/+1
| | | | | | | | | | | sysctl() provides a count of number of bytes in the buffer. That is the actual buffer length. Whereas looking for an interrupt entry with an empty name could terminate too early, or overflow the end of the buffer. The overflow will occur if the table of interrupt names is full. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D36628
* vmstat: remove shadow variablesElliott Mitchell2023-01-201-10/+7
| | | | | | | | | | These appear to simply be the style of arguments are left untouched and only local variables are modified. While some may prefer that style this simply serves to complicate things as they're perfectly writeable. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D36628
* vmstat: remove processor counting from getcpuinfo()Elliott Mitchell2022-09-301-10/+5
| | | | | | | | | As `ncpus` was otherwise unused, keeping track was pointless. Gets rid of a warning from an unused variable. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D36628
* vmstat: correct historyWarner Losh2021-06-211-2/+2
| | | | | | | vmstat dates back to 3BSD, but wasn't in 32V nor the 7th edition. It does not seem to have been in AT&T's commercial offerings at all. Sponsored by: Netflix
* Add a way to map arm64 non-posted device memoryAndrew Turner2021-05-011-0/+3
| | | | | | | | | | On arm64 we currently use a non-posted write for device memory, however we should move to use posted writes. This is expected to work on most hardware, however we will need to support a non-posted option for some broken hardware. Reviewed by: imp, manu, bcr (manpage) Differential Revision: https://reviews.freebsd.org/D29722
* Use if ... else when printing memory attributesAndrew Turner2021-04-111-36/+18
| | | | | | | | | | | | | | In vmstat there is a switch statement that converts these attributes to a string. As some values can be duplicate we have to hide these from userspace. Replace this switch statement with an if ... else macro that lets us repeat values without a compiler error. Reviewed by: kib MFC after: 2 weeks Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D29703
* vmstat: drop the HighUse field from malloc dumpMateusz Guzik2020-11-091-5/+4
| | | | | | | | | | It is hardwired to "-" since its introduction in 2005. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D27141 Notes: svn path=/head/; revision=367534
* vmstat: remove spurious newlines when reporting zonesMateusz Guzik2020-11-091-2/+1
| | | | Notes: svn path=/head/; revision=367501
* malloc: export kernel zones instead of relying on them being power-of-2Mateusz Guzik2020-11-021-4/+6
| | | | | | | | Reviewed by: markj (previous version) Differential Revision: https://reviews.freebsd.org/D27026 Notes: svn path=/head/; revision=367274
* Describe the value in the 're' column of vmstat(8) in terms of freebsd's vmIan Lepore2020-07-261-1/+1
| | | | | | | | | implementation. The old description was left over from the 4.4 BSD Lite import in 1994, and was a bit misleading (not all arches use simulated reference bits, some implement reference tracking in hardware). Notes: svn path=/head/; revision=363576
* Remove commented-out lines describing the old never-implemented -t option.Ian Lepore2020-07-261-4/+1
| | | | | | | | | | | In 2018, r338094 removed the commented-out code for supporting the -t command line option which had been present since the BSD 4.4 Lite import, but was never implemented for freebsd. This does the same for the man page. Notes: svn path=/head/; revision=363569
* Add HISTORY sections to banner(6), basename(1), limits(1) and vmstat(8)Gordon Bergling2020-06-181-1/+6
| | | | | | | | | | Reviewed by: bcr (mentor) Approved by: bcr (mentor) MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D25019 Notes: svn path=/head/; revision=362327
* Move type casts into a single place. No functional changes.Edward Tomasz Napierala2019-12-291-23/+15
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=356171
* Humanize more columns in the vmstat(8) output and adjust widths.Edward Tomasz Napierala2019-11-081-29/+51
| | | | | | | | | | | | The few columns that are not humanized are usually 0. This makes the output mostly aligned. Reviewed by: allanjude MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22185 Notes: svn path=/head/; revision=354533
* Fix column title alignment.Edward Tomasz Napierala2019-10-291-3/+3
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=354154
* Add two new kernel options to control memory locality on NUMA hardware.Jeff Roberson2019-08-061-4/+5
| | | | | | | | | | | | | | | | - UMA_XDOMAIN enables an additional per-cpu bucket for freed memory that was freed on a different domain from where it was allocated. This is only used for UMA_ZONE_NUMA (first-touch) zones. - UMA_FIRSTTOUCH sets the default UMA policy to be first-touch for all zones. This tries to maintain locality for kernel memory. Reviewed by: gallatin, alc, kib Tested by: pho, gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20929 Notes: svn path=/head/; revision=350659
* Provide separate accounting for user-wired pages.Mark Johnston2019-05-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically we have not distinguished between kernel wirings and user wirings for accounting purposes. User wirings (via mlock(2)) were subject to a global limit on the number of wired pages, so if large swaths of physical memory were wired by the kernel, as happens with the ZFS ARC among other things, the limit could be exceeded, causing user wirings to fail. The change adds a new counter, v_user_wire_count, which counts the number of virtual pages wired by user processes via mlock(2) and mlockall(2). Only user-wired pages are subject to the system-wide limit which helps provide some safety against deadlocks. In particular, while sources of kernel wirings typically support some backpressure mechanism, there is no way to reclaim user-wired pages shorting of killing the wiring process. The limit is exported as vm.max_user_wired, renamed from vm.max_wired, and changed from u_int to u_long. The choice to count virtual user-wired pages rather than physical pages was done for simplicity. There are mechanisms that can cause user-wired mappings to be destroyed while maintaining a wiring of the backing physical page; these make it difficult to accurately track user wirings at the physical page layer. The change also closes some holes which allowed user wirings to succeed even when they would cause the system limit to be exceeded. For instance, mmap() may now fail with ENOMEM in a process that has called mlockall(MCL_FUTURE) if the new mapping would cause the user wiring limit to be exceeded. Note that bhyve -S is subject to the user wiring limit, which defaults to 1/3 of physical RAM. Users that wish to exceed the limit must tune vm.max_user_wired. Reviewed by: kib, ngie (mlock() test changes) Tested by: pho (earlier version) MFC after: 45 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19908 Notes: svn path=/head/; revision=347532
* Dynamically allocate IRQ ranges on x86.John Baldwin2018-08-281-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, x86 used static ranges of IRQ values for different types of I/O interrupts. Interrupt pins on I/O APICs and 8259A PICs used IRQ values from 0 to 254. MSI interrupts used a compile-time-defined range starting at 256, and Xen event channels used a compile-time-defined range after MSI. Some recent systems have more than 255 I/O APIC interrupt pins which resulted in those IRQ values overflowing into the MSI range triggering an assertion failure. Replace statically assigned ranges with dynamic ranges. Do a single pass computing the sizes of the IRQ ranges (PICs, MSI, Xen) to determine the total number of IRQs required. Allocate the interrupt source and interrupt count arrays dynamically once this pass has completed. To minimize runtime complexity these arrays are only sized once during bootup. The PIC range is determined by the PICs present in the system. The MSI and Xen ranges continue to use a fixed size, though this does make it possible to turn the MSI range size into a tunable in the future. As a result, various places are updated to use dynamic limits instead of constants. In addition, the vmstat(8) utility has been taught to understand that some kernels may treat 'intrcnt' and 'intrnames' as pointers rather than arrays when extracting interrupt stats from a crashdump. This is determined by the presence (vs absence) of a global 'nintrcnt' symbol. This change reverts r189404 which worked around a buggy BIOS which enumerated an I/O APIC twice (using the same memory mapped address for both entries but using an IRQ base of 256 for one entry and a valid IRQ base for the second entry). Making the "base" of MSI IRQ values dynamic avoids the panic that r189404 worked around, and there may now be valid I/O APICs with an IRQ base above 256 which this workaround would incorrectly skip. If in the future the issue reported in PR 130483 reoccurs, we will have to add a pass over the I/O APIC entries in the MADT to detect duplicates using the memory mapped address and use some strategy to choose the "correct" one. While here, reserve room in intrcnts for the Hyper-V counters. PR: 229429, 130483 Reviewed by: kib, royger, cem Tested by: royger (Xen), kib (DMAR) Approved by: re (gjb) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16861 Notes: svn path=/head/; revision=338360
* Fully retire the unimplemented -t option from vmstat(8).John Baldwin2018-08-201-43/+2
| | | | | | | | | | | | It was #ifdef'd out in the 4.4BSD import and hasn't been re-enabled since then. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16804 Notes: svn path=/head/; revision=338094
* 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
* Temporarily widen count for interrupt rate calculations on 32-bit archsJustin Hibbits2018-02-081-1/+1
| | | | | | | | | | | | | If the interrupt count is very high (greater than ~42M), notably on one-shot execution on long running systems, the intermediate multiplication step in the rate calculation will overflow the width of a 32-bit architecture long (32 bits), causing the rest of the calculation to calculate with a truncated value, and report very low rates (sometimes 0). MFC after: 2 weeks Notes: svn path=/head/; revision=329013
* Update various statements in vmstat(8) to match reality.John Baldwin2018-01-181-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - The process stats are actually thread counts rather than process counts. - Simplify various descriptions to remove mention of stats that are updated every 5 seconds (all VM related stats are now "instant", only the load average is updated every 5 seconds). - Don't make any mention of special treatment for processes that have been active in the last 20 seconds. We don't track that stat. - Rework the description of active virtual memory. Call it mapped virtual memory and explicitly point out it is not the same as the active page queue (which corresponds to "Active" in top(1)), and also hint at the possible bogusness of the value (e.g. if a process maps a single page out of a multiple GB file, the entire file's size is considered mapped). - Simplify a few descriptions that implied their output was a value per interval. All of the "rate" values are per-second rates scaled across the interval. - Update a few comments for 'struct vmtotal' along similar lines. Reported by: mwlucas (indirectly) Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13905 Notes: svn path=/head/; revision=328134
* vmstat(8): Hook up NetBSD testsKyle Evans2018-01-112-0/+14
| | | | | | | | | The NetBSD tests for vmstat are basically just a smoke test, ensuring that executing `vmstat` and `vmstat -s` exit successfully. This is more than we test now, so go with it. Notes: svn path=/head/; revision=327832
* Re-add spaces lost in r326436.Mark Johnston2017-12-141-4/+4
| | | | | | | X-MFC with: r326436 Notes: svn path=/head/; revision=326852
* vmstat: fix style(9) violations and bump WARNS.Konstantin Belousov2017-12-012-263/+218
| | | | | | | | | | | Based on the patch by: Pawel Biernacki <pawel.biernacki@gmail.com> Sponsored by: Mysterious Code Ltd. (Pawel), The FreeBSD Foundation (me) MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13228 Notes: svn path=/head/; revision=326436
* vmstat: use 64-bit counters from struct vmtotal.Konstantin Belousov2017-11-231-6/+6
| | | | | | | | | | | Consistently print counters using unsigned intmax type. Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com> Sponsored by: Mysterious Code Ltd. Differential revision: https://reviews.freebsd.org/D13199 Notes: svn path=/head/; revision=326139