git: 65b832eb6ff7 - main - procstat vm: report SysV shm segment mapping

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Mon, 07 Oct 2024 08:25:04 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=65b832eb6ff76464a65cbf6ba730a54364a5fdc2

commit 65b832eb6ff76464a65cbf6ba730a54364a5fdc2
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-10-05 09:34:59 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-10-07 08:22:12 +0000

    procstat vm: report SysV shm segment mapping
    
    Also print its key and sequence number.
    
    Reviewed by:    markj
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D46959
---
 usr.bin/procstat/procstat_vm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/usr.bin/procstat/procstat_vm.c b/usr.bin/procstat/procstat_vm.c
index 843c941c89c8..e899b365a9d1 100644
--- a/usr.bin/procstat/procstat_vm.c
+++ b/usr.bin/procstat/procstat_vm.c
@@ -114,6 +114,8 @@ procstat_vm(struct procstat *procstat, struct kinfo_proc *kipp)
 		    KVME_FLAG_GROWS_DOWN ? "true" : "false");
 		xo_emit("{en:wired/%s}", kve->kve_flags &
 		    KVME_FLAG_USER_WIRED ? "true" : "false");
+		xo_emit("{en:sysvshm/%s}", kve->kve_flags &
+		    KVME_FLAG_SYSVSHM ? "true" : "false");
 		xo_close_container("kve_flags");
 		switch (kve->kve_type) {
 		case KVME_TYPE_NONE:
@@ -164,6 +166,10 @@ procstat_vm(struct procstat *procstat, struct kinfo_proc *kipp)
 		}
 		xo_emit("{d:kve_type/%-2s} ", str);
 		xo_emit("{e:kve_type/%s}", lstr);
+		if ((kve->kve_flags & KVME_FLAG_SYSVSHM) != 0)
+			xo_emit(" {:sysvipc:/sysvshm(%ju:%u)/%ju:%u}",
+			    (uintmax_t)kve->kve_vn_fileid,
+			    kve->kve_vn_fsid_freebsd11);
 		xo_emit("{:kve_path/%-s/%s}\n", kve->kve_path);
 		xo_close_instance("vm");
 	}