Skip to content

Commit 0bac747

Browse files
authored
Merge pull request #966 from intel/push-2025-07-24
Push 2025 07 24
2 parents b152828 + 6e605f1 commit 0bac747

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/cpucounters.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7330,7 +7330,14 @@ ServerUncoreCounterState PCM::getServerUncoreCounterState(uint32 socket)
73307330

73317331
result.UncClocks = getUncoreClocks(socket);
73327332

7333-
for (size_t p = 0; p < getNumCXLPorts(socket); ++p)
7333+
const auto numCXLPorts = getNumCXLPorts(socket);
7334+
7335+
assert(numCXLPorts <= result.CXLCMCounter.size() && "Number of CXL ports exceeds CXLCMCounter array size");
7336+
assert(numCXLPorts <= result.CXLDPCounter.size() && "Number of CXL ports exceeds CXLDPCounter array size");
7337+
7338+
const auto maxPorts = (std::min)(numCXLPorts, (std::min)(result.CXLCMCounter.size(), result.CXLDPCounter.size()));
7339+
7340+
for (size_t p = 0; p < maxPorts; ++p)
73347341
{
73357342
for (int i = 0; i < ServerUncoreCounterState::maxCounters && socket < cxlPMUs.size() && size_t(i) < cxlPMUs[socket][p].first.size(); ++i)
73367343
{

src/cpucounters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3790,7 +3790,7 @@ class ServerUncoreCounterState : public UncoreCounterState
37903790
maxChannels = 32,
37913791
maxXPILinks = 6,
37923792
maxIIOStacks = 16,
3793-
maxCXLPorts = 6,
3793+
maxCXLPorts = 16,
37943794
maxCounters = UncorePMU::maxCounters
37953795
};
37963796
enum EventPosition

0 commit comments

Comments
 (0)