]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Tweak stats printing -- use more consistent function names, improve output
authorNicholas Nethercote <n.nethercote@gmail.com>
Tue, 3 Aug 2004 18:08:50 +0000 (18:08 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Tue, 3 Aug 2004 18:08:50 +0000 (18:08 +0000)
formatting slightly, etc.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2561

coregrind/vg_execontext.c
coregrind/vg_include.h
coregrind/vg_main.c
coregrind/vg_syscalls.c
coregrind/vg_translate.c

index f2e9752e29a09e8f516b09a27c2381eb656b3f7e..7dd56c3b15f125229787702654ad3a50f9b45f13 100644 (file)
@@ -81,8 +81,8 @@ static void init_ExeContext_storage ( void )
 }
 
 
-/* Show stats. */
-void VG_(show_ExeContext_stats) ( void )
+/* Print stats. */
+void VG_(print_ExeContext_stats) ( void )
 {
    init_ExeContext_storage();
    VG_(message)(Vg_DebugMsg, 
index 92a95d177851ea9ee94cdc7d00044ffee922e2ea..f79f3d1e5c14d28b269b79f19193df32f148a343 100644 (file)
@@ -381,7 +381,7 @@ extern Int   VG_(arena_payload_szB) ( ArenaId aid, void* payload );
 
 extern void  VG_(mallocSanityCheckAll)   ( void );
 
-extern void  VG_(show_all_arena_stats) ( void );
+extern void  VG_(print_all_arena_stats) ( void );
 extern Bool  VG_(is_empty_arena) ( ArenaId aid );
 
 /* ---------------------------------------------------------------------
@@ -1155,7 +1155,7 @@ struct _ExeContext {
 
 
 /* Print stats (informational only). */
-extern void VG_(show_ExeContext_stats) ( void );
+extern void VG_(print_ExeContext_stats) ( void );
 
 /* Like VG_(get_ExeContext), but with a slightly different type */
 extern ExeContext* VG_(get_ExeContext2) ( Addr eip, Addr ebp,
@@ -1427,7 +1427,7 @@ extern void VG_(atfork)(vg_atfork_t pre, vg_atfork_t parent, vg_atfork_t child);
 
 /* fd leakage calls. */
 extern void VG_(init_preopened_fds) ( void );
-extern void VG_(fd_stats) ( void );
+extern void VG_(show_open_fds) ( void );
 
 /* ---------------------------------------------------------------------
    Exports of vg_transtab.c
index ed14246afa4f648b096e143c6fb13d6031545379..7c8f50e62fa27932b2af131eb0571f8a8b07ebb9 100644 (file)
@@ -206,11 +206,14 @@ static __inline__ Int safe_idiv(Int a, Int b)
    return (b == 0 ? 0 : a / b);
 }
 
-static void show_counts ( void )
+static void print_all_stats ( void )
 {
+   // Translation stats
    VG_(message)(Vg_DebugMsg,
-               "    TT/TC: %d tc sectors discarded.",
+                "    TT/TC: %d tc sectors discarded.",
                 VG_(number_of_tc_discards) );
+   VG_(message)(Vg_DebugMsg,
+                "           %d tt_fast misses.", VG_(tt_fast_misses));
    VG_(message)(Vg_DebugMsg,
                 "           %d chainings, %d unchainings.",
                 VG_(bb_enchain_count), VG_(bb_dechain_count) );
@@ -227,22 +230,40 @@ static void show_counts ( void )
                 VG_(overall_out_tsize),
                 safe_idiv(10*VG_(overall_out_tsize), VG_(overall_out_osize)));
    VG_(message)(Vg_DebugMsg,
-      " dispatch: %llu jumps (bb entries), of which %u (%lu%%) were unchained.",
+      " dispatch: %llu jumps (bb entries); of them %u (%lu%%) unchained.",
       VG_(bbs_done), 
       VG_(unchained_jumps_done),
       ((ULong)(100) * (ULong)(VG_(unchained_jumps_done)))
          / ( VG_(bbs_done)==0 ? 1 : VG_(bbs_done) )
    );
 
+   // Scheduler stats
    VG_(print_scheduler_stats)();
-   VG_(message)(Vg_DebugMsg,
-      "           %d tt_fast misses.", VG_(tt_fast_misses));
 
+   // Reg-alloc stats
    VG_(print_reg_alloc_stats)();
    VG_(message)(Vg_DebugMsg, 
                 "   sanity: %d cheap, %d expensive checks.",
                 sanity_fast_count, sanity_slow_count );
+
+   // C call stats
    VG_(print_ccall_stats)();
+
+   // UInstr histogram 
+   if (VG_(clo_verbosity) > 3)
+      VG_(print_UInstr_histogram)();
+
+   // Memory stats
+   if (0) {
+      VG_(message)(Vg_DebugMsg, "");
+      VG_(message)(Vg_DebugMsg, 
+         "------ Valgrind's internal memory use stats follow ------" );
+      VG_(mallocSanityCheckAll)();
+      VG_(print_all_arena_stats)();
+      VG_(message)(Vg_DebugMsg, 
+         "------ Valgrind's ExeContext management stats follow ------" );
+      VG_(print_ExeContext_stats)();
+   }
 }
 
 
@@ -3011,7 +3032,7 @@ int main(int argc, char **argv)
 
    /* Print out file descriptor summary and stats. */
    if (VG_(clo_track_fds))
-      VG_(fd_stats)();
+      VG_(show_open_fds)();
 
    if (VG_(needs).core_errors || VG_(needs).skin_errors)
       VG_(show_all_errors)();
@@ -3021,22 +3042,8 @@ int main(int argc, char **argv)
    VG_(do_sanity_checks)( True /*include expensive checks*/ );
 
    if (VG_(clo_verbosity) > 1)
-      show_counts();
-
-   if (VG_(clo_verbosity) > 3)
-      VG_(print_UInstr_histogram)();
+      print_all_stats();
 
-   if (0) {
-      VG_(message)(Vg_DebugMsg, "");
-      VG_(message)(Vg_DebugMsg, 
-         "------ Valgrind's internal memory use stats follow ------" );
-      VG_(mallocSanityCheckAll)();
-      VG_(show_all_arena_stats)();
-      VG_(message)(Vg_DebugMsg, 
-         "------ Valgrind's ExeContext management stats follow ------" );
-      VG_(show_ExeContext_stats)();
-   }
    if (VG_(clo_profile))
       VGP_(done_profiling)();
 
index 40367070c30e0e9c1f35a2459c735e284021de69..569ca7661e6b1ba2d71e12510c3868bbdc150be3 100644 (file)
@@ -563,15 +563,12 @@ getsockdetails(int fd)
 }
 
 
-/* Dump out a summary, and optionally a more detailed list, of open file
-   descriptors. */
-
-void VG_(fd_stats) ()
+/* Dump out a summary, and a more detailed list, of open file descriptors. */
+void VG_(show_open_fds) ()
 {
    OpenFd *i = allocated_fds;
 
-   VG_(message)(Vg_UserMsg,
-                "FILE DESCRIPTORS: %d open at exit.", fd_count);
+   VG_(message)(Vg_UserMsg, "FILE DESCRIPTORS: %d open at exit.", fd_count);
 
    while(i) {
       if(i->pathname) {
index 42b2998dd96735f9e9b844fdff12dfb0f0679167..c2efa4f037fdc0abd3981522648e02605e7d39cd 100644 (file)
@@ -49,10 +49,12 @@ static UInt n_total_reg_rank; // total of register ranks over all translations
 void VG_(print_reg_alloc_stats)(void)
 {
    VG_(message)(Vg_DebugMsg, 
-                "reg-alloc: %d t-req-spill, "
-                "%d+%d orig+spill uis, %d total-reg-r.",
+                "reg-alloc: %d t-req-spill, %d+%d orig+spill uis,",
                 n_translations_needing_spill, 
-                n_uinstrs_prealloc, n_uinstrs_spill, n_total_reg_rank );
+                n_uinstrs_prealloc, n_uinstrs_spill );
+   VG_(message)(Vg_DebugMsg, 
+                "           %d total-reg-rank",
+                n_total_reg_rank );
 }
 
 /*------------------------------------------------------------*/