summaryrefslogtreecommitdiff
path: root/usr.bin/vmstat
AgeCommit message (Collapse)Author
2025-10-10vmstat: Print the number of wired pages in each objectMark Johnston
Reviewed by: alc, kib MFC after: 1 week Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D53008
2025-07-16manpages: prefer linking to xo_options.7 over xo_parse_args.3Alan Somers
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
2024-10-22vmstat: Add a column to vmstat -o output for laundry pagesMark Johnston
Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47215
2024-10-14Update Makefile.depend filesSimon J. Gerraty
After building packages we have a number of new and updated Makefile.depend files Reviewed by: stevek
2024-10-13vmstat: Fix column header alignment in -o outputMark Johnston
MFC after: 1 week
2024-10-13vmstat(8): Complete libxo transitionYan-Hao Wang
Reviewed by: des MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41432
2024-10-08vmstat -o: report objects backing posix shm segmentsKonstantin Belousov
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46970
2024-10-07vmstat: Add NOFREE page count to -s reportBojan Novković
This change adds the number of permanently allocated pages to the 'sum' structure report. Differential Revision: https://reviews.freebsd.org/D46980 Reviewed by: markj
2024-10-07vmstat -o: report objects backing SysV shm segmentsKonstantin Belousov
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46959
2024-09-22Fix xo_emit format string for percentagesJohn F. Carr
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
2024-09-02vmstat: Add root element to libxo outputBram Ton
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
2024-07-15Remove residual blank line at start of MakefileWarner Losh
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
2023-12-07vmstat: Rely on libxo for numbers humanizationAlexander Motin
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
2023-12-06vmstat: Let libxo properly humanize -m numbersAlexander Motin
Raw numbers can be seen in json/xml or with --libxo=no-humanize. MFC after: 2 weeks
2023-12-06vmstat: Improve -z formatting for large names/valuesAlexander Motin
MFC after: 2 weeks
2023-12-04vmstat: fix column names broken in c168508655720Maxim Sobolev
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".
2023-11-26Remove copyright strings ifdef'd outWarner Losh
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
2023-11-26usr.bin: Remove ancient SCCS tags.Warner Losh
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
2023-11-15Add interface NVME to devstatAlexander Motin
This allows to list only NVMe devices in systat, iostat, vmstat, etc. Previously those were counted as OTHER.
2023-11-15vmstat: Make disks reporting some more reasonableAlexander Motin
MFC after: 1 month
2023-08-16Remove $FreeBSD$: one-line nroff patternWarner Losh
Remove /^\.\\"\s*\$FreeBSD\$$\n/
2023-08-16Remove $FreeBSD$: one-line sh patternWarner Losh
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-04-18Update/fix Makefile.depend for userlandSimon J. Gerraty
2023-01-20vmstat: fix overflow of interrupt name bufferElliott Mitchell
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
2023-01-20vmstat: remove shadow variablesElliott Mitchell
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
2022-09-30vmstat: remove processor counting from getcpuinfo()Elliott Mitchell
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
2021-06-21vmstat: correct historyWarner Losh
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
2021-05-01Add a way to map arm64 non-posted device memoryAndrew Turner
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
2021-04-11Use if ... else when printing memory attributesAndrew Turner
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
2020-11-09vmstat: drop the HighUse field from malloc dumpMateusz Guzik
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
2020-11-09vmstat: remove spurious newlines when reporting zonesMateusz Guzik
Notes: svn path=/head/; revision=367501
2020-11-02malloc: export kernel zones instead of relying on them being power-of-2Mateusz Guzik
Reviewed by: markj (previous version) Differential Revision: https://reviews.freebsd.org/D27026 Notes: svn path=/head/; revision=367274
2020-07-26Describe the value in the 're' column of vmstat(8) in terms of freebsd's vmIan Lepore
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
2020-07-26Remove commented-out lines describing the old never-implemented -t option.Ian Lepore
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
2020-06-18Add HISTORY sections to banner(6), basename(1), limits(1) and vmstat(8)Gordon Bergling
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
2019-12-29Move type casts into a single place. No functional changes.Edward Tomasz Napierala
MFC after: 2 weeks Notes: svn path=/head/; revision=356171
2019-11-08Humanize more columns in the vmstat(8) output and adjust widths.Edward Tomasz Napierala
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
2019-10-29Fix column title alignment.Edward Tomasz Napierala
MFC after: 2 weeks Notes: svn path=/head/; revision=354154
2019-08-06Add two new kernel options to control memory locality on NUMA hardware.Jeff Roberson
- 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
2019-05-13Provide separate accounting for user-wired pages.Mark Johnston
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
2018-08-28Dynamically allocate IRQ ranges on x86.John Baldwin
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
2018-08-20Fully retire the unimplemented -t option from vmstat(8).John Baldwin
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
2018-06-13vmstat(1): various nitsEitan Adler
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
2018-02-08Temporarily widen count for interrupt rate calculations on 32-bit archsJustin Hibbits
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
2018-01-18Update various statements in vmstat(8) to match reality.John Baldwin
- 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
2018-01-11vmstat(8): Hook up NetBSD testsKyle Evans
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
2017-12-14Re-add spaces lost in r326436.Mark Johnston
X-MFC with: r326436 Notes: svn path=/head/; revision=326852
2017-12-01vmstat: fix style(9) violations and bump WARNS.Konstantin Belousov
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
2017-11-23vmstat: use 64-bit counters from struct vmtotal.Konstantin Belousov
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