Skip to content

Commit 1920589

Browse files
committed
Merge tag '2024-11-17' into push-2024-11-17
Change-Id: I8809fa964d1dfbaec6ec4b79f1e7a74c6b152397
2 parents 48be124 + bb4903c commit 1920589

File tree

3 files changed

+33
-11
lines changed

3 files changed

+33
-11
lines changed

src/cpucounters.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2666,7 +2666,7 @@ void PCM::initUncorePMUsDirect()
26662666
std::hex << devInfo.func << "/telemetry/control";
26672667
qatTLMCTLStr = readSysFS(qat_TLMCTL_sysfs_path.str().c_str(), true);
26682668
if(!qatTLMCTLStr.size()){
2669-
std::cout << "Warning: IDX - QAT telemetry feature of B:0x" << std::hex << devInfo.bus << ",D:0x" << devInfo.dev << ",F:0x" << devInfo.func \
2669+
std::cerr << "Warning: IDX - QAT telemetry feature of B:0x" << std::hex << devInfo.bus << ",D:0x" << devInfo.dev << ",F:0x" << devInfo.func \
26702670
<< " is NOT available, skipped." << std::dec << std::endl;
26712671
continue;
26722672
}
@@ -2858,7 +2858,14 @@ void PCM::initUncorePMUsDirect()
28582858
uncorePMUDiscovery->getNumBoxes(SPR_CXLDP_BOX_TYPE, s));
28592859
for (size_t pos = 0; pos < n_units; ++pos)
28602860
{
2861-
cxlPMUs[s].push_back(std::make_pair(createCXLPMU(s, SPR_CXLCM_BOX_TYPE, pos), createCXLPMU(s, SPR_CXLDP_BOX_TYPE, pos)));
2861+
try
2862+
{
2863+
cxlPMUs[s].push_back(std::make_pair(createCXLPMU(s, SPR_CXLCM_BOX_TYPE, pos), createCXLPMU(s, SPR_CXLDP_BOX_TYPE, pos)));
2864+
}
2865+
catch (const std::exception& e)
2866+
{
2867+
std::cerr << "CXL PMU initialization for socket " << s << " at position " << pos << " failed: " << e.what() << std::endl;
2868+
}
28622869
}
28632870
}
28642871
break;
@@ -4636,7 +4643,7 @@ void PCM::disableForceRTMAbortMode(const bool silent)
46364643
}
46374644
}
46384645

4639-
bool PCM::isForceRTMAbortModeAvailable() const
4646+
bool PCM::isForceRTMAbortModeAvailable()
46404647
{
46414648
PCM_CPUID_INFO info;
46424649
pcm_cpuid(7, 0, info); // leaf 7, subleaf 0

src/cpucounters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2405,7 +2405,7 @@ class PCM_API PCM
24052405
void disableForceRTMAbortMode(const bool silent = false);
24062406

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

24102410
//! \brief Get microcode level (returns -1 if retrieval not supported due to some restrictions)
24112411
int64 getCPUMicrocodeLevel() const { return cpu_microcode_level; }

src/utils.cpp

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -812,16 +812,31 @@ int calibratedSleep(const double delay, const char* sysCmd, const MainLoop& main
812812

813813
void print_help_force_rtm_abort_mode(const int alignment, const char * separator)
814814
{
815-
const auto m = PCM::getInstance();
816-
if (m->isForceRTMAbortModeAvailable() && (m->getMaxCustomCoreEvents() < 4))
815+
if (PCM::isForceRTMAbortModeAvailable() == false)
816+
{
817+
return;
818+
}
819+
try
817820
{
818-
std::cout << " -force-rtm-abort-mode";
819-
for (int i = 0; i < (alignment - 23); ++i)
821+
const auto m = PCM::getInstance();
822+
if (m->getMaxCustomCoreEvents() < 4)
820823
{
821-
std::cout << " ";
824+
std::cout << " -force-rtm-abort-mode";
825+
for (int i = 0; i < (alignment - 23); ++i)
826+
{
827+
std::cout << " ";
828+
}
829+
assert(separator);
830+
std::cout << separator << " force RTM transaction abort mode to enable more programmable counters\n";
822831
}
823-
assert(separator);
824-
std::cout << separator << " force RTM transaction abort mode to enable more programmable counters\n";
832+
}
833+
catch (std::exception & e)
834+
{
835+
std::cerr << "ERROR: " << e.what() << "\n";
836+
}
837+
catch (...)
838+
{
839+
std::cerr << "ERROR: Unknown exception caught in print_help_force_rtm_abort_mode\n";
825840
}
826841
}
827842

0 commit comments

Comments
 (0)