# HG changeset patch # User Merten Sach # Date 1323235298 -3600 # Node ID f81d6df5313ec9f0ce4a608a5d416815cd5965d0 # Parent a6b1b0946c8a58f9d4dd260ce4e9714c51b4d5c9 working version for exe vs task time, has lang-spec meas macros that used to be in VMS.h diff -r a6b1b0946c8a -r f81d6df5313e .hgignore --- a/.hgignore Wed Dec 07 05:17:02 2011 +0100 +++ b/.hgignore Wed Dec 07 06:21:38 2011 +0100 @@ -1,3 +1,4 @@ syntax: glob *.o +*~ diff -r a6b1b0946c8a -r f81d6df5313e VMS_lang_specific_defines.h --- a/VMS_lang_specific_defines.h Wed Dec 07 05:17:02 2011 +0100 +++ b/VMS_lang_specific_defines.h Wed Dec 07 06:21:38 2011 +0100 @@ -40,6 +40,9 @@ saveLowTimeStampCountInto( endStamp ); \ addIntervalToHist( startStamp, endStamp, \ _VMSMasterEnv->measHists[ createHistIdx ] ); +#else +#define Meas_startCreate +#define Meas_endCreate #endif #endif /* VPTHREAD_HELPER_H */ diff -r a6b1b0946c8a -r f81d6df5313e VPThread_PluginFns.c --- a/VPThread_PluginFns.c Wed Dec 07 05:17:02 2011 +0100 +++ b/VPThread_PluginFns.c Wed Dec 07 06:21:38 2011 +0100 @@ -159,9 +159,7 @@ { VPThdSemReq *semReq; VirtProcr *newPr; - //========================= MEASUREMENT STUFF ====================== - Meas_startCreate - //================================================================== + Meas_startCreate semReq = VMS__take_sem_reqst_from( req ); diff -r a6b1b0946c8a -r f81d6df5313e VPThread_Request_Handlers.c --- a/VPThread_Request_Handlers.c Wed Dec 07 05:17:02 2011 +0100 +++ b/VPThread_Request_Handlers.c Wed Dec 07 06:21:38 2011 +0100 @@ -15,6 +15,8 @@ #include "VPThread.h" #include "VMS/vmalloc.h" +#include "VPThread_Request_Handlers.h" + //=============================== Mutexes ================================= @@ -59,7 +61,7 @@ { mutex->holderOfLock = semReq->requestingPr; - //re-animate requester, now that it has the lock + //re-animate requester, now that it has the lock (puts in readyQ) resume_procr( semReq->requestingPr, semEnv ); } else //queue up requester to wait for release of lock diff -r a6b1b0946c8a -r f81d6df5313e VPThread_Request_Handlers.h --- a/VPThread_Request_Handlers.h Wed Dec 07 05:17:02 2011 +0100 +++ b/VPThread_Request_Handlers.h Wed Dec 07 06:21:38 2011 +0100 @@ -52,6 +52,100 @@ handleTransEnd( VPThdSemReq *semReq, VirtProcr *requestingPr, VPThdSemEnv *semEnv); +#ifdef MEAS__TIME_PLUGIN +#define Meas_startMutexLock \ + int32 startStamp, endStamp; \ + saveLowTimeStampCountInto( startStamp ); \ + +#define Meas_endMutexLock \ + saveLowTimeStampCountInto( endStamp ); \ + addIntervalToHist( startStamp, endStamp, \ + _VMSMasterEnv->measHists[ mutexLockHistIdx ] ); + +#define Meas_startMutexUnlock \ + int32 startStamp, endStamp; \ + saveLowTimeStampCountInto( startStamp ); \ + +#define Meas_endMutexUnlock \ + saveLowTimeStampCountInto( endStamp ); \ + addIntervalToHist( startStamp, endStamp, \ + _VMSMasterEnv->measHists[ mutexUnlockHistIdx ] ); + +#define Meas_startCondWait \ + int32 startStamp, endStamp; \ + saveLowTimeStampCountInto( startStamp ); \ + +#define Meas_endCondWait \ + saveLowTimeStampCountInto( endStamp ); \ + addIntervalToHist( startStamp, endStamp, \ + _VMSMasterEnv->measHists[ condWaitHistIdx ] ); + +#define Meas_startCondSignal \ + int32 startStamp, endStamp; \ + saveLowTimeStampCountInto( startStamp ); \ + +#define Meas_endCondSignal \ + saveLowTimeStampCountInto( endStamp ); \ + addIntervalToHist( startStamp, endStamp, \ + _VMSMasterEnv->measHists[ condSignalHistIdx ] ); + +#elif defined MEAS__TIME_2011_SYS +#define Meas_startMutexLock \ + TSCountLowHigh endStamp; \ + uint64 numCycles; + +#define Meas_endMutexLock \ + saveTSCLowHigh( endStamp ); \ + numCycles = endStamp.longVal - _VMSMasterEnv->startReqHdlr.longVal; \ + numCycles += _VMSMasterEnv->cyclesTillStartMasterLoop; \ + _VMSMasterEnv->totalPluginCycles += numCycles; \ + _VMSMasterEnv->numPluginAnimations++; + + +#define Meas_startMutexUnlock \ + TSCountLowHigh endStamp; \ + uint64 numCycles; + +#define Meas_endMutexUnlock \ + saveTSCLowHigh( endStamp ); \ + numCycles = endStamp.longVal - _VMSMasterEnv->startReqHdlr.longVal; \ + numCycles += _VMSMasterEnv->cyclesTillStartMasterLoop; \ + _VMSMasterEnv->totalPluginCycles += numCycles; \ + _VMSMasterEnv->numPluginAnimations++; + + +#define Meas_startCondWait \ + TSCountLowHigh endStamp; \ + uint64 numCycles; + +#define Meas_endCondWait \ + saveTSCLowHigh( endStamp ); \ + numCycles = endStamp.longVal - _VMSMasterEnv->startReqHdlr.longVal; \ + numCycles += _VMSMasterEnv->cyclesTillStartMasterLoop; \ + _VMSMasterEnv->totalPluginCycles += numCycles; \ + _VMSMasterEnv->numPluginAnimations++; + + +#define Meas_startCondSignal \ + TSCountLowHigh endStamp; \ + uint64 numCycles; + +#define Meas_endCondSignal \ + saveTSCLowHigh( endStamp ); \ + numCycles = endStamp.longVal - _VMSMasterEnv->startReqHdlr.longVal; \ + numCycles += _VMSMasterEnv->cyclesTillStartMasterLoop; \ + _VMSMasterEnv->totalPluginCycles += numCycles; \ + _VMSMasterEnv->numPluginAnimations++; +#else +#define Meas_startMutexLock +#define Meas_endMutexLock +#define Meas_startMutexUnlock +#define Meas_endMutexUnlock +#define Meas_startCondWait +#define Meas_endCondWait +#define Meas_startCondSignal +#define Meas_endCondSignal +#endif #endif /* _VPThread_REQ_H */