]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add some stats to helgrind stats:
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Tue, 21 Apr 2015 21:58:14 +0000 (21:58 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Tue, 21 Apr 2015 21:58:14 +0000 (21:58 +0000)
* nr of client malloc-ed blocks
* how many OldRef helgrind has, and the distribution
  of these OldRef according to the nr of accs they have

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

helgrind/hg_main.c
helgrind/libhb_core.c

index f9917eadc95e11b06d9c94dd9716bbda92544ec5..e1e7b87786bc79e2b4ac2193358bbeec41ff1e40 100644 (file)
@@ -5359,6 +5359,9 @@ static void hg_print_stats (void)
                HG_(stats__LockN_to_P_queries),
                HG_(stats__LockN_to_P_get_map_size)() );
 
+   VG_(printf)("client malloc-ed blocks: %'8d\n",
+               VG_(HT_count_nodes)(hg_mallocmeta_table));
+               
    VG_(printf)("string table map: %'8llu queries (%llu map size)\n",
                HG_(stats__string_table_queries),
                HG_(stats__string_table_get_map_size)() );
index a187e28fd065f7293c5f987162d52033f318b983..dca8774af0aab0e57d9fe96b07edf261bd451f94 100644 (file)
@@ -6120,6 +6120,33 @@ void libhb_shutdown ( Bool show_stats )
       }
 
       VG_(printf)("%s","\n");
+      {
+         UWord OldRef_accs_n[N_OLDREF_ACCS+1];
+         UInt accs_n;
+         UWord OldRef_n;
+         UInt i;
+
+         OldRef_n = 0;
+         for (i = 0; i <= N_OLDREF_ACCS; i++)
+            OldRef_accs_n[i] = 0;
+
+         for (OldRef* o = mru.prev; o != &lru; o = o->prev) {
+            OldRef_n++;
+            accs_n = 0;
+            for (i = 0; i < N_OLDREF_ACCS; i++) {
+               if (o->accs[i].thrid != 0)
+                  accs_n++;
+            }
+            OldRef_accs_n[accs_n]++;
+         }
+
+         tl_assert(OldRef_n == oldrefTreeN);
+         VG_(printf)( "   libhb: oldrefTreeN %lu ", oldrefTreeN);
+         VG_(printf)( "( ");
+         for (i = 0; i <= N_OLDREF_ACCS; i++)
+            VG_(printf)( "accs[%d]=%lu ", i, OldRef_accs_n[i]);
+         VG_(printf)( ")\n");
+      }
       VG_(printf)( "   libhb: ctxt__rcdec: 1=%lu(%lu eq), 2=%lu, 3=%lu\n",
                    stats__ctxt_rcdec1, stats__ctxt_rcdec1_eq,
                    stats__ctxt_rcdec2,