Date: Sun, 21 Feb 2021 09:47:42 GMT From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 1946484bcc15 - stable/12 - procstat: distinguish vm map guards in procstat vm output. Message-ID: <202102210947.11L9lgcF086011@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1946484bcc156f69a08203aabfab61a15e53bf55 commit 1946484bcc156f69a08203aabfab61a15e53bf55 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-02-14 00:37:24 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-02-21 09:44:36 +0000 procstat: distinguish vm map guards in procstat vm output. (cherry picked from commit 25c6318c7906f6f4e0c66ce16f81bdb830ba2e3b) --- sys/kern/kern_proc.c | 7 +++++-- sys/sys/user.h | 1 + usr.bin/procstat/procstat.1 | 4 +++- usr.bin/procstat/procstat_vm.c | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 5b7a663f0d62..239e5790f8dd 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2457,7 +2457,7 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) vm_offset_t addr; unsigned int last_timestamp; int error; - bool super; + bool guard, super; PROC_LOCK_ASSERT(p, MA_OWNED); @@ -2528,6 +2528,8 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) if (entry->eflags & MAP_ENTRY_USER_WIRED) kve->kve_flags |= KVME_FLAG_USER_WIRED; + guard = (entry->eflags & MAP_ENTRY_GUARD) != 0; + last_timestamp = map->timestamp; vm_map_unlock_read(map); @@ -2602,7 +2604,8 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) vput(vp); } } else { - kve->kve_type = KVME_TYPE_NONE; + kve->kve_type = guard ? KVME_TYPE_GUARD : + KVME_TYPE_NONE; kve->kve_ref_count = 0; kve->kve_shadow_count = 0; } diff --git a/sys/sys/user.h b/sys/sys/user.h index 75661257528b..78867fe418e4 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -459,6 +459,7 @@ struct kinfo_file { #define KVME_TYPE_DEAD 6 #define KVME_TYPE_SG 7 #define KVME_TYPE_MGTDEVICE 8 +#define KVME_TYPE_GUARD 9 #define KVME_TYPE_UNKNOWN 255 #define KVME_PROT_READ 0x00000001 diff --git a/usr.bin/procstat/procstat.1 b/usr.bin/procstat/procstat.1 index 17da8648b714..e42931e6336c 100644 --- a/usr.bin/procstat/procstat.1 +++ b/usr.bin/procstat/procstat.1 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2020 +.Dd February 13, 2021 .Dt PROCSTAT 1 .Os .Sh NAME @@ -674,6 +674,8 @@ scatter/gather swap .It vn vnode +.It gd +guard (pseudo-type) .El .Pp The following mapping flags may be displayed: diff --git a/usr.bin/procstat/procstat_vm.c b/usr.bin/procstat/procstat_vm.c index 13a4e1cf03af..7d698fefdc30 100644 --- a/usr.bin/procstat/procstat_vm.c +++ b/usr.bin/procstat/procstat_vm.c @@ -155,6 +155,10 @@ procstat_vm(struct procstat *procstat, struct kinfo_proc *kipp) str = "md"; lstr = "managed_device"; break; + case KVME_TYPE_GUARD: + str = "gd"; + lstr = "guard"; + break; case KVME_TYPE_UNKNOWN: default: str = "??";
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102210947.11L9lgcF086011>