comparison VMS.h @ 184:50b29548d4f0

handler interface for counters... not working
author Nina Engelhardt <nengel@mailbox.tu-berlin.de>
date Fri, 13 Jan 2012 15:03:32 +0100
parents 7523ee70d66c
children 28cc465f7eb7
comparison
equal deleted inserted replaced
83:a19946d794b5 84:2ff374d48178
128 typedef VirtProcr * (*SlaveScheduler) ( void *, int, int ); //semEnv, coreIdx 128 typedef VirtProcr * (*SlaveScheduler) ( void *, int, int ); //semEnv, coreIdx
129 typedef void (*RequestHandler) ( VirtProcr *, void * ); //prWReqst, semEnv 129 typedef void (*RequestHandler) ( VirtProcr *, void * ); //prWReqst, semEnv
130 typedef void (*VirtProcrFnPtr) ( void *, VirtProcr * ); //initData, animPr 130 typedef void (*VirtProcrFnPtr) ( void *, VirtProcr * ); //initData, animPr
131 typedef void VirtProcrFn ( void *, VirtProcr * ); //initData, animPr 131 typedef void VirtProcrFn ( void *, VirtProcr * ); //initData, animPr
132 typedef void (*ResumePrFnPtr) ( VirtProcr *, void * ); 132 typedef void (*ResumePrFnPtr) ( VirtProcr *, void * );
133 133 typedef void (*CounterHandler) (int,int,int,VirtProcr*,uint64,uint64);
134 134
135 //============= Requests =========== 135 //============= Requests ===========
136 // 136 //
137 137
138 enum VMSReqstType //avoid starting enums at 0, for debug reasons 138 enum VMSReqstType //avoid starting enums at 0, for debug reasons
208 #ifdef MEAS__TIME_MASTER /* in VirtProcr because multiple masterVPs*/ 208 #ifdef MEAS__TIME_MASTER /* in VirtProcr because multiple masterVPs*/
209 unsigned int startMasterTSCLow;USE_GNU 209 unsigned int startMasterTSCLow;USE_GNU
210 unsigned int endMasterTSCLow; 210 unsigned int endMasterTSCLow;
211 #endif 211 #endif
212 #ifdef MEAS__PERF_COUNTERS // 212 #ifdef MEAS__PERF_COUNTERS //
213 CounterRecord** counter_history; 213 //CounterRecord** counter_history;
214 PrivDynArrayInfo* counter_history_array_info; 214 //PrivDynArrayInfo* counter_history_array_info;
215 #endif 215 #endif
216 //======================================== 216 //========================================
217 217
218 float64 createPtInSecs; //have space but don't use on some configs 218 float64 createPtInSecs; //have space but don't use on some configs
219 int numTimesScheduled; //defines units together w/ procrID 219 int numTimesScheduled; //defines units together w/ procrID
274 int cycles_counter_fd[NUM_CORES]; 274 int cycles_counter_fd[NUM_CORES];
275 int instrs_counter_fd[NUM_CORES]; 275 int instrs_counter_fd[NUM_CORES];
276 FILE* counteroutput; 276 FILE* counteroutput;
277 #endif 277 #endif
278 #ifdef MEAS__PERF_COUNTERS // 278 #ifdef MEAS__PERF_COUNTERS //
279 CounterRecord** counter_history; 279 //CounterRecord** counter_history;
280 PrivDynArrayInfo* counter_history_array_info; 280 //PrivDynArrayInfo* counter_history_array_info;
281 CounterHandler counterHandler;
281 #endif 282 #endif
282 } 283 }
283 MasterEnv; 284 MasterEnv;
284 285
285 //========================= Extra Stuff Data Strucs ======================= 286 //========================= Extra Stuff Data Strucs =======================
442 perror("Error reading cycles counter"); \ 443 perror("Error reading cycles counter"); \
443 instrs = 0; \ 444 instrs = 0; \
444 } \ 445 } \
445 } while (0) 446 } while (0)
446 447
448 enum eventType {
449 MasterLoop_beforeReqHdlr = 1,
450 MasterLoop_afterReqHdlr,
451 MasterLoop_beforeAssign,
452 MasterLoop_afterAssign
453 };
454
447 #define getReturnAddressBeforeLibraryCall(vp_ptr, res_ptr) do{ \ 455 #define getReturnAddressBeforeLibraryCall(vp_ptr, res_ptr) do{ \
448 void* frame_ptr0 = vp_ptr->framePtr; \ 456 void* frame_ptr0 = vp_ptr->framePtr; \
449 void* frame_ptr1 = *((void**)frame_ptr0); \ 457 void* frame_ptr1 = *((void**)frame_ptr0); \
450 void* frame_ptr2 = *((void**)frame_ptr1); \ 458 void* frame_ptr2 = *((void**)frame_ptr1); \
451 void* frame_ptr3 = *((void**)frame_ptr2); \ 459 void* frame_ptr3 = *((void**)frame_ptr2); \