File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -7330,7 +7330,14 @@ ServerUncoreCounterState PCM::getServerUncoreCounterState(uint32 socket)
7330
7330
7331
7331
result.UncClocks = getUncoreClocks (socket);
7332
7332
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)
7334
7341
{
7335
7342
for (int i = 0 ; i < ServerUncoreCounterState::maxCounters && socket < cxlPMUs.size () && size_t (i) < cxlPMUs[socket][p].first .size (); ++i)
7336
7343
{
Original file line number Diff line number Diff line change @@ -3790,7 +3790,7 @@ class ServerUncoreCounterState : public UncoreCounterState
3790
3790
maxChannels = 32 ,
3791
3791
maxXPILinks = 6 ,
3792
3792
maxIIOStacks = 16 ,
3793
- maxCXLPorts = 6 ,
3793
+ maxCXLPorts = 16 ,
3794
3794
maxCounters = UncorePMU::maxCounters
3795
3795
};
3796
3796
enum EventPosition
You can’t perform that action at this time.
0 commit comments