Date: Sun, 24 May 2015 17:44:42 +0000 (UTC) From: Dmitry Chagin <dchagin@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283472 - head/sys/compat/linprocfs Message-ID: <201505241744.t4OHigr1029866@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dchagin Date: Sun May 24 17:44:42 2015 New Revision: 283472 URL: https://svnweb.freebsd.org/changeset/base/283472 Log: Add vdso and stack names to the /proc/self/maps. Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Sun May 24 17:44:08 2015 (r283471) +++ head/sys/compat/linprocfs/linprocfs.c Sun May 24 17:44:42 2015 (r283472) @@ -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":"-",
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505241744.t4OHigr1029866>