]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add stats in helgrind for oldref history found versus not found
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 23 May 2015 12:25:22 +0000 (12:25 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 23 May 2015 12:25:22 +0000 (12:25 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15283

helgrind/libhb_core.c

index d507394502ab54b3890eea65044bf80dbe1502b8..7fbca3ab90d5915699c746a83710911cb0d2e6a5 100644 (file)
@@ -4226,6 +4226,8 @@ static inline SVal Ptr2SVal (void* ptr)
    it's not straightforward to do.
 */
 
+static UWord stats__evm__lookup_found = 0;
+static UWord stats__evm__lookup_notfound = 0;
 
 static UWord stats__ctxt_rcdec1 = 0;
 static UWord stats__ctxt_rcdec2 = 0;
@@ -4800,6 +4802,7 @@ Bool libhb_event_map_lookup ( /*OUT*/ExeContext** resEC,
          *resSzB     = cand_szB;
          *resIsW     = cand_isW;
          *locksHeldW = cand_locksHeldW;
+         stats__evm__lookup_found++;
          return True;
       }
 
@@ -4807,6 +4810,7 @@ Bool libhb_event_map_lookup ( /*OUT*/ExeContext** resEC,
    } /* for (j = 0; j < nToCheck; j++) */
 
    /* really didn't find anything. */
+   stats__evm__lookup_notfound++;
    return False;
 }
 
@@ -6525,6 +6529,8 @@ void libhb_shutdown ( Bool show_stats )
          for (i = 0; i <= N_OLDREF_ACCS; i++)
             VG_(printf)( "accs[%d]=%lu ", i, OldRef_accs_n[i]);
          VG_(printf)( ")\n");
+         VG_(printf)( "   libhb: oldref lookup found=%lu notfound=%lu\n",
+                      stats__evm__lookup_found, stats__evm__lookup_notfound);
       }
       VG_(printf)( "   libhb: ctxt__rcdec: 1=%lu(%lu eq), 2=%lu, 3=%lu\n",
                    stats__ctxt_rcdec1, stats__ctxt_rcdec1_eq,