diff --git a/src/pcm-pcie.cpp b/src/pcm-pcie.cpp index 335c24d1..35914dcd 100644 --- a/src/pcm-pcie.cpp +++ b/src/pcm-pcie.cpp @@ -222,18 +222,22 @@ int mainThrows(int argc, char * argv[]) // for non-CSV mode delay < 1.0 does not make a lot of practical sense: // hard to read from the screen, or // in case delay is not provided in command line => set default - if ( ((delay<1.0) && (delay>0.0)) || (delay<=0.0) ) delay = PCM_DELAY_DEFAULT; + if ( ((delay < 1.0) && (delay > 0.0)) || (delay <= 0.0) ) { + cerr << "For non-CSV mode delay < 1.0s does not make a lot of practical sense. Default delay 1s is used. Consider to use CSV mode for lower delay values\n"; + delay = PCM_DELAY_DEFAULT; + } } cerr << "Update every " << delay << " seconds\n"; + // Delay in miliseconds unique_ptr platform(IPlatform::getPlatform(m, csv, print_bandwidth, - print_additional_info, (uint)delay)); // FIXME: do we support only integer delay? ; lgtm [cpp/fixme-comment] + print_additional_info, (uint)(delay * 1000))); if (!platform) { print_cpu_details(); - cerr << "Jaketown, Ivytown, Haswell, Broadwell-DE Server CPU is required for this tool! Program aborted\n"; + cerr << "Jaketown, Ivytown, Haswell, Broadwell-DE, Skylake, Icelake, Snowridge and Sapphirerapids Server CPU is required for this tool! Program aborted\n"; exit(EXIT_FAILURE); } diff --git a/src/pcm-pcie.h b/src/pcm-pcie.h index 1fb061e7..533ffa66 100644 --- a/src/pcm-pcie.h +++ b/src/pcm-pcie.h @@ -131,8 +131,8 @@ class LegacyPlatform: public IPlatform int eventsCount = 0; for (auto &group : eventGroups) eventsCount += (int)group.size(); - m_delay = uint32(delay * 1000 / (eventGroups.size()) / NUM_SAMPLES); - if (m_delay * eventsCount * NUM_SAMPLES < delay * 1000) ++m_delay; + // Delay for each multiplexing group. Counters will be scaled. + m_delay = uint32(delay / eventGroups.size() / NUM_SAMPLES); eventSample.resize(m_socketCount); for (auto &e: eventSample) @@ -182,11 +182,12 @@ void LegacyPlatform::getEventGroup(eventGroup_t &eventGroup) m_pcm->programPCIeEventGroup(eventGroup); uint offset = eventGroupOffset(eventGroup); - for (auto &run : eventCount) { - for(uint skt =0; skt < m_socketCount; ++skt) + for (int run = before; run < total; run++) { + for (uint skt = 0; skt < m_socketCount; ++skt) for (uint ctr = 0; ctr < eventGroup.size(); ++ctr) - run[skt][ctr + offset] = m_pcm->getPCIeCounterData(skt, ctr); - MySleepMs(m_delay); + eventCount[run][skt][ctr + offset] = m_pcm->getPCIeCounterData(skt, ctr); + if (run == before) + MySleepMs(m_delay); } for(uint skt = 0; skt < m_socketCount; ++skt)