changeset 186:69eb54ce9c4b perf_counters

fix uninitialised semantic Data bug
author Nina Engelhardt <nengel@mailbox.tu-berlin.de>
date Tue, 31 Jan 2012 18:30:35 +0100
parents 28cc465f7eb7
children fe5ad5726e36
files MasterLoop.c VMS.c VMS.h
diffstat 3 files changed, 18 insertions(+), 7 deletions(-) [+]
line diff
     1.1 --- a/MasterLoop.c	Fri Jan 13 18:34:31 2012 +0100
     1.2 +++ b/MasterLoop.c	Tue Jan 31 18:30:35 2012 +0100
     1.3 @@ -115,6 +115,7 @@
     1.4        // smaller due to higher predictability of the fixed jmp.
     1.5     saveLowTimeStampCountInto( masterPr->startMasterTSCLow );
     1.6     #endif
     1.7 +
     1.8     //========================================================================
     1.9  
    1.10     masterEnv        = (MasterEnv*)_VMSMasterEnv;
    1.11 @@ -129,9 +130,9 @@
    1.12     slaveScheduler   = masterEnv->slaveScheduler;
    1.13     semanticEnv      = masterEnv->semanticEnv;
    1.14     
    1.15 -#ifdef MEAS__PERF_COUNTERS
    1.16 -   CounterHandler counterHandler = masterEnv->counterHandler;
    1.17 -#endif
    1.18 +   #ifdef MEAS__PERF_COUNTERS
    1.19 +   CounterHandler counterHandler = masterEnv->counterHandler;             
    1.20 +   #endif
    1.21  
    1.22        //Poll each slot's Done flag
    1.23     numSlotsFilled = 0;
    1.24 @@ -153,7 +154,7 @@
    1.25                 #ifdef MEAS__PERF_COUNTERS
    1.26                 uint64 cycles, instrs;
    1.27                 saveCyclesAndInstrs(thisCoresIdx,cycles, instrs);
    1.28 -               (*counterHandler)(MasterLoop_beforeReqHdlr,currSlot->procrAssignedToSlot,cycles,instrs);              
    1.29 +               //(*counterHandler)(MasterLoop_beforeReqHdlr,currSlot->procrAssignedToSlot,cycles,instrs);
    1.30                 #endif
    1.31                 //============================================================
    1.32           (*requestHandler)( currSlot->procrAssignedToSlot, semanticEnv );
    1.33 @@ -180,6 +181,8 @@
    1.34                 uint64 tmp_cycles;
    1.35                 uint64 tmp_instrs;
    1.36                 saveCyclesAndInstrs(thisCoresIdx,tmp_cycles,tmp_instrs);
    1.37 +               //FIXME WTF AM I DOING WHY DOES THIS EVEN WORK
    1.38 +               //(*counterHandler)(MasterLoop_beforeNextAssign,schedVirtPr,tmp_cycles,tmp_instrs);
    1.39                 #endif
    1.40           schedVirtPr =
    1.41            (*slaveScheduler)( semanticEnv, thisCoresIdx, slotIdx );
     2.1 --- a/VMS.c	Fri Jan 13 18:34:31 2012 +0100
     2.2 +++ b/VMS.c	Tue Jan 31 18:30:35 2012 +0100
     2.3 @@ -436,6 +436,12 @@
     2.4        //record time stamp: compare to time-stamp recorded below
     2.5     saveLowTimeStampCountInto( animatingPr->preSuspTSCLow );
     2.6     #endif
     2.7 +   #ifdef MEAS__PERF_COUNTERS
     2.8 +        //start work
     2.9 +   uint64 cycles,instrs;
    2.10 +   saveCyclesAndInstrs(animatingPr->coreAnimatedBy,cycles, instrs);
    2.11 +   (*(_VMSMasterEnv->counterHandler))(Procr_suspend,animatingPr,cycles,instrs); 
    2.12 +   #endif     
    2.13     //=======================================================================
    2.14  
    2.15     switchToCoreLoop(animatingPr);
     3.1 --- a/VMS.h	Fri Jan 13 18:34:31 2012 +0100
     3.2 +++ b/VMS.h	Tue Jan 31 18:30:35 2012 +0100
     3.3 @@ -42,7 +42,7 @@
     3.4  #define dbgAppFlow   FALSE /* Top level flow of application code -- general*/
     3.5  #define dbgProbes    FALSE /* for issues inside probes themselves*/
     3.6  #define dbgB2BMaster FALSE /* in coreloop, back to back master VPs*/
     3.7 -#define dbgRqstHdlr  FALSE /* in request handler code*/
     3.8 +#define dbgRqstHdlr  TRUE /* in request handler code*/
     3.9  #define dbgDependency TRUE /* in request handler code, print dependencies */
    3.10  
    3.11  //Comment or un- the substitute half to turn on/off types of debug message
    3.12 @@ -86,7 +86,7 @@
    3.13  
    3.14     // tradeoff amortizing master fixed overhead vs imbalance potential
    3.15     // when work-stealing, can make bigger, at risk of losing cache affinity
    3.16 -#define NUM_SCHED_SLOTS  5
    3.17 +#define NUM_SCHED_SLOTS  1
    3.18  
    3.19  #define MIN_WORK_UNIT_CYCLES 20000
    3.20  
    3.21 @@ -448,7 +448,9 @@
    3.22      MasterLoop_beforeAssign,
    3.23      MasterLoop_afterAssign,
    3.24      CoreLoop_afterWork,
    3.25 -    CoreLoop_beforeWork
    3.26 +    CoreLoop_beforeWork,
    3.27 +    Procr_suspend,
    3.28 +    MasterLoop_beforeNextAssign
    3.29  };
    3.30  
    3.31  #define getReturnAddressBeforeLibraryCall(vp_ptr, res_ptr) do{     \