diff VMS.c @ 41:cf3e9238aeb0

Measure suspend and master times works -- refactored
author Me
date Sat, 11 Sep 2010 04:40:12 -0700
parents 1df8d7f2c9b1
children 72373405c816 8f7141a9272e
line diff
     1.1 --- a/VMS.c	Sat Sep 11 03:26:07 2010 -0700
     1.2 +++ b/VMS.c	Sat Sep 11 04:40:12 2010 -0700
     1.3 @@ -128,19 +128,6 @@
     1.4  
     1.5  //   initFreeList();
     1.6  
     1.7 -   //============================= MEASUREMENT STUFF ========================
     1.8 -   #ifdef MEAS__TIME_STAMP_SUSP
     1.9 -      //RDTSC may run out of order, and so measure a time-span different
    1.10 -      // from the desired time-span  --  got some weird changes in suspend
    1.11 -      // hist when added Master hist
    1.12 -   _VMSMasterEnv->measSuspHist   = makeHistogram( 25, 110, 1300 );
    1.13 -   #endif
    1.14 -
    1.15 -   #ifdef MEAS__TIME_MASTER
    1.16 -   _VMSMasterEnv->measMasterHist = makeHistogram( 25, 500, 800 );
    1.17 -   #endif
    1.18 -   //========================================================================
    1.19 -
    1.20   }
    1.21  
    1.22  /*
    1.23 @@ -371,10 +358,12 @@
    1.24     /* clobber */ : "%eax" \
    1.25                  );
    1.26  
    1.27 +   //===========================  Measurement stuff ========================
    1.28     #ifdef MEAS__TIME_STAMP_SUSP
    1.29 -      //record time stamp: compare to time-stamp recorded below, at resume
    1.30 +      //record time stamp: compare to time-stamp recorded below
    1.31     saveLowTimeStampCountInto( animatingPr->preSuspTSCLow );
    1.32     #endif
    1.33 +   //=======================================================================
    1.34  
    1.35        //restore coreloop's frame ptr, then jump back to "start" of core loop
    1.36        //Note, GCC compiles to assembly that saves esp and ebp in the stack
    1.37 @@ -392,13 +381,8 @@
    1.38  
    1.39  ResumePt:
    1.40     #ifdef MEAS__TIME_STAMP_SUSP
    1.41 +      //NOTE: only take low part of count -- do sanity check when take diff
    1.42     saveLowTimeStampCountInto( animatingPr->postSuspTSCLow );
    1.43 -      //Take difference between the pre-suspend and post-suspend times
    1.44 -      // and do sanity check to see if rollover happened between
    1.45 -   int  diff = animatingPr->postSuspTSCLow - animatingPr->preSuspTSCLow;
    1.46 -   if( diff > 1000000 ) diff = 0;
    1.47 -   addToHist( diff, _VMSMasterEnv->measSuspHist );
    1.48 -
    1.49     #endif
    1.50  
    1.51     return;