From owner-svn-src-head@FreeBSD.ORG Fri Oct 31 05:43:19 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4D7B1065670; Fri, 31 Oct 2008 05:43:19 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B75648FC12; Fri, 31 Oct 2008 05:43:19 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9V5hJS8071202; Fri, 31 Oct 2008 05:43:19 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9V5hJwK071200; Fri, 31 Oct 2008 05:43:19 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <200810310543.m9V5hJwK071200@svn.freebsd.org> From: Peter Wemm Date: Fri, 31 Oct 2008 05:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184492 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2008 05:43:19 -0000 Author: peter Date: Fri Oct 31 05:43:19 2008 New Revision: 184492 URL: http://svn.freebsd.org/changeset/base/184492 Log: 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. Modified: head/sys/kern/kern_proc.c head/sys/sys/user.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Oct 31 02:36:28 2008 (r184491) +++ head/sys/kern/kern_proc.c Fri Oct 31 05:43:19 2008 (r184492) @@ -1341,6 +1341,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; @@ -1400,6 +1402,8 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR 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_AR 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_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: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Fri Oct 31 02:36:28 2008 (r184491) +++ head/sys/sys/user.h Fri Oct 31 05:43:19 2008 (r184492) @@ -326,7 +326,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. */ }; /*