diff --git a/src/cpucounters.cpp b/src/cpucounters.cpp index 9d2443b0..d0d7f545 100644 --- a/src/cpucounters.cpp +++ b/src/cpucounters.cpp @@ -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;