Skip to content

Commit

Permalink
Zero regs array, add warning in case no custom event provided
Browse files Browse the repository at this point in the history
Change-Id: Ifa6730e2a544cab863dd23d1be31e6f0d670dbea
  • Loading branch information
ogbrugge-work authored and opcm committed Oct 20, 2017
1 parent cdef1df commit 2fe6821
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pcm-core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ int main(int argc, char * argv[])
bool show_partial_core_output = false;
std::bitset<MAX_CORES> ycores;

// Occasionally the memory is not properly nulled because counters appear to
// be programmed even without given arguments so making really sure
memset( &regs, 0, sizeof(regs) );

conf.fixedCfg = NULL; // default
conf.nGPCounters = 4;
conf.gpCounterCfg = regs;
Expand Down Expand Up @@ -432,7 +436,10 @@ int main(int argc, char * argv[])
}
continue;
}
} while(argc > 1); // end of command line partsing loop
} while(argc > 1); // end of command line parsing loop

if ( cur_event == 0 )
cerr << "WARNING: you did not provide any custom events, is this intentional?\n";

conf.OffcoreResponseMsrValue[0] = events[0].msr_value;
conf.OffcoreResponseMsrValue[1] = events[1].msr_value;
Expand Down

0 comments on commit 2fe6821

Please sign in to comment.