comparison VMS.h @ 109:659299627e70

counters done
author Nina Engelhardt
date Tue, 02 Aug 2011 17:16:12 +0200
parents 3bc3b89630c7
children 724c7a0b687f
comparison
equal deleted inserted replaced
48:66af972fa0a5 49:f39703e744f0
43 #define dbgB2BMaster FALSE /* in coreloop, back to back master VPs*/ 43 #define dbgB2BMaster FALSE /* in coreloop, back to back master VPs*/
44 #define dbgRqstHdlr FALSE /* in request handler code*/ 44 #define dbgRqstHdlr FALSE /* in request handler code*/
45 45
46 //Comment or un- the substitute half to turn on/off types of debug message 46 //Comment or un- the substitute half to turn on/off types of debug message
47 #define DEBUG( bool, msg) \ 47 #define DEBUG( bool, msg) \
48 // if( bool){ printf(msg); fflush(stdin);} 48 if( bool){ printf(msg); fflush(stdin);}
49 #define DEBUG1( bool, msg, param) \ 49 #define DEBUG1( bool, msg, param) \
50 // if(bool){printf(msg, param); fflush(stdin);} 50 if(bool){printf(msg, param); fflush(stdin);}
51 #define DEBUG2( bool, msg, p1, p2) \ 51 #define DEBUG2( bool, msg, p1, p2) \
52 // if(bool) {printf(msg, p1, p2); fflush(stdin);} 52 if(bool) {printf(msg, p1, p2); fflush(stdin);}
53 53
54 #define ERROR(msg) printf(msg); 54 #define ERROR(msg) printf(msg);
55 #define ERROR1(msg, param) printf(msg, param); 55 #define ERROR1(msg, param) printf(msg, param);
56 #define ERROR2(msg, p1, p2) printf(msg, p1, p2); 56 #define ERROR2(msg, p1, p2) printf(msg, p1, p2);
57 57
62 // suspending a processor and just after resuming that processor. It is 62 // suspending a processor and just after resuming that processor. It is
63 // saved into a field added to VirtProcr. Have to sanity-check for 63 // saved into a field added to VirtProcr. Have to sanity-check for
64 // rollover of low portion into high portion. 64 // rollover of low portion into high portion.
65 //#define MEAS__TIME_STAMP_SUSP 65 //#define MEAS__TIME_STAMP_SUSP
66 //#define MEAS__TIME_MASTER 66 //#define MEAS__TIME_MASTER
67 #define MEAS__TIME_PLUGIN 67 //#define MEAS__TIME_PLUGIN
68 #define MEAS__TIME_MALLOC 68 //#define MEAS__TIME_MALLOC
69 //#define MEAS__TIME_MASTER_LOCK 69 //#define MEAS__TIME_MASTER_LOCK
70 #define MEAS__NUM_TIMES_TO_RUN 100000 70 //#define MEAS__NUM_TIMES_TO_RUN 100000
71 71
72 //For code that calculates normalization-offset between TSC counts of 72 //For code that calculates normalization-offset between TSC counts of
73 // different cores. 73 // different cores.
74 #define NUM_TSC_ROUND_TRIPS 10 74 //#define NUM_TSC_ROUND_TRIPS 10
75 75
76 #define MEAS__PERF_COUNTERS 76 #define MEAS__PERF_COUNTERS
77 77
78 //========================= Hardware related Constants ===================== 78 //========================= Hardware related Constants =====================
79 //This value is the number of hardware threads in the shared memory 79 //This value is the number of hardware threads in the shared memory
413 #define makeAMeasHist( idx, name, numBins, startVal, binWidth ) \ 413 #define makeAMeasHist( idx, name, numBins, startVal, binWidth ) \
414 makeHighestDynArrayIndexBeAtLeast( _VMSMasterEnv->measHistsInfo, idx ); \ 414 makeHighestDynArrayIndexBeAtLeast( _VMSMasterEnv->measHistsInfo, idx ); \
415 _VMSMasterEnv->measHists[idx] = \ 415 _VMSMasterEnv->measHists[idx] = \
416 makeFixedBinHist( numBins, startVal, binWidth, name ); 416 makeFixedBinHist( numBins, startVal, binWidth, name );
417 417
418 #define saveCyclesAndInstrs(core,cycles,instrs) do{ \
419 int cycles_fd = _VMSMasterEnv->cycles_counter_fd[core]; \
420 int instrs_fd = _VMSMasterEnv->instrs_counter_fd[core]; \
421 int nread; \
422 \
423 nread = read(cycles_fd,&(cycles),sizeof(cycles)); \
424 if(nread<0){ \
425 perror("Error reading cycles counter"); \
426 cycles = 0; \
427 } \
428 \
429 nread = read(instrs_fd,&(instrs),sizeof(instrs)); \
430 if(nread<0){ \
431 perror("Error reading cycles counter"); \
432 instrs = 0; \
433 } \
434 } while (0)
435
418 436
419 #define MEAS__SUB_CREATE /*turn on/off subtraction of create from plugin*/ 437 #define MEAS__SUB_CREATE /*turn on/off subtraction of create from plugin*/
420 438
421 #ifdef VPTHREAD 439 #ifdef VPTHREAD
422 440