1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-10 22:20:45 +01:00

Restoring Perfcounts

This commit is contained in:
Guido Cossu 2017-10-24 13:32:02 +01:00
parent 657779374b
commit 2986aa76f8
2 changed files with 15 additions and 18 deletions

View File

@ -90,10 +90,9 @@ inline uint64_t cyclecount(void){
} }
#elif defined __x86_64__ #elif defined __x86_64__
inline uint64_t cyclecount(void){ inline uint64_t cyclecount(void){
//return __rdtsc(); return __rdtsc();
// unsigned int dummy; // unsigned int dummy;
// return __rdtscp(&dummy); // return __rdtscp(&dummy);
return 0; // <- remove this;
} }
#else #else

View File

@ -57,37 +57,35 @@ void PmuStat::start(void)
pmu_start(); pmu_start();
++count; ++count;
xmemctrs(&mrstart, &mwstart); xmemctrs(&mrstart, &mwstart);
//tstart = __rdtsc(); tstart = __rdtsc();
tstart=0;
#endif #endif
} }
void PmuStat::enter(int t) void PmuStat::enter(int t)
{ {
#ifdef __x86_64__ #ifdef __x86_64__
counters[0][t] = 0;//__rdpmc(0); counters[0][t] = __rdpmc(0);
counters[1][t] = 0;//__rdpmc(1); counters[1][t] = __rdpmc(1);
counters[2][t] = 0;//__rdpmc((1<<30)|0); counters[2][t] = __rdpmc((1<<30)|0);
counters[3][t] = 0;//__rdpmc((1<<30)|1); counters[3][t] = __rdpmc((1<<30)|1);
counters[4][t] = 0;//__rdpmc((1<<30)|2); counters[4][t] = __rdpmc((1<<30)|2);
counters[5][t] = 0;//__rdtsc(); counters[5][t] = __rdtsc();
#endif #endif
} }
void PmuStat::exit(int t) void PmuStat::exit(int t)
{ {
#ifdef __x86_64__ #ifdef __x86_64__
counters[0][t] = 0;//__rdpmc(0) - counters[0][t]; counters[0][t] = __rdpmc(0) - counters[0][t];
counters[1][t] = 0;// __rdpmc(1) - counters[1][t]; counters[1][t] = __rdpmc(1) - counters[1][t];
counters[2][t] = 0;// __rdpmc((1<<30)|0) - counters[2][t]; counters[2][t] = __rdpmc((1<<30)|0) - counters[2][t];
counters[3][t] = 0;// __rdpmc((1<<30)|1) - counters[3][t]; counters[3][t] = __rdpmc((1<<30)|1) - counters[3][t];
counters[4][t] = 0;// __rdpmc((1<<30)|2) - counters[4][t]; counters[4][t] = __rdpmc((1<<30)|2) - counters[4][t];
counters[5][t] = 0;// __rdtsc() - counters[5][t]; counters[5][t] = __rdtsc() - counters[5][t];
#endif #endif
} }
void PmuStat::accum(int nthreads) void PmuStat::accum(int nthreads)
{ {
#ifdef __x86_64__ #ifdef __x86_64__
// tend = __rdtsc(); tend = __rdtsc();
tend =0 ;
xmemctrs(&mrend, &mwend); xmemctrs(&mrend, &mwend);
pmu_stop(); pmu_stop();
for (int t = 0; t < nthreads; ++t) { for (int t = 0; t < nthreads; ++t) {