Skip to content

Commit

Permalink
Add mmap usage in malloc_info output
Browse files Browse the repository at this point in the history
The current malloc_info xml output only has information about
allocations on the heap.  Display information about number of mappings
and total mmapped size to this to complete the picture.
  • Loading branch information
Siddhesh Poyarekar committed May 30, 2014
1 parent 5190c17 commit 4d653a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2014-05-30 Siddhesh Poyarekar <siddhesh@redhat.com>
Roland McGrath <roland@hack.frob.com>

* malloc/malloc (malloc_info): Also print mmapped statistics.

2014-05-30 Roland McGrath <roland@hack.frob.com>

* sysdeps/unix/sysv/linux/m68k/arch-fork.h: New file.
Expand Down
2 changes: 2 additions & 0 deletions malloc/malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
"<total type=\"mmap\" count=\"%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);

Expand Down

0 comments on commit 4d653a5

Please sign in to comment.