svn commit: r184741 - in stable/7/sys: . kern modules/cxgb sys

Peter Wemm peter at FreeBSD.org
Thu Nov 6 14:32:20 PST 2008


Author: peter
Date: Thu Nov  6 22:32:19 2008
New Revision: 184741
URL: http://svn.freebsd.org/changeset/base/184741

Log:
  MFC: r184492 - add offset / fileid / fsid to KERN_PROC_VMMAP sysctl
  for the benefit of valgrind.
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/kern/kern_proc.c
  stable/7/sys/modules/cxgb/   (props changed)
  stable/7/sys/sys/user.h

Modified: stable/7/sys/kern/kern_proc.c
==============================================================================
--- stable/7/sys/kern/kern_proc.c	Thu Nov  6 22:28:04 2008	(r184740)
+++ stable/7/sys/kern/kern_proc.c	Thu Nov  6 22:32:19 2008	(r184741)
@@ -1346,6 +1346,8 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR
 	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;
@@ -1405,6 +1407,8 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR
 			lobj = tobj;
 		}
 
+		kve->kve_fileid = 0;
+		kve->kve_fsid = 0;
 		freepath = NULL;
 		fullpath = "";
 		if (lobj) {
@@ -1446,6 +1450,11 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR
 				    curthread);
 				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);
 			}
@@ -1457,6 +1466,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR
 
 		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;

Modified: stable/7/sys/sys/user.h
==============================================================================
--- stable/7/sys/sys/user.h	Thu Nov  6 22:28:04 2008	(r184740)
+++ stable/7/sys/sys/user.h	Thu Nov  6 22:32:19 2008	(r184741)
@@ -320,7 +320,10 @@ struct kinfo_vmentry {
 	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. */
-	int	 _kve_ispare[8];		/* Space for more stuff. */
+	off_t	 kve_offset;			/* Mapping offset in object */
+	uint64_t kve_fileid;			/* inode number of vnode */
+	dev_t	 kve_fsid;			/* dev_t of vnode location */
+	int	 _kve_ispare[3];		/* Space for more stuff. */
 };
 
 /*


More information about the svn-src-stable mailing list