Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > SSR_impls > SSR__MC_shared_impl
changeset 52:8035f05442c0 perf_counters
fix uninitialised semantic Data bug
| author | Nina Engelhardt <nengel@mailbox.tu-berlin.de> |
|---|---|
| date | Tue, 31 Jan 2012 18:30:40 +0100 |
| parents | 323418163771 |
| children | 9d0668e6453f |
| files | SSR_Counter_Recording.c SSR_Counter_Recording.h SSR_PluginFns.c |
| diffstat | 3 files changed, 64 insertions(+), 26 deletions(-) [+] |
line diff
1.1 --- a/SSR_Counter_Recording.c Fri Jan 13 18:34:37 2012 +0100 1.2 +++ b/SSR_Counter_Recording.c Tue Jan 31 18:30:40 2012 +0100 1.3 @@ -9,13 +9,21 @@ 1.4 1.5 void SSR__counter_handler(int evt_type, VirtProcr* pr, uint64 cycles, uint64 instrs) 1.6 { 1.7 - 1.8 + if(!pr) 1.9 + return; 1.10 + 1.11 + //FIXME: find more reliable way to separate master and slave VPs 1.12 + if (pr->procrID < 2) //filters master VPs 1.13 + return; 1.14 + if (pr->numTimesScheduled < 1) //filters shutdown VP 1.15 + return; 1.16 + 1.17 SSRSemEnv *semanticEnv = _VMSMasterEnv->semanticEnv; 1.18 1.19 CounterEvent e; 1.20 e.event_type = evt_type; 1.21 e.coreID = pr->coreAnimatedBy; 1.22 - e.slotID = pr->schedSlot; 1.23 + e.slot = pr->schedSlot; 1.24 e.cycles = cycles; 1.25 e.instrs = instrs; 1.26 e.vp = pr->procrID; 1.27 @@ -30,6 +38,34 @@ 1.28 1.29 void print_counter_events_to_file(void* _e){ 1.30 CounterEvent* e = (CounterEvent*) _e; 1.31 - 1.32 - fprintf(counterfile, "event, %d, %d, %d, %llu, %llu\n",e->event_type,e->vp,e->task,e->cycles,e->instrs); 1.33 + fprintf(counterfile, "event, "); 1.34 + switch(e->event_type){ 1.35 + case MasterLoop_beforeReqHdlr: 1.36 + fprintf(counterfile, "MasterLoop_beforeReqHdlr"); 1.37 + break; 1.38 + case MasterLoop_afterReqHdlr: 1.39 + fprintf(counterfile, "MasterLoop_afterReqHdlr"); 1.40 + break; 1.41 + case MasterLoop_beforeAssign: 1.42 + fprintf(counterfile, "MasterLoop_beforeAssign"); 1.43 + break; 1.44 + case MasterLoop_afterAssign: 1.45 + fprintf(counterfile, "MasterLoop_afterAssign"); 1.46 + break; 1.47 + case CoreLoop_afterWork: 1.48 + fprintf(counterfile, "CoreLoop_afterWork"); 1.49 + break; 1.50 + case CoreLoop_beforeWork: 1.51 + fprintf(counterfile, "CoreLoop_beforeWork"); 1.52 + break; 1.53 + case Procr_suspend: 1.54 + fprintf(counterfile, "Procr_suspend"); 1.55 + break; 1.56 +// case MasterLoop_beforeNextAssign: 1.57 +// fprintf(counterfile, "MasterLoop_beforeNextAssign"); 1.58 +// break; 1.59 + default: 1.60 + fprintf(counterfile, "unknown event"); 1.61 + } 1.62 + fprintf(counterfile,", %d, %d, %llu, %llu\n",e->vp,e->task,e->cycles,e->instrs); 1.63 } 1.64 \ No newline at end of file
2.1 --- a/SSR_Counter_Recording.h Fri Jan 13 18:34:37 2012 +0100 2.2 +++ b/SSR_Counter_Recording.h Tue Jan 31 18:30:40 2012 +0100 2.3 @@ -13,7 +13,7 @@ 2.4 typedef struct { 2.5 int event_type; 2.6 int coreID; 2.7 - int slotID; 2.8 + SchedSlot* slot; 2.9 int vp; 2.10 int task; 2.11 uint64 cycles;
3.1 --- a/SSR_PluginFns.c Fri Jan 13 18:34:37 2012 +0100 3.2 +++ b/SSR_PluginFns.c Tue Jan 31 18:30:40 2012 +0100 3.3 @@ -44,24 +44,23 @@ 3.4 3.5 schedPr = readPrivQ( semEnv->readyVPQs[coreNum] ); 3.6 //Note, using a non-blocking queue -- it returns NULL if queue empty 3.7 + #ifdef OBSERVE_UCC 3.8 if (schedPr) { 3.9 - schedPr->numTimesScheduled++; 3.10 - 3.11 -#ifdef OBSERVE_UCC 3.12 - Unit prev_in_slot = semEnv->last_in_slot[coreNum * NUM_SCHED_SLOTS + slotNum]; 3.13 - if(prev_in_slot.vp != 0){ 3.14 - Dependency newd; 3.15 - newd.from_vp = prev_in_slot.vp; 3.16 - newd.from_task = prev_in_slot.task; 3.17 - newd.to_vp = schedPr->procrID; 3.18 - newd.to_task = schedPr->numTimesScheduled; 3.19 - addToListOfArrays(Dependency,newd,semEnv->hwArcs); 3.20 + //schedPr->numTimesScheduled++; 3.21 + Unit prev_in_slot = semEnv->last_in_slot[coreNum * NUM_SCHED_SLOTS + slotNum]; 3.22 + if(prev_in_slot.vp != 0){ 3.23 + Dependency newd; 3.24 + newd.from_vp = prev_in_slot.vp; 3.25 + newd.from_task = prev_in_slot.task; 3.26 + newd.to_vp = schedPr->procrID; 3.27 + newd.to_task = schedPr->numTimesScheduled; 3.28 + addToListOfArrays(Dependency,newd,semEnv->hwArcs); 3.29 + } 3.30 + prev_in_slot.vp = schedPr->procrID; 3.31 + prev_in_slot.task = schedPr->numTimesScheduled; 3.32 + semEnv->last_in_slot[coreNum * NUM_SCHED_SLOTS + slotNum] = prev_in_slot; 3.33 } 3.34 - prev_in_slot.vp = schedPr->procrID; 3.35 - prev_in_slot.task = schedPr->numTimesScheduled; 3.36 - semEnv->last_in_slot[coreNum * NUM_SCHED_SLOTS + slotNum] = prev_in_slot; 3.37 -#endif 3.38 - } 3.39 + #endif 3.40 return( schedPr ); 3.41 } 3.42 3.43 @@ -188,6 +187,8 @@ 3.44 semData->highestTransEntered = -1; 3.45 semData->lastTransEntered = NULL; 3.46 3.47 + newPr->semanticData = semData; 3.48 + 3.49 //=================== Assign new processor to a core ===================== 3.50 #ifdef SEQUENTIAL 3.51 newPr->coreAnimatedBy = 0; 3.52 @@ -231,7 +232,7 @@ 3.53 newd.from_vp = requestingPr->procrID; 3.54 newd.from_task = requestingPr->numTimesScheduled; 3.55 newd.to_vp = newPr->procrID; 3.56 - newd.to_task = 0; 3.57 + newd.to_task = 1; 3.58 //addToListOfArraysDependency(newd,semEnv->commDependenciesList); 3.59 addToListOfArrays(Dependency,newd,semEnv->commDependenciesList); 3.60 #endif 3.61 @@ -256,17 +257,18 @@ 3.62 */ 3.63 #endif 3.64 #ifdef OBSERVE_UCC 3.65 + procr->numTimesScheduled++; //Somewhere here! 3.66 Unit newu; 3.67 newu.vp = procr->procrID; 3.68 - newu.task = procr->numTimesScheduled + 1; 3.69 + newu.task = procr->numTimesScheduled; 3.70 addToListOfArrays(Unit,newu,semEnv->unitList); 3.71 3.72 - if (procr->numTimesScheduled > 0){ 3.73 + if (procr->numTimesScheduled > 1){ 3.74 Dependency newd; 3.75 newd.from_vp = procr->procrID; 3.76 - newd.from_task = procr->numTimesScheduled; 3.77 + newd.from_task = procr->numTimesScheduled - 1; 3.78 newd.to_vp = procr->procrID; 3.79 - newd.to_task = procr->numTimesScheduled + 1; 3.80 + newd.to_task = procr->numTimesScheduled; 3.81 addToListOfArrays(Dependency, newd ,semEnv->ctlDependenciesList); 3.82 } 3.83 #endif
