]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Finally make VG_(bbs_done) agree exactly with what Lackey measures.
authorJulian Seward <jseward@acm.org>
Thu, 28 Oct 2004 10:31:15 +0000 (10:31 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 28 Oct 2004 10:31:15 +0000 (10:31 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@446

VEX/head20041019/coregrind/vg_dispatch.S
VEX/head20041019/coregrind/vg_scheduler.c

index edfbb6d1b07aeb30fa7fac0f65d8522e853c0b6e..569724b368131bebed47195fb1ddccb9814d5e5e 100644 (file)
@@ -135,11 +135,13 @@ dispatch_boring:
        
 fast_lookup_failed:
        /* %EIP is up to date here since dispatch_boring dominates */
+       addl    $1, VG_(dispatch_ctr)
        movl    $VG_TRC_INNER_FASTMISS, %eax
        jmp     run_innerloop_exit
 
 counter_is_zero:
        /* %EIP is up to date here since dispatch_boring dominates */
+       addl    $1, VG_(dispatch_ctr)
        movl    $VG_TRC_INNER_COUNTERZERO, %eax
        jmp     run_innerloop_exit
        
index 66743301a195fa71d8f351f27b0b2d9c38c67554..c5a56e1ac270ce24a4ee1ea6bf513e567c0d3e7a 100644 (file)
@@ -352,7 +352,7 @@ UInt run_thread_for_a_while ( ThreadId tid )
 
    save_thread_state ( tid );
 
-   done_this_time = (Int)dispatch_ctr_SAVED - (Int)VG_(dispatch_ctr) - 1;
+   done_this_time = (Int)dispatch_ctr_SAVED - (Int)VG_(dispatch_ctr) - 0;
 
    vg_assert(done_this_time >= 0);
    VG_(bbs_done) += (ULong)done_this_time;
@@ -890,7 +890,7 @@ VgSchedReturnCode do_scheduler ( Int* exitcode, ThreadId* last_run_tid )
          if (trc == VG_TRC_INNER_FASTMISS) {
             Addr ip = ARCH_INSTR_PTR(VG_(threads)[tid].arch);
 
-            vg_assert(VG_(dispatch_ctr) > 0);
+            vg_assert(VG_(dispatch_ctr) > 1);
 
             /* Trivial event.  Miss in the fast-cache.  Do a full
                lookup for it. */
@@ -1068,7 +1068,7 @@ VgSchedReturnCode do_scheduler ( Int* exitcode, ThreadId* last_run_tid )
             /* Timeslice is out.  Let a new thread be scheduled,
                simply by doing nothing, causing us to arrive back at
                Phase 1. */
-            vg_assert(VG_(dispatch_ctr) == 0);
+            vg_assert(VG_(dispatch_ctr) == 1);
             break;
 
          case VG_TRC_UNRESUMABLE_SIGNAL: