diff options
author | peter <peter@FreeBSD.org> | 2008-10-31 05:43:19 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2008-10-31 05:43:19 +0000 |
commit | 1f7fd22cbb0aee819818bb3aefce34cfa71e0ee6 (patch) | |
tree | 5e5eb7c963e218ef9bb1e9d8e757a13df6f96623 /sys/kern | |
parent | 197f3f98a5edab8de78c93285d33fe4961b41eb6 (diff) | |
download | FreeBSD-src-1f7fd22cbb0aee819818bb3aefce34cfa71e0ee6.zip FreeBSD-src-1f7fd22cbb0aee819818bb3aefce34cfa71e0ee6.tar.gz |
Add three extra to the kinfo_proc_vmmap data. kve_offset - the offset
within an object that a mapping refers to. fileid and fsid are inode/dev
for vnodes. (Linux procfs has these and valgrind is really unhappy
without them.) I believe I didn't change the size of the struct.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_proc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 02e6c41..aa48bd5 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1341,6 +1341,8 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS) unsigned int last_timestamp; char *fullpath, *freepath; struct kinfo_vmentry *kve; + struct vattr va; + struct ucred *cred; int error, *name; struct vnode *vp; struct proc *p; @@ -1400,6 +1402,8 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS) lobj = tobj; } + kve->kve_fileid = 0; + kve->kve_fsid = 0; freepath = NULL; fullpath = ""; if (lobj) { @@ -1440,6 +1444,11 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vn_fullpath(curthread, vp, &fullpath, &freepath); + cred = curthread->td_ucred; + if (VOP_GETATTR(vp, &va, cred) == 0) { + kve->kve_fileid = va.va_fileid; + kve->kve_fsid = va.va_fsid; + } vput(vp); VFS_UNLOCK_GIANT(vfslocked); } @@ -1451,6 +1460,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS) 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; |