svn commit: r327561 - head/sys/kern

John Baldwin jhb at freebsd.org
Fri Jan 5 19:43:56 UTC 2018


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


More information about the svn-src-head mailing list