Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
diff MasterLoop.c @ 38:17d20e5cf924
measures coreloop and masterVP times
| author | Me |
|---|---|
| date | Tue, 07 Sep 2010 18:40:57 -0700 |
| parents | e69579a0e797 |
| children | cf3e9238aeb0 |
line diff
1.1 --- a/MasterLoop.c Wed Sep 01 08:23:39 2010 -0700 1.2 +++ b/MasterLoop.c Tue Sep 07 18:40:57 2010 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright 2010 OpenSourceCodeStewardshipFoundation 1.6 + * Copyright 2010 OpenSourceStewardshipFoundation 1.7 * 1.8 * Licensed under BSD 1.9 */ 1.10 @@ -98,6 +98,14 @@ 1.11 1.12 1.13 masterLoopStartPt: 1.14 + //============================= MEASUREMENT STUFF ======================== 1.15 + #ifdef MEAS__TIME_MASTER 1.16 + //Total Master time includes one coreloop time -- just assume the core 1.17 + // loop time is same for Master as for AppVPs, even though it will be 1.18 + // smaller due to high predictability of the jumps. 1.19 + saveLowTimeStampCountInto( masterPr->startMasterTSCLow ); 1.20 + #endif 1.21 + //======================================================================== 1.22 1.23 masterEnv = _VMSMasterEnv; 1.24 1.25 @@ -156,6 +164,13 @@ 1.26 coreLoopFramePtr = masterPr->coreLoopFramePtr;//need this only 1.27 coreLoopStackPtr = masterPr->coreLoopStackPtr;//shouldn't need -- safety 1.28 1.29 + #ifdef MEAS__TIME_MASTER 1.30 + saveLowTimeStampCountInto( masterPr->endMasterTSCLow ); 1.31 + int diff = masterPr->endMasterTSCLow - masterPr->startMasterTSCLow; 1.32 + if( diff > 1000000 ) diff = 0; 1.33 + addToHist( diff, masterEnv->measMasterHist ); 1.34 + #endif 1.35 + 1.36 asm volatile("movl %0, %%eax; \ 1.37 movl %%esp, (%%eax); \ 1.38 movl %1, %%eax; \ 1.39 @@ -167,7 +182,7 @@ 1.40 movl $0x0, (%%ebx); \ 1.41 jmp %%eax;" \ 1.42 /* outputs */ : "=g" (stackPtrAddr), "=g" (framePtrAddr), \ 1.43 - "=g"(masterLockAddr) \ 1.44 + "=g"(masterLockAddr) \ 1.45 /* inputs */ : "g" (jmpPt), "g"(coreLoopStackPtr), "g"(coreLoopFramePtr)\ 1.46 /* clobber */ : "memory", "%eax", "%ebx", "%ecx", "%edx", "%edi", "%esi" \ 1.47 );//can probably make clobber list empty -- but safe for now
