Index: usr.bin/procstat/procstat_vm.c =================================================================== --- usr.bin/procstat/procstat_vm.c (revision 184429) +++ usr.bin/procstat/procstat_vm.c (working copy) @@ -41,16 +41,17 @@ procstat_vm(pid_t pid, struct kinfo_proc *kipp __unused) { struct kinfo_vmentry *freep, *kve; - int error, name[4], ptrwidth; + int error, name[4], ptrwidth, offwidth; unsigned int i; const char *str; size_t len; ptrwidth = 2*sizeof(void *) + 2; + offwidth = 2*sizeof(off_t) + 2; if (!hflag) - printf("%5s %*s %*s %3s %4s %4s %3s %3s %2s %-2s %-s\n", + printf("%5s %*s %*s %3s %4s %4s %3s %3s %2s %-2s %*s %-s\n", "PID", ptrwidth, "START", ptrwidth, "END", "PRT", "RES", - "PRES", "REF", "SHD", "FL", "TP", "PATH"); + "PRES", "REF", "SHD", "FL", "TP", offwidth, "OFFSET", "PATH"); name[0] = CTL_KERN; name[1] = KERN_PROC; @@ -125,6 +126,7 @@ break; } printf("%-2s ", str); + printf("%#*llx ", offwidth, (unsigned long long)kve->kve_offset); printf("%-s\n", kve->kve_path); } free(freep); Index: usr.bin/procstat/procstat.1 =================================================================== --- usr.bin/procstat/procstat.1 (revision 184429) +++ usr.bin/procstat/procstat.1 (working copy) @@ -293,6 +293,8 @@ mapping flags .It TP VM object type +.It OFFSET +mapping offset within VM object .El .Pp The following protection flags may be displayed: Index: sys/kern/kern_proc.c =================================================================== --- sys/kern/kern_proc.c (revision 184429) +++ sys/kern/kern_proc.c (working copy) @@ -1451,6 +1451,7 @@ kve->kve_start = (void*)entry->start; kve->kve_end = (void*)entry->end; + kve->kve_offset = (off_t)entry->offset; if (entry->protection & VM_PROT_READ) kve->kve_protection |= KVME_PROT_READ; Index: sys/sys/user.h =================================================================== --- sys/sys/user.h (revision 184429) +++ sys/sys/user.h (working copy) @@ -325,7 +325,11 @@ int kve_ref_count; /* VM obj ref count. */ int kve_shadow_count; /* VM obj shadow count. */ char kve_path[PATH_MAX]; /* Path to VM obj, if any. */ - void *_kve_pspare[8]; /* Space for more stuff. */ + off_t kve_offset; /* Mapping offset within object */ + /* Similar hack to struct stat. See notes there. */ + unsigned int :(8 / 2) * ((2 * (int)sizeof(void *)) - (int)sizeof(off_t)); + unsigned int :(8 / 2) * ((2 * (int)sizeof(void *)) - (int)sizeof(off_t)); + void *_kve_pspare[6]; /* Space for more stuff. */ int _kve_ispare[8]; /* Space for more stuff. */ };