Skip to content

Commit

Permalink
handle invalid CXL PMU entries
Browse files Browse the repository at this point in the history
Change-Id: I621725d4d0e5300b3b1052d91f7d18e3887c845a
  • Loading branch information
rdementi committed Nov 6, 2024
1 parent 652c772 commit ef33733
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/cpucounters.cpp
Original file line number Diff line number Diff line change
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

0 comments on commit ef33733

Please sign in to comment.