1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00

Add vdso and stack names to the /proc/self/maps.

This commit is contained in:
Dmitry Chagin 2015-05-24 17:44:42 +00:00
parent a7ac457613
commit ffefd5707d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=283472

View File

@ -978,6 +978,8 @@ linprocfs_doprocenviron(PFS_FILL_ARGS)
static char l32_map_str[] = "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n";
static char l64_map_str[] = "%016lx-%016lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n";
static char vdso_str[] = " [vdso]";
static char stack_str[] = " [stack]";
/*
* Filler function for proc/pid/maps
@ -1014,6 +1016,11 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
vm = vmspace_acquire_ref(p);
if (vm == NULL)
return (ESRCH);
if (SV_CURPROC_FLAG(SV_LP64))
l_map_str = l64_map_str;
else
l_map_str = l32_map_str;
map = &vm->vm_map;
vm_map_lock_read(map);
for (entry = map->header.next; entry != &map->header;
@ -1056,6 +1063,11 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
VOP_GETATTR(vp, &vat, td->td_ucred);
ino = vat.va_fileid;
vput(vp);
} else if (SV_PROC_ABI(p) == SV_ABI_LINUX) {
if (e_start == p->p_sysent->sv_shared_page_base)
name = vdso_str;
if (e_end == p->p_sysent->sv_usrstack)
name = stack_str;
}
} else {
flags = 0;
@ -1067,10 +1079,6 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
* format:
* start, end, access, offset, major, minor, inode, name.
*/
if (SV_CURPROC_FLAG(SV_LP64))
l_map_str = l64_map_str;
else
l_map_str = l32_map_str;
error = sbuf_printf(sb, l_map_str,
(u_long)e_start, (u_long)e_end,
(e_prot & VM_PROT_READ)?"r":"-",