Пример #1
0
PCMStats* getPCMStats(CoreCounterState& before, CoreCounterState& after) {
  struct PCMStats* stats = new PCMStats();
  stats->l2CacheHitRatio = getL2CacheHitRatio( before, after );
  stats->l3CacheHitRatio = getL3CacheHitRatio( before, after );
  stats->l2Misses = getL2CacheMisses( before, after );
  stats->l3Misses = getL3CacheMisses( before, after );

  return stats;
}
Пример #2
0
 void pcm_print_counter_stats(system_counter_state_t before_sstate, system_counter_state_t after_sstate) {
    std::cout
       << "Instructions per clock: " << getIPC(before_sstate, after_sstate) << std::endl
       << "L2 cache hit ratio: " << getL2CacheHitRatio(before_sstate, after_sstate) << std::endl
       << "L3 cache hit ratio: " << getL3CacheHitRatio(before_sstate, after_sstate) << std::endl
       << "L2 cache misses: " << getL2CacheMisses(before_sstate, after_sstate) << std::endl
       << "L3 cache misses: " << getL3CacheMisses(before_sstate, after_sstate) << std::endl
       << "Cycles lost due to L2 cache misses: " << getCyclesLostDueL2CacheMisses(before_sstate, after_sstate) << std::endl
       << "Cycles lost due to L3 cache misses: " << getCyclesLostDueL3CacheMisses(before_sstate, after_sstate) << std::endl
       << "Bytes read: " << getBytesReadFromMC(before_sstate, after_sstate) << std::endl;
 }