Add mmapped count and size in malloc_info
Commit Message
Hi,
malloc_info currently only gives information about allocations on
heap, which is not complete without information about allocations that
were satisfied using mmap. This trivial patch adds this information
as a new element to the xml.
This patch goes on top of Ondrej's patch to inline mi_arena. OK to
commit?
Siddhesh
* malloc/malloc (malloc_info): Also print mmapped statistics.
Comments
On Fri, May 30, 2014 at 01:27:50PM +0530, Siddhesh Poyarekar wrote:
> Hi,
>
> malloc_info currently only gives information about allocations on
> heap, which is not complete without information about allocations that
> were satisfied using mmap. This trivial patch adds this information
> as a new element to the xml.
>
> This patch goes on top of Ondrej's patch to inline mi_arena. OK to
> commit?
>
ok for me
> "<total type=\"fast\" count=\"%zu\" size=\"%zu\"/>\n"
> "<total type=\"rest\" count=\"%zu\" size=\"%zu\"/>\n"
> + "<mmap nr=\"%zu\" size=\"%zu\"/>\n"
Looks like this should be:
<total type="mmap" count="%zu" size="%zu"/>
No?
On 30 May 2014 21:52, Roland McGrath <roland@hack.frob.com> wrote:
>> "<total type=\"fast\" count=\"%zu\" size=\"%zu\"/>\n"
>> "<total type=\"rest\" count=\"%zu\" size=\"%zu\"/>\n"
>> + "<mmap nr=\"%zu\" size=\"%zu\"/>\n"
>
> Looks like this should be:
>
> <total type="mmap" count="%zu" size="%zu"/>
>
> No?
Thanks, that does read better. I'll use it.
Siddhesh
@@ -5148,12 +5148,14 @@ malloc_info (int options, FILE *fp)
fprintf (fp,
"<total type=\"fast\" count=\"%zu\" size=\"%zu\"/>\n"
"<total type=\"rest\" count=\"%zu\" size=\"%zu\"/>\n"
+ "<mmap nr=\"%zu\" size=\"%zu\"/>\n"
"<system type=\"current\" size=\"%zu\"/>\n"
"<system type=\"max\" size=\"%zu\"/>\n"
"<aspace type=\"total\" size=\"%zu\"/>\n"
"<aspace type=\"mprotect\" size=\"%zu\"/>\n"
"</malloc>\n",
total_nfastblocks, total_fastavail, total_nblocks, total_avail,
+ mp_.n_mmaps, mp_.mmapped_mem,
total_system, total_max_system,
total_aspace, total_aspace_mprotect);