changeset 23:f81d6df5313e V0 version_that_goes_into_paper

working version for exe vs task time, has lang-spec meas macros that used to be in VMS.h
author Merten Sach <msach@mailbox.tu-berlin.de>
date Wed, 07 Dec 2011 06:21:38 +0100
parents a6b1b0946c8a
children 258ff77b64b1
files .hgignore VMS_lang_specific_defines.h VPThread_PluginFns.c VPThread_Request_Handlers.c VPThread_Request_Handlers.h
diffstat 5 files changed, 102 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/.hgignore	Wed Dec 07 05:17:02 2011 +0100
     1.2 +++ b/.hgignore	Wed Dec 07 06:21:38 2011 +0100
     1.3 @@ -1,3 +1,4 @@
     1.4  syntax: glob
     1.5  
     1.6  *.o
     1.7 +*~
     2.1 --- a/VMS_lang_specific_defines.h	Wed Dec 07 05:17:02 2011 +0100
     2.2 +++ b/VMS_lang_specific_defines.h	Wed Dec 07 06:21:38 2011 +0100
     2.3 @@ -40,6 +40,9 @@
     2.4      saveLowTimeStampCountInto( endStamp ); \
     2.5      addIntervalToHist( startStamp, endStamp, \
     2.6                                   _VMSMasterEnv->measHists[ createHistIdx ] );
     2.7 +#else
     2.8 +#define Meas_startCreate
     2.9 +#define Meas_endCreate
    2.10  #endif
    2.11  
    2.12  #endif	/* VPTHREAD_HELPER_H */
     3.1 --- a/VPThread_PluginFns.c	Wed Dec 07 05:17:02 2011 +0100
     3.2 +++ b/VPThread_PluginFns.c	Wed Dec 07 06:21:38 2011 +0100
     3.3 @@ -159,9 +159,7 @@
     3.4   { VPThdSemReq *semReq;
     3.5     VirtProcr    *newPr;
     3.6      
     3.7 -    //========================= MEASUREMENT STUFF ======================
     3.8 -    Meas_startCreate
     3.9 -    //==================================================================
    3.10 +         Meas_startCreate
    3.11       
    3.12     semReq = VMS__take_sem_reqst_from( req );
    3.13     
     4.1 --- a/VPThread_Request_Handlers.c	Wed Dec 07 05:17:02 2011 +0100
     4.2 +++ b/VPThread_Request_Handlers.c	Wed Dec 07 06:21:38 2011 +0100
     4.3 @@ -15,6 +15,8 @@
     4.4  #include "VPThread.h"
     4.5  #include "VMS/vmalloc.h"
     4.6  
     4.7 +#include "VPThread_Request_Handlers.h"
     4.8 +
     4.9  
    4.10  
    4.11  //===============================  Mutexes  =================================
    4.12 @@ -59,7 +61,7 @@
    4.13      {
    4.14        mutex->holderOfLock = semReq->requestingPr;
    4.15        
    4.16 -         //re-animate requester, now that it has the lock
    4.17 +         //re-animate requester, now that it has the lock (puts in readyQ)
    4.18        resume_procr( semReq->requestingPr, semEnv );
    4.19      }
    4.20     else //queue up requester to wait for release of lock
     5.1 --- a/VPThread_Request_Handlers.h	Wed Dec 07 05:17:02 2011 +0100
     5.2 +++ b/VPThread_Request_Handlers.h	Wed Dec 07 06:21:38 2011 +0100
     5.3 @@ -52,6 +52,100 @@
     5.4  handleTransEnd( VPThdSemReq *semReq, VirtProcr *requestingPr,
     5.5                  VPThdSemEnv *semEnv);
     5.6  
     5.7 +#ifdef MEAS__TIME_PLUGIN
     5.8 +#define Meas_startMutexLock \
     5.9 +    int32 startStamp, endStamp; \
    5.10 +    saveLowTimeStampCountInto( startStamp ); \
    5.11 +
    5.12 +#define Meas_endMutexLock \
    5.13 +    saveLowTimeStampCountInto( endStamp ); \
    5.14 +    addIntervalToHist( startStamp, endStamp, \
    5.15 +                              _VMSMasterEnv->measHists[ mutexLockHistIdx ] );
    5.16 +
    5.17 +#define Meas_startMutexUnlock \
    5.18 +    int32 startStamp, endStamp; \
    5.19 +    saveLowTimeStampCountInto( startStamp ); \
    5.20 +
    5.21 +#define Meas_endMutexUnlock \
    5.22 +    saveLowTimeStampCountInto( endStamp ); \
    5.23 +    addIntervalToHist( startStamp, endStamp, \
    5.24 +                            _VMSMasterEnv->measHists[ mutexUnlockHistIdx ] );
    5.25 +
    5.26 +#define Meas_startCondWait \
    5.27 +    int32 startStamp, endStamp; \
    5.28 +    saveLowTimeStampCountInto( startStamp ); \
    5.29 +
    5.30 +#define Meas_endCondWait \
    5.31 +    saveLowTimeStampCountInto( endStamp ); \
    5.32 +    addIntervalToHist( startStamp, endStamp, \
    5.33 +                               _VMSMasterEnv->measHists[ condWaitHistIdx ] );
    5.34 +
    5.35 +#define Meas_startCondSignal \
    5.36 +    int32 startStamp, endStamp; \
    5.37 +    saveLowTimeStampCountInto( startStamp ); \
    5.38 +
    5.39 +#define Meas_endCondSignal \
    5.40 +    saveLowTimeStampCountInto( endStamp ); \
    5.41 +    addIntervalToHist( startStamp, endStamp, \
    5.42 +                             _VMSMasterEnv->measHists[ condSignalHistIdx ] );
    5.43 +
    5.44 +#elif defined MEAS__TIME_2011_SYS
    5.45 +#define Meas_startMutexLock \
    5.46 +    TSCountLowHigh endStamp; \
    5.47 +    uint64 numCycles;
    5.48 +
    5.49 +#define Meas_endMutexLock \
    5.50 +    saveTSCLowHigh( endStamp ); \
    5.51 +    numCycles = endStamp.longVal - _VMSMasterEnv->startReqHdlr.longVal; \
    5.52 +    numCycles += _VMSMasterEnv->cyclesTillStartMasterLoop; \
    5.53 +    _VMSMasterEnv->totalPluginCycles += numCycles; \
    5.54 +    _VMSMasterEnv->numPluginAnimations++;
    5.55 +
    5.56 +
    5.57 +#define Meas_startMutexUnlock \
    5.58 +    TSCountLowHigh endStamp; \
    5.59 +    uint64 numCycles; 
    5.60 +
    5.61 +#define Meas_endMutexUnlock \
    5.62 +    saveTSCLowHigh( endStamp ); \
    5.63 +    numCycles = endStamp.longVal - _VMSMasterEnv->startReqHdlr.longVal; \
    5.64 +    numCycles += _VMSMasterEnv->cyclesTillStartMasterLoop; \
    5.65 +    _VMSMasterEnv->totalPluginCycles += numCycles; \
    5.66 +    _VMSMasterEnv->numPluginAnimations++;
    5.67 +
    5.68 +
    5.69 +#define Meas_startCondWait \
    5.70 +    TSCountLowHigh endStamp; \
    5.71 +    uint64 numCycles; 
    5.72 +
    5.73 +#define Meas_endCondWait \
    5.74 +    saveTSCLowHigh( endStamp ); \
    5.75 +    numCycles = endStamp.longVal - _VMSMasterEnv->startReqHdlr.longVal; \
    5.76 +    numCycles += _VMSMasterEnv->cyclesTillStartMasterLoop; \
    5.77 +    _VMSMasterEnv->totalPluginCycles += numCycles; \
    5.78 +    _VMSMasterEnv->numPluginAnimations++;
    5.79 +
    5.80 +
    5.81 +#define Meas_startCondSignal \
    5.82 +    TSCountLowHigh endStamp; \
    5.83 +    uint64 numCycles; 
    5.84 +
    5.85 +#define Meas_endCondSignal \
    5.86 +    saveTSCLowHigh( endStamp ); \
    5.87 +    numCycles = endStamp.longVal - _VMSMasterEnv->startReqHdlr.longVal; \
    5.88 +    numCycles += _VMSMasterEnv->cyclesTillStartMasterLoop; \
    5.89 +    _VMSMasterEnv->totalPluginCycles += numCycles; \
    5.90 +    _VMSMasterEnv->numPluginAnimations++;
    5.91 +#else
    5.92 +#define Meas_startMutexLock 
    5.93 +#define Meas_endMutexLock 
    5.94 +#define Meas_startMutexUnlock 
    5.95 +#define Meas_endMutexUnlock
    5.96 +#define Meas_startCondWait
    5.97 +#define Meas_endCondWait 
    5.98 +#define Meas_startCondSignal
    5.99 +#define Meas_endCondSignal 
   5.100 +#endif
   5.101  
   5.102  #endif	/* _VPThread_REQ_H */
   5.103