Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push 2024 11 17 #879

Merged
merged 6 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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