git: 596a36ddc478 - main - vmstat: Add NOFREE page count to -s report

From: Bojan Novković <bnovkov_at_FreeBSD.org>
Date: Mon, 07 Oct 2024 16:48:55 UTC
The branch main has been updated by bnovkov:

URL: https://cgit.FreeBSD.org/src/commit/?id=596a36ddc47889e1b3bde00566cef2d8695c2847

commit 596a36ddc47889e1b3bde00566cef2d8695c2847
Author:     Bojan Novković <bnovkov@FreeBSD.org>
AuthorDate: 2024-10-07 15:02:42 +0000
Commit:     Bojan Novković <bnovkov@FreeBSD.org>
CommitDate: 2024-10-07 16:46:32 +0000

    vmstat: Add NOFREE page count to -s report
    
    This change adds the number of permanently allocated pages
    to the 'sum' structure report.
    
    Differential Revision:  https://reviews.freebsd.org/D46980
    Reviewed by:    markj
---
 usr.bin/vmstat/vmstat.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 8c7790403786..8d6c40a4d2fd 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -142,6 +142,7 @@ static struct __vmmeter {
 	u_int v_free_count;
 	u_int v_wire_count;
 	u_long v_user_wire_count;
+	u_int v_nofree_count;
 	u_int v_active_count;
 	u_int v_inactive_target;
 	u_int v_inactive_count;
@@ -558,6 +559,7 @@ fill_vmmeter(struct __vmmeter *vmmp)
 		GET_VM_STATS(vm, v_free_count);
 		GET_VM_STATS(vm, v_wire_count);
 		GET_VM_STATS(vm, v_user_wire_count);
+		GET_VM_STATS(vm, v_nofree_count);
 		GET_VM_STATS(vm, v_active_count);
 		GET_VM_STATS(vm, v_inactive_target);
 		GET_VM_STATS(vm, v_inactive_count);
@@ -1004,6 +1006,8 @@ dosum(void)
 	    sum.v_wire_count);
 	xo_emit("{:virtual-user-wired-pages/%9lu} {N:virtual user pages wired "
 	    "down}\n", sum.v_user_wire_count);
+	xo_emit("{:nofree-pages/%9u} {N:permanently allocated pages}\n",
+	    sum.v_nofree_count);
 	xo_emit("{:free-pages/%9u} {N:pages free}\n",
 	    sum.v_free_count);
 	xo_emit("{:bytes-per-page/%9u} {N:bytes per page}\n", sum.v_page_size);