Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
diff VMS.h @ 109:659299627e70
counters done
| author | Nina Engelhardt |
|---|---|
| date | Tue, 02 Aug 2011 17:16:12 +0200 |
| parents | 3bc3b89630c7 |
| children | 724c7a0b687f |
line diff
1.1 --- a/VMS.h Tue Jul 26 15:36:24 2011 +0200 1.2 +++ b/VMS.h Tue Aug 02 17:16:12 2011 +0200 1.3 @@ -45,11 +45,11 @@ 1.4 1.5 //Comment or un- the substitute half to turn on/off types of debug message 1.6 #define DEBUG( bool, msg) \ 1.7 -// if( bool){ printf(msg); fflush(stdin);} 1.8 + if( bool){ printf(msg); fflush(stdin);} 1.9 #define DEBUG1( bool, msg, param) \ 1.10 -// if(bool){printf(msg, param); fflush(stdin);} 1.11 + if(bool){printf(msg, param); fflush(stdin);} 1.12 #define DEBUG2( bool, msg, p1, p2) \ 1.13 -// if(bool) {printf(msg, p1, p2); fflush(stdin);} 1.14 + if(bool) {printf(msg, p1, p2); fflush(stdin);} 1.15 1.16 #define ERROR(msg) printf(msg); 1.17 #define ERROR1(msg, param) printf(msg, param); 1.18 @@ -64,14 +64,14 @@ 1.19 // rollover of low portion into high portion. 1.20 //#define MEAS__TIME_STAMP_SUSP 1.21 //#define MEAS__TIME_MASTER 1.22 -#define MEAS__TIME_PLUGIN 1.23 -#define MEAS__TIME_MALLOC 1.24 +//#define MEAS__TIME_PLUGIN 1.25 +//#define MEAS__TIME_MALLOC 1.26 //#define MEAS__TIME_MASTER_LOCK 1.27 -#define MEAS__NUM_TIMES_TO_RUN 100000 1.28 +//#define MEAS__NUM_TIMES_TO_RUN 100000 1.29 1.30 //For code that calculates normalization-offset between TSC counts of 1.31 // different cores. 1.32 -#define NUM_TSC_ROUND_TRIPS 10 1.33 +//#define NUM_TSC_ROUND_TRIPS 10 1.34 1.35 #define MEAS__PERF_COUNTERS 1.36 1.37 @@ -415,6 +415,24 @@ 1.38 _VMSMasterEnv->measHists[idx] = \ 1.39 makeFixedBinHist( numBins, startVal, binWidth, name ); 1.40 1.41 +#define saveCyclesAndInstrs(core,cycles,instrs) do{ \ 1.42 + int cycles_fd = _VMSMasterEnv->cycles_counter_fd[core]; \ 1.43 + int instrs_fd = _VMSMasterEnv->instrs_counter_fd[core]; \ 1.44 + int nread; \ 1.45 + \ 1.46 + nread = read(cycles_fd,&(cycles),sizeof(cycles)); \ 1.47 + if(nread<0){ \ 1.48 + perror("Error reading cycles counter"); \ 1.49 + cycles = 0; \ 1.50 + } \ 1.51 + \ 1.52 + nread = read(instrs_fd,&(instrs),sizeof(instrs)); \ 1.53 + if(nread<0){ \ 1.54 + perror("Error reading cycles counter"); \ 1.55 + instrs = 0; \ 1.56 + } \ 1.57 +} while (0) 1.58 + 1.59 1.60 #define MEAS__SUB_CREATE /*turn on/off subtraction of create from plugin*/ 1.61
