Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
changeset 68:9c3107044f86 Dec27_2010_about_to_add_sched_record
Added measurement hists macros
| author | Me |
|---|---|
| date | Sat, 20 Nov 2010 08:19:05 +0100 |
| parents | 2377967a2732 |
| children | 11bfe9d136ed bcd5c73576f6 a49f02980151 |
| files | MasterLoop.c VMS.c VMS.h vmalloc.c |
| diffstat | 4 files changed, 113 insertions(+), 18 deletions(-) [+] |
line diff
1.1 --- a/MasterLoop.c Tue Nov 16 16:00:32 2010 +0100 1.2 +++ b/MasterLoop.c Sat Nov 20 08:19:05 2010 +0100 1.3 @@ -108,8 +108,8 @@ 1.4 //============================= MEASUREMENT STUFF ======================== 1.5 #ifdef MEAS__TIME_MASTER 1.6 //Total Master time includes one coreloop time -- just assume the core 1.7 - // loop time is same for Master as for AppVPs, even though it will be 1.8 - // smaller due to high predictability of the fixed jmp. 1.9 + // loop time is same for Master as for AppVPs, even though it may be 1.10 + // smaller due to higher predictability of the fixed jmp. 1.11 saveLowTimeStampCountInto( masterPr->startMasterTSCLow ); 1.12 #endif 1.13 //======================================================================== 1.14 @@ -139,7 +139,22 @@ 1.15 currSlot->needsProcrAssigned = TRUE; 1.16 1.17 //process requests from slave to master 1.18 + //====================== MEASUREMENT STUFF =================== 1.19 + #ifdef MEAS__TIME_PLUGIN 1.20 + int32 startStamp1, endStamp1; 1.21 + saveLowTimeStampCountInto( startStamp1 ); 1.22 + #endif 1.23 + //============================================================ 1.24 (*requestHandler)( currSlot->procrAssignedToSlot, semanticEnv ); 1.25 + //====================== MEASUREMENT STUFF =================== 1.26 + #ifdef MEAS__TIME_PLUGIN 1.27 + saveLowTimeStampCountInto( endStamp1 ); 1.28 + addIntervalToHist( startStamp1, endStamp1, 1.29 + _VMSMasterEnv->reqHdlrLowTimeHist ); 1.30 + addIntervalToHist( startStamp1, endStamp1, 1.31 + _VMSMasterEnv->reqHdlrHighTimeHist ); 1.32 + #endif 1.33 + //============================================================ 1.34 } 1.35 if( currSlot->needsProcrAssigned ) 1.36 { //give slot a new virt procr
2.1 --- a/VMS.c Tue Nov 16 16:00:32 2010 +0100 2.2 +++ b/VMS.c Sat Nov 20 08:19:05 2010 +0100 2.3 @@ -104,11 +104,17 @@ 2.4 2.5 //============================= MEASUREMENT STUFF ======================== 2.6 #ifdef MEAS__TIME_MALLOC 2.7 - _VMSMasterEnv->mallocTimeHist = makeFixedBinHistExt( 100, 50, 10, 2.8 + _VMSMasterEnv->mallocTimeHist = makeFixedBinHistExt( 50, 0, 100, 2.9 "malloc time hist"); 2.10 - _VMSMasterEnv->freeTimeHist = makeFixedBinHistExt( 100, 50, 10, 2.11 + _VMSMasterEnv->freeTimeHist = makeFixedBinHistExt( 50, 0, 100, 2.12 "free time hist"); 2.13 #endif 2.14 + #ifdef MEAS__TIME_PLUGIN 2.15 + _VMSMasterEnv->reqHdlrLowTimeHist = makeFixedBinHistExt( 50, 0, 10, 2.16 + "plugin low time hist"); 2.17 + _VMSMasterEnv->reqHdlrHighTimeHist = makeFixedBinHistExt( 50, 0, 100, 2.18 + "plugin high time hist"); 2.19 + #endif 2.20 //======================================================================== 2.21 2.22 //===================== Only VMS__malloc after this ==================== 2.23 @@ -157,18 +163,14 @@ 2.24 _VMSMasterEnv->createPtInSecs = 2.25 timeStamp.tv_sec +(timeStamp.tv_usec/1000000.0); 2.26 #endif 2.27 - #ifdef MEAS__TIME_PLUGIN 2.28 - _VMSMasterEnv->pluginLowTimeHist = makeFixedBinHist( 50, 0, 2, 2.29 - "plugin low time hist"); 2.30 - _VMSMasterEnv->pluginHighTimeHist = makeFixedBinHist( 100, 0, 200, 2.31 - "plugin high time hist"); 2.32 - #endif 2.33 #ifdef MEAS__TIME_MASTER_LOCK 2.34 _VMSMasterEnv->masterLockLowTimeHist = makeFixedBinHist( 50, 0, 2, 2.35 "master lock low time hist"); 2.36 - _VMSMasterEnv->masterLockHighTimeHist = makeFixedBinHist( 100, 0, 200, 2.37 + _VMSMasterEnv->masterLockHighTimeHist = makeFixedBinHist( 50, 0, 100, 2.38 "master lock high time hist"); 2.39 #endif 2.40 + 2.41 + MakeTheMeasHists 2.42 //======================================================================== 2.43 2.44 } 2.45 @@ -765,9 +767,13 @@ 2.46 SchedSlot ***allSchedSlots; //ptr to array of ptrs 2.47 2.48 //Before getting rid of everything, print out any measurements made 2.49 + forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, &printHist ); 2.50 + //forAllInDynArrayDo( _VMSMasterEnv->measHistsInfo, &freeHistExt ); 2.51 #ifdef MEAS__TIME_PLUGIN 2.52 - printHist( _VMSMasterEnv->pluginLowTimeHist ); 2.53 - printHist( _VMSMasterEnv->pluginHighTimeHist ); 2.54 + printHist( _VMSMasterEnv->reqHdlrLowTimeHist ); 2.55 + printHist( _VMSMasterEnv->reqHdlrHighTimeHist ); 2.56 + freeHistExt( _VMSMasterEnv->reqHdlrLowTimeHist ); 2.57 + freeHistExt( _VMSMasterEnv->reqHdlrHighTimeHist ); 2.58 #endif 2.59 #ifdef MEAS__TIME_MALLOC 2.60 printHist( _VMSMasterEnv->mallocTimeHist );
3.1 --- a/VMS.h Tue Nov 16 16:00:32 2010 +0100 3.2 +++ b/VMS.h Sat Nov 20 08:19:05 2010 +0100 3.3 @@ -37,14 +37,14 @@ 3.4 3.5 //These defines turn types of bug messages on and off 3.6 // be sure debug messages are un-commented (next block of defines) 3.7 +#define dbgAppFlow TRUE /* Top level flow of application code -- general*/ 3.8 #define dbgProbes FALSE /* for issues inside probes themselves*/ 3.9 -#define dbgAppFlow FALSE /* Top level flow of application code -- general*/ 3.10 #define dbgB2BMaster FALSE /* in coreloop, back to back master VPs*/ 3.11 #define dbgRqstHdlr FALSE /* in request handler code*/ 3.12 3.13 //Comment or un- the substitute half to turn on/off types of debug message 3.14 #define DEBUG( bool, msg) \ 3.15 -// if( bool){ printf(msg); fflush(stdin);} 3.16 +// if( bool){ printf(msg); fflush(stdin);} 3.17 #define DEBUG1( bool, msg, param) \ 3.18 // if(bool){printf(msg, param); fflush(stdin);} 3.19 #define DEBUG2( bool, msg, p1, p2) \ 3.20 @@ -65,7 +65,7 @@ 3.21 //#define MEAS__TIME_MASTER 3.22 #define MEAS__TIME_PLUGIN 3.23 #define MEAS__TIME_MALLOC 3.24 -#define MEAS__TIME_MASTER_LOCK 3.25 +//#define MEAS__TIME_MASTER_LOCK 3.26 #define MEAS__NUM_TIMES_TO_RUN 100000 3.27 3.28 //For code that calculates normalization-offset between TSC counts of 3.29 @@ -242,9 +242,11 @@ 3.30 HashTable *probeNameHashTbl; 3.31 int32 masterCreateProbeID; 3.32 float64 createPtInSecs; 3.33 + Histogram **measHists; 3.34 + PrivDynArrayInfo *measHistsInfo; 3.35 #ifdef MEAS__TIME_PLUGIN 3.36 - Histogram *pluginLowTimeHist; 3.37 - Histogram *pluginHighTimeHist; 3.38 + Histogram *reqHdlrLowTimeHist; 3.39 + Histogram *reqHdlrHighTimeHist; 3.40 #endif 3.41 #ifdef MEAS__TIME_MALLOC 3.42 Histogram *mallocTimeHist; 3.43 @@ -390,6 +392,77 @@ 3.44 /* inputs */ : \ 3.45 /* clobber */ : "%eax", "%edx" \ 3.46 ); 3.47 + 3.48 +//==================== 3.49 +#define makeAMeasHist( idx, name, numBins, startVal, binWidth ) \ 3.50 + makeHighestDynArrayIndexBeAtLeast( _VMSMasterEnv->measHistsInfo, idx ); \ 3.51 + _VMSMasterEnv->measHists[idx] = \ 3.52 + makeFixedBinHist( numBins, startVal, binWidth, name ); 3.53 + 3.54 + 3.55 +#define MEAS__SUB_CREATE /*turn on/off subtraction of create from plugin*/ 3.56 +#define createHistIdx 1 3.57 +#define mutexLockHistIdx 2 3.58 +#define mutexUnlockHistIdx 3 3.59 +#define condWaitHistIdx 4 3.60 +#define condSignalHistIdx 5 3.61 + 3.62 + 3.63 +#define MakeTheMeasHists \ 3.64 + _VMSMasterEnv->measHistsInfo = \ 3.65 + makePrivDynArrayOfSize( &(_VMSMasterEnv->measHists), 200);\ 3.66 + makeAMeasHist( createHistIdx, "Create", 50, 0, 200 ) \ 3.67 + makeAMeasHist( mutexLockHistIdx, "mutex lock", 50, 0, 100 ) \ 3.68 + makeAMeasHist( mutexUnlockHistIdx, "mutex unlock", 50, 0, 100 ) \ 3.69 + makeAMeasHist( condWaitHistIdx, "cond wait", 50, 0, 100 ) \ 3.70 + makeAMeasHist( condSignalHistIdx, "cond signal", 50, 0, 100 ) 3.71 + 3.72 +#define Meas_startCreate \ 3.73 + int32 startStamp, endStamp; \ 3.74 + saveLowTimeStampCountInto( startStamp ); \ 3.75 + 3.76 +#define Meas_endCreate \ 3.77 + saveLowTimeStampCountInto( endStamp ); \ 3.78 + addIntervalToHist( startStamp, endStamp, \ 3.79 + _VMSMasterEnv->measHists[ createHistIdx ] ); 3.80 + 3.81 +#define Meas_startMutexLock \ 3.82 + int32 startStamp, endStamp; \ 3.83 + saveLowTimeStampCountInto( startStamp ); \ 3.84 + 3.85 +#define Meas_endMutexLock \ 3.86 + saveLowTimeStampCountInto( endStamp ); \ 3.87 + addIntervalToHist( startStamp, endStamp, \ 3.88 + _VMSMasterEnv->measHists[ mutexLockHistIdx ] ); 3.89 + 3.90 +#define Meas_startMutexUnlock \ 3.91 + int32 startStamp, endStamp; \ 3.92 + saveLowTimeStampCountInto( startStamp ); \ 3.93 + 3.94 +#define Meas_endMutexUnlock \ 3.95 + saveLowTimeStampCountInto( endStamp ); \ 3.96 + addIntervalToHist( startStamp, endStamp, \ 3.97 + _VMSMasterEnv->measHists[ mutexUnlockHistIdx ] ); 3.98 + 3.99 +#define Meas_startCondWait \ 3.100 + int32 startStamp, endStamp; \ 3.101 + saveLowTimeStampCountInto( startStamp ); \ 3.102 + 3.103 +#define Meas_endCondWait \ 3.104 + saveLowTimeStampCountInto( endStamp ); \ 3.105 + addIntervalToHist( startStamp, endStamp, \ 3.106 + _VMSMasterEnv->measHists[ condWaitHistIdx ] ); 3.107 + 3.108 +#define Meas_startCondSignal \ 3.109 + int32 startStamp, endStamp; \ 3.110 + saveLowTimeStampCountInto( startStamp ); \ 3.111 + 3.112 +#define Meas_endCondSignal \ 3.113 + saveLowTimeStampCountInto( endStamp ); \ 3.114 + addIntervalToHist( startStamp, endStamp, \ 3.115 + _VMSMasterEnv->measHists[ condSignalHistIdx ] ); 3.116 + 3.117 + 3.118 //===== 3.119 3.120 #include "SwitchAnimators.h"
4.1 --- a/vmalloc.c Tue Nov 16 16:00:32 2010 +0100 4.2 +++ b/vmalloc.c Sat Nov 20 08:19:05 2010 +0100 4.3 @@ -11,6 +11,7 @@ 4.4 #include <stdlib.h> 4.5 4.6 #include "VMS.h" 4.7 +#include "Histogram/Histogram.h" 4.8 4.9 /*Helper function 4.10 *Insert a newly generated free chunk into the first spot on the free list.
