From owner-svn-src-head@freebsd.org Fri Jan 5 19:43:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44DD6EBC75F; Fri, 5 Jan 2018 19:43:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 215F37A9D7; Fri, 5 Jan 2018 19:43:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-202-155.ca.astound.net [66.234.202.155]) by mail.baldwin.cx (Postfix) with ESMTPSA id C625D10AFBF; Fri, 5 Jan 2018 14:43:53 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327561 - head/sys/kern Date: Thu, 04 Jan 2018 16:11:41 -0800 Message-ID: <1649262.tCGsAUtXnD@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201801042159.w04LxYfW099338@repo.freebsd.org> References: <201801042159.w04LxYfW099338@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 05 Jan 2018 14:43:53 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 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, 05 Jan 2018 19:43:56 -0000 On Thursday, January 04, 2018 09:59:34 PM John Baldwin wrote: > Author: jhb > Date: Thu Jan 4 21:59:34 2018 > New Revision: 327561 > URL: https://svnweb.freebsd.org/changeset/base/327561 > > Log: > Report offset relative to the backing object for kinfo_vmentry structures. > > For the pathname reported in kinfo_vmentry structures (kve_path), the > sysctl handlers walk the object chain to find the bottom-most VM object. > This permits a COW mapping of a file with dirty pages to report the > pathname of the originally mapped file. Do the same for the object > offset (kve_offset) computing a cumulative offset during the same object > walk so that the reported offset is relative to the reported pathname. > > Note that ptrace(PT_VM_ENTRY) already returns a cumulative offset > rather than the raw offset of the VM map entry. > > Note also that this does not affect procstat -v output (even structured > output) since that output does not include the kve_offset field. In particular, this does affect the output of 'info proc mappings' in a set of GDB patches currently under review. Before: (gdb) info proc mappings process 34399 Mapped address spaces: Start Addr End Addr Size Offset Flags File 0x400000 0x408000 0x8000 0x0 r-x C--- /bin/ls 0x607000 0x609000 0x2000 0x0 rw- ---- 0x800607000 0x800628000 0x21000 0x0 r-x C--- /libexec/ld-elf.so.1 0x800628000 0x800630000 0x8000 0x0 rw- ---- 0x800631000 0x800652000 0x21000 0x0 rw- ---- 0x800827000 0x800828000 0x1000 0x0 rw- C--- /libexec/ld-elf.so.1 0x800828000 0x800829000 0x1000 0x0 rw- ---- 0x800829000 0x800845000 0x1c000 0x0 r-x CN-- /lib/libxo.so.0 0x800845000 0x800a45000 0x200000 0x1c000 --- CN-- 0x800a45000 0x800a46000 0x1000 0x0 rw- C--- /lib/libxo.so.0 After: (gdb) info proc mappings process 822 Mapped address spaces: Start Addr End Addr Size Offset Flags File 0x400000 0x408000 0x8000 0x0 r-x C--- /bin/ls 0x607000 0x608000 0x1000 0x0 rw- ---- 0x800607000 0x800629000 0x22000 0x0 r-x C--- /libexec/ld-elf.so.1 0x800629000 0x800649000 0x20000 0x0 rw- ---- 0x800649000 0x80064a000 0x1000 0x0 r-- ---- 0x80064a000 0x800653000 0x9000 0x0 rw- ---- 0x800829000 0x80082b000 0x2000 0x0 rw- ---- 0x80082b000 0x800847000 0x1c000 0x0 r-x CN-- /lib/libxo.so.0 0x800847000 0x800a47000 0x200000 0x1c000 --- CN-- 0x800a47000 0x800a48000 0x1000 0x1c000 rw- C--- /lib/libxo.so.0 -- John Baldwin