Skip to content

Commit

Permalink
Merge tag '2024-11-17' into push-2024-11-17
Browse files Browse the repository at this point in the history
Change-Id: I8809fa964d1dfbaec6ec4b79f1e7a74c6b152397
  • Loading branch information
rdementi committed Nov 18, 2024
2 parents 48be124 + bb4903c commit 1920589
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 11 deletions.
13 changes: 10 additions & 3 deletions src/cpucounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2666,7 +2666,7 @@ void PCM::initUncorePMUsDirect()
std::hex << devInfo.func << "/telemetry/control";
qatTLMCTLStr = readSysFS(qat_TLMCTL_sysfs_path.str().c_str(), true);
if(!qatTLMCTLStr.size()){
std::cout << "Warning: IDX - QAT telemetry feature of B:0x" << std::hex << devInfo.bus << ",D:0x" << devInfo.dev << ",F:0x" << devInfo.func \
std::cerr << "Warning: IDX - QAT telemetry feature of B:0x" << std::hex << devInfo.bus << ",D:0x" << devInfo.dev << ",F:0x" << devInfo.func \
<< " is NOT available, skipped." << std::dec << std::endl;
continue;
}
Expand Down Expand Up @@ -2858,7 +2858,14 @@ void PCM::initUncorePMUsDirect()
uncorePMUDiscovery->getNumBoxes(SPR_CXLDP_BOX_TYPE, s));
for (size_t pos = 0; pos < n_units; ++pos)
{
cxlPMUs[s].push_back(std::make_pair(createCXLPMU(s, SPR_CXLCM_BOX_TYPE, pos), createCXLPMU(s, SPR_CXLDP_BOX_TYPE, pos)));
try
{
cxlPMUs[s].push_back(std::make_pair(createCXLPMU(s, SPR_CXLCM_BOX_TYPE, pos), createCXLPMU(s, SPR_CXLDP_BOX_TYPE, pos)));
}
catch (const std::exception& e)
{
std::cerr << "CXL PMU initialization for socket " << s << " at position " << pos << " failed: " << e.what() << std::endl;
}
}
}
break;
Expand Down Expand Up @@ -4636,7 +4643,7 @@ void PCM::disableForceRTMAbortMode(const bool silent)
}
}

bool PCM::isForceRTMAbortModeAvailable() const
bool PCM::isForceRTMAbortModeAvailable()
{
PCM_CPUID_INFO info;
pcm_cpuid(7, 0, info); // leaf 7, subleaf 0
Expand Down
2 changes: 1 addition & 1 deletion src/cpucounters.h
Original file line number Diff line number Diff line change
Expand Up @@ -2405,7 +2405,7 @@ class PCM_API PCM
void disableForceRTMAbortMode(const bool silent = false);

//! \brief queries availability of "force all RTM transaction abort" mode
bool isForceRTMAbortModeAvailable() const;
static bool isForceRTMAbortModeAvailable();

//! \brief Get microcode level (returns -1 if retrieval not supported due to some restrictions)
int64 getCPUMicrocodeLevel() const { return cpu_microcode_level; }
Expand Down
29 changes: 22 additions & 7 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,16 +812,31 @@ int calibratedSleep(const double delay, const char* sysCmd, const MainLoop& main

void print_help_force_rtm_abort_mode(const int alignment, const char * separator)
{
const auto m = PCM::getInstance();
if (m->isForceRTMAbortModeAvailable() && (m->getMaxCustomCoreEvents() < 4))
if (PCM::isForceRTMAbortModeAvailable() == false)
{
return;
}
try
{
std::cout << " -force-rtm-abort-mode";
for (int i = 0; i < (alignment - 23); ++i)
const auto m = PCM::getInstance();
if (m->getMaxCustomCoreEvents() < 4)
{
std::cout << " ";
std::cout << " -force-rtm-abort-mode";
for (int i = 0; i < (alignment - 23); ++i)
{
std::cout << " ";
}
assert(separator);
std::cout << separator << " force RTM transaction abort mode to enable more programmable counters\n";
}
assert(separator);
std::cout << separator << " force RTM transaction abort mode to enable more programmable counters\n";
}
catch (std::exception & e)
{
std::cerr << "ERROR: " << e.what() << "\n";
}
catch (...)
{
std::cerr << "ERROR: Unknown exception caught in print_help_force_rtm_abort_mode\n";
}
}

Expand Down

0 comments on commit 1920589

Please sign in to comment.