From: Philippe Waroquiers Date: Sun, 10 May 2015 22:40:38 +0000 (+0000) Subject: Improves the way arena statistics are shown X-Git-Tag: svn/VALGRIND_3_11_0~409 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4fd265155816c9b712e7e10e54e8ae3468687614;p=thirdparty%2Fvalgrind.git Improves the way arena statistics are shown The mmap'd max/curr and max/curr nr of bytes will be shown e.g. as 11,440,408/ 4,508,968 instead of 11440656/ 4509200 So, using more space, but more readable (in particular when the nr exceeds the width, and so are not aligned anymore) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15208 --- diff --git a/coregrind/m_gdbserver/server.c b/coregrind/m_gdbserver/server.c index 94aec301bf..deedddf118 100644 --- a/coregrind/m_gdbserver/server.c +++ b/coregrind/m_gdbserver/server.c @@ -157,9 +157,10 @@ void VG_(print_all_stats) (Bool memory_stats, Bool tool_stats) VG_(message)(Vg_DebugMsg, "------ Valgrind's internal memory use stats follow ------\n" ); VG_(sanity_check_malloc_all)(); - VG_(message)(Vg_DebugMsg, - "------ %llu bytes have already been mmap-ed ANONYMOUS.\n", - VG_(am_get_anonsize_total)()); + VG_(message) + (Vg_DebugMsg, + "------ %'13llu bytes have already been mmap-ed ANONYMOUS.\n", + VG_(am_get_anonsize_total)()); VG_(print_all_arena_stats)(); if (VG_(clo_profile_heap)) VG_(print_arena_cc_analysis) (); @@ -386,7 +387,7 @@ int handle_gdb_valgrind_command (char *mon, OutputSink *sink_wanted_at_return) VG_(gdbserver_status_output)(); break; case 4: /* memory */ - VG_(printf) ("%llu bytes have already been mmap-ed ANONYMOUS.\n", + VG_(printf) ("%'13llu bytes have already been mmap-ed ANONYMOUS.\n", VG_(am_get_anonsize_total)()); VG_(print_all_arena_stats) (); if (VG_(clo_profile_heap)) diff --git a/coregrind/m_mallocfree.c b/coregrind/m_mallocfree.c index 51441b87e8..d8d354487a 100644 --- a/coregrind/m_mallocfree.c +++ b/coregrind/m_mallocfree.c @@ -625,9 +625,9 @@ void VG_(print_all_arena_stats) ( void ) for (i = 0; i < VG_N_ARENAS; i++) { Arena* a = arenaId_to_ArenaP(i); VG_(message)(Vg_DebugMsg, - "%-8s: %8lu/%8lu max/curr mmap'd, " + "%-8s: %'13lu/%'13lu max/curr mmap'd, " "%llu/%llu unsplit/split sb unmmap'd, " - "%8lu/%8lu max/curr, " + "%'13lu/%'13lu max/curr, " "%10llu/%10llu totalloc-blocks/bytes," " %10llu searches %lu rzB\n", a->name, @@ -758,7 +758,7 @@ void VG_(out_of_memory_NORETURN) ( const HChar* who, SizeT szB ) "\n" " Valgrind's memory management: out of memory:\n" " %s's request for %llu bytes failed.\n" - " %llu bytes have already been mmap-ed ANONYMOUS.\n" + " %'13llu bytes have already been mmap-ed ANONYMOUS.\n" " Valgrind cannot continue. Sorry.\n\n" " There are several possible reasons for this.\n" " - You have some kind of memory limit in place. Look at the\n"