@@ -63,7 +63,7 @@ extern "C" {
6363 SystemCounterState SysBeforeState, SysAfterState;
6464 std::vector<CoreCounterState> BeforeState, AfterState;
6565 std::vector<SocketCounterState> DummySocketStates;
66- EventSelectRegister regs[4 ];
66+ EventSelectRegister regs[PERF_MAX_COUNTERS ];
6767 PCM::ExtendedCustomCoreEventDescription conf;
6868
6969 int pcm_c_build_core_event (uint8_t idx, const char * argv)
@@ -290,16 +290,12 @@ int main(int argc, char * argv[])
290290 int calibrated = PCM_CALIBRATION_INTERVAL - 2 ; // keeps track is the clock calibration needed
291291 unsigned int numberOfIterations = 0 ; // number of iterations
292292 string program = string (argv[0 ]);
293- EventSelectRegister regs[4 ];
293+ EventSelectRegister regs[PERF_MAX_COUNTERS ];
294294 PCM::ExtendedCustomCoreEventDescription conf;
295295 bool show_partial_core_output = false ;
296296 std::bitset<MAX_CORES> ycores;
297297
298- // Occasionally the memory is not properly nulled because counters appear to
299- // be programmed even without given arguments so making really sure
300- memset ( ®s, 0 , sizeof (regs) );
301-
302- PCM * m = PCM::getInstance ();
298+ PCM * m = PCM::getInstance ();
303299
304300 conf.fixedCfg = NULL ; // default
305301 conf.nGPCounters = m->getMaxCustomCoreEvents ();
0 commit comments