aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-02-14 00:37:24 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-02-14 01:24:58 +0000
commit25c6318c7906f6f4e0c66ce16f81bdb830ba2e3b (patch)
tree2e661b37eb7d1b45f319716456de1863c5b957c2 /sys
parentbffc3fb3c09b36fd8740242f184d1e8bd8530920 (diff)
downloadsrc-25c6318c7906f6f4e0c66ce16f81bdb830ba2e3b.tar.gz
src-25c6318c7906f6f4e0c66ce16f81bdb830ba2e3b.zip
procstat: distinguish vm map guards in procstat vm output.
Requested and reviewed by: rwatson (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28658
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_proc.c7
-rw-r--r--sys/sys/user.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 305bc7e8a2ef..f8fed2573712 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -2514,7 +2514,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);
@@ -2584,6 +2584,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);
@@ -2620,7 +2622,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 f60d73b77f3e..f882e7dcd699 100644
--- a/sys/sys/user.h
+++ b/sys/sys/user.h
@@ -465,6 +465,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