comparison VMS.c @ 65:13b22ffb8a2f

Nov 14 vers -- Added measurement of Plugin, malloc, & master lock, + vutilities
author Me
date Sun, 14 Nov 2010 11:17:52 -0800
parents 5cb919ac890f
children bf08108405cc 9c3107044f86
comparison
equal deleted inserted replaced
32:1a2dee92f2df 33:b29c21226979
98 98
99 //Very first thing put into the master env is the free-list, seeded 99 //Very first thing put into the master env is the free-list, seeded
100 // with a massive initial chunk of memory. 100 // with a massive initial chunk of memory.
101 //After this, all other mallocs are VMS__malloc. 101 //After this, all other mallocs are VMS__malloc.
102 _VMSMasterEnv->freeListHead = VMS_ext__create_free_list(); 102 _VMSMasterEnv->freeListHead = VMS_ext__create_free_list();
103
104
105 //============================= MEASUREMENT STUFF ========================
106 #ifdef MEAS__TIME_MALLOC
107 _VMSMasterEnv->mallocTimeHist = makeFixedBinHistExt( 100, 50, 10,
108 "malloc time hist");
109 _VMSMasterEnv->freeTimeHist = makeFixedBinHistExt( 100, 50, 10,
110 "free time hist");
111 #endif
112 //========================================================================
103 113
104 //===================== Only VMS__malloc after this ==================== 114 //===================== Only VMS__malloc after this ====================
105 masterEnv = _VMSMasterEnv; 115 masterEnv = _VMSMasterEnv;
106 116
107 //Make a readyToAnimateQ for each core loop 117 //Make a readyToAnimateQ for each core loop
145 struct timeval timeStamp; 155 struct timeval timeStamp;
146 gettimeofday( &(timeStamp), NULL); 156 gettimeofday( &(timeStamp), NULL);
147 _VMSMasterEnv->createPtInSecs = 157 _VMSMasterEnv->createPtInSecs =
148 timeStamp.tv_sec +(timeStamp.tv_usec/1000000.0); 158 timeStamp.tv_sec +(timeStamp.tv_usec/1000000.0);
149 #endif 159 #endif
160 #ifdef MEAS__TIME_PLUGIN
161 _VMSMasterEnv->pluginLowTimeHist = makeFixedBinHist( 50, 0, 2,
162 "plugin low time hist");
163 _VMSMasterEnv->pluginHighTimeHist = makeFixedBinHist( 100, 0, 200,
164 "plugin high time hist");
165 #endif
166 #ifdef MEAS__TIME_MASTER_LOCK
167 _VMSMasterEnv->masterLockLowTimeHist = makeFixedBinHist( 50, 0, 2,
168 "master lock low time hist");
169 _VMSMasterEnv->masterLockHighTimeHist = makeFixedBinHist( 100, 0, 200,
170 "master lock high time hist");
171 #endif
150 //======================================================================== 172 //========================================================================
151 173
152 } 174 }
153 175
154 SchedSlot ** 176 SchedSlot **
598 int32 nameLen; 620 int32 nameLen;
599 621
600 semReq = req->semReqData; 622 semReq = req->semReqData;
601 623
602 newProbe = VMS__malloc( sizeof(IntervalProbe) ); 624 newProbe = VMS__malloc( sizeof(IntervalProbe) );
603 nameLen = strlen( semReq->nameStr ); 625 newProbe->nameStr = VMS__strDup( semReq->nameStr );
604 newProbe->nameStr = VMS__malloc( nameLen );
605 memcpy( newProbe->nameStr, semReq->nameStr, nameLen );
606 newProbe->hist = NULL; 626 newProbe->hist = NULL;
607 newProbe->schedChoiceWasRecorded = FALSE; 627 newProbe->schedChoiceWasRecorded = FALSE;
608 628
609 //This runs in masterVP, so no race-condition worries 629 //This runs in masterVP, so no race-condition worries
610 newProbe->probeID = 630 newProbe->probeID =
742 VMSQueueStruc **readyToAnimateQs; 762 VMSQueueStruc **readyToAnimateQs;
743 int coreIdx; 763 int coreIdx;
744 VirtProcr **masterVPs; 764 VirtProcr **masterVPs;
745 SchedSlot ***allSchedSlots; //ptr to array of ptrs 765 SchedSlot ***allSchedSlots; //ptr to array of ptrs
746 766
767 //Before getting rid of everything, print out any measurements made
768 #ifdef MEAS__TIME_PLUGIN
769 printHist( _VMSMasterEnv->pluginLowTimeHist );
770 printHist( _VMSMasterEnv->pluginHighTimeHist );
771 #endif
772 #ifdef MEAS__TIME_MALLOC
773 printHist( _VMSMasterEnv->mallocTimeHist );
774 printHist( _VMSMasterEnv->freeTimeHist );
775 freeHistExt( _VMSMasterEnv->mallocTimeHist );
776 freeHistExt( _VMSMasterEnv->freeTimeHist );
777 #endif
778 #ifdef MEAS__TIME_MASTER_LOCK
779 printHist( _VMSMasterEnv->masterLockLowTimeHist );
780 printHist( _VMSMasterEnv->masterLockHighTimeHist );
781 #endif
782 #ifdef MEAS__TIME_MASTER
783 printHist( _VMSMasterEnv->pluginTimeHist );
784 for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ )
785 {
786 freeVMSQ( readyToAnimateQs[ coreIdx ] );
787 //master VPs were created external to VMS, so use external free
788 VMS__dissipate_procr( masterVPs[ coreIdx ] );
789
790 freeSchedSlots( allSchedSlots[ coreIdx ] );
791 }
792 #endif
793 #ifdef MEAS__TIME_STAMP_SUSP
794 printHist( _VMSMasterEnv->pluginTimeHist );
795 for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ )
796 {
797 freeVMSQ( readyToAnimateQs[ coreIdx ] );
798 //master VPs were created external to VMS, so use external free
799 VMS__dissipate_procr( masterVPs[ coreIdx ] );
800
801 freeSchedSlots( allSchedSlots[ coreIdx ] );
802 }
803 #endif
804
747 //All the environment data has been allocated with VMS__malloc, so just 805 //All the environment data has been allocated with VMS__malloc, so just
748 // free its internal big-chunk and all inside it disappear. 806 // free its internal big-chunk and all inside it disappear.
749 /* 807 /*
750 readyToAnimateQs = _VMSMasterEnv->readyToAnimateQs; 808 readyToAnimateQs = _VMSMasterEnv->readyToAnimateQs;
751 masterVPs = _VMSMasterEnv->masterVPs; 809 masterVPs = _VMSMasterEnv->masterVPs;