Skip to content

Commit

Permalink
catch exception in getMaxNumOfCBoxes to allow the fall-back perf API …
Browse files Browse the repository at this point in the history
…method to be called

Change-Id: I9ae1a831c16576ebae9606991ebb1650b5e39cd8
  • Loading branch information
rdementi committed Sep 20, 2023
1 parent c583d33 commit 2aa2784
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cpucounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9016,7 +9016,7 @@ uint32 PCM::getMaxNumOfCBoxes() const
switch (cpu_model)
{
case SPR:
{
try {
PciHandleType * h = getDeviceHandle(PCM_INTEL_PCI_VENDOR_ID, 0x325b);
if (h)
{
Expand All @@ -9028,6 +9028,10 @@ uint32 PCM::getMaxNumOfCBoxes() const
delete h;
}
}
catch (std::exception& e)
{
std::cerr << "Warning: reading the number of CHA from PCICFG register has failed: " << e.what() << "\n";
}
break;
case KNL:
case SKX:
Expand Down

0 comments on commit 2aa2784

Please sign in to comment.