@@ -652,14 +652,14 @@ void PCM::initRDT()
652
652
MSR[core]->read (IA32_PQR_ASSOC, &msr_pqr_assoc);
653
653
// std::cout << "initRMID reading IA32_PQR_ASSOC 0x" << std::hex << msr_pqr_assoc << std::dec << "\n";
654
654
655
- // std::cout << "Socket Id : " << topology[core].socket ;
655
+ // std::cout << "Socket Id : " << topology[core].socket_id ;
656
656
msr_pqr_assoc &= 0xffffffff00000000ULL ;
657
- msr_pqr_assoc |= (uint64)(rmid[topology[core].socket ] & ((1ULL <<10 )-1ULL ));
657
+ msr_pqr_assoc |= (uint64)(rmid[topology[core].socket_id ] & ((1ULL <<10 )-1ULL ));
658
658
// std::cout << "initRMID writing IA32_PQR_ASSOC 0x" << std::hex << msr_pqr_assoc << std::dec << "\n";
659
659
// Write 0xC8F MSR with new RMID for each core
660
660
MSR[core]->write (IA32_PQR_ASSOC,msr_pqr_assoc);
661
661
662
- msr_qm_evtsel = static_cast <uint64>(rmid[topology[core].socket ] & ((1ULL <<10 )-1ULL ));
662
+ msr_qm_evtsel = static_cast <uint64>(rmid[topology[core].socket_id ] & ((1ULL <<10 )-1ULL ));
663
663
msr_qm_evtsel <<= 32 ;
664
664
// Write 0xC8D MSR with new RMID for each core
665
665
// std::cout << "initRMID writing IA32_QM_EVTSEL 0x" << std::hex << msr_qm_evtsel << std::dec << "\n";
@@ -675,7 +675,7 @@ void PCM::initRDT()
675
675
memory_bw_total.push_back (std::make_shared<CounterWidthExtender>(new CounterWidthExtender::MBTCounter (MSR[core]), 24 , 1000 ));
676
676
}
677
677
}
678
- rmid[topology[core].socket ] --;
678
+ rmid[topology[core].socket_id ] --;
679
679
// std::cout << std::flush; // Explicitly flush after each iteration
680
680
}
681
681
/* Get The scaling factor by running CPUID.0xF.0x1 instruction */
@@ -1188,7 +1188,7 @@ bool PCM::discoverSystemTopology()
1188
1188
}
1189
1189
entry.die_id = getID (apic_id, TopologyEntry::DomainTypeID::DieDomain);
1190
1190
entry.die_grp_id = getID (apic_id, TopologyEntry::DomainTypeID::DieGrpDomain);
1191
- entry.socket = getID (apic_id, TopologyEntry::DomainTypeID::SocketPackageDomain);
1191
+ entry.socket_id = getID (apic_id, TopologyEntry::DomainTypeID::SocketPackageDomain);
1192
1192
}
1193
1193
else
1194
1194
{
@@ -1281,7 +1281,7 @@ bool PCM::discoverSystemTopology()
1281
1281
}
1282
1282
1283
1283
topology.push_back (entry);
1284
- socketIdMap[entry.socket ] = 0 ;
1284
+ socketIdMap[entry.socket_id ] = 0 ;
1285
1285
}
1286
1286
1287
1287
deleteAndNullifyArray (base_slpi);
@@ -1329,7 +1329,7 @@ bool PCM::discoverSystemTopology()
1329
1329
}
1330
1330
1331
1331
topology[entry.os_id ] = entry;
1332
- socketIdMap[entry.socket ] = 0 ;
1332
+ socketIdMap[entry.socket_id ] = 0 ;
1333
1333
++num_online_cores;
1334
1334
}
1335
1335
catch (std::exception &)
@@ -1368,10 +1368,10 @@ bool PCM::discoverSystemTopology()
1368
1368
return false ;
1369
1369
}
1370
1370
1371
- if (entry.socket == 0 && entry.core_id == 0 ) ++threads_per_core;
1371
+ if (entry.socket_id == 0 && entry.core_id == 0 ) ++threads_per_core;
1372
1372
1373
1373
topology.push_back (entry);
1374
- socketIdMap[entry.socket ] = 0 ;
1374
+ socketIdMap[entry.socket_id ] = 0 ;
1375
1375
}
1376
1376
1377
1377
#else // Getting processor info for Mac OS
@@ -1419,10 +1419,10 @@ bool PCM::discoverSystemTopology()
1419
1419
return false ;
1420
1420
}
1421
1421
for (int i = 0 ; i < num_cores; i++){
1422
- socketIdMap[entries[i].socket ] = 0 ;
1422
+ socketIdMap[entries[i].socket_id ] = 0 ;
1423
1423
if (entries[i].os_id >= 0 )
1424
1424
{
1425
- if (entries[i].core_id == 0 && entries[i].socket == 0 ) ++threads_per_core;
1425
+ if (entries[i].core_id == 0 && entries[i].socket_id == 0 ) ++threads_per_core;
1426
1426
if (populateHybridEntry (entries[i], i) == false )
1427
1427
{
1428
1428
return false ;
@@ -1464,22 +1464,22 @@ bool PCM::discoverSystemTopology()
1464
1464
for (int i = 0 ; (i < (int )num_cores) && (!socketIdMap.empty ()); ++i)
1465
1465
{
1466
1466
if (isCoreOnline ((int32)i))
1467
- topology[i].socket = socketIdMap[topology[i].socket ];
1467
+ topology[i].socket_id = socketIdMap[topology[i].socket_id ];
1468
1468
}
1469
1469
1470
1470
#if 0
1471
1471
std::cerr << "Number of socket ids: " << socketIdMap.size() << "\n";
1472
1472
std::cerr << "Topology:\nsocket os_id core_id\n";
1473
1473
for (int i = 0; i < num_cores; ++i)
1474
1474
{
1475
- std::cerr << topology[i].socket << " " << topology[i].os_id << " " << topology[i].core_id << "\n";
1475
+ std::cerr << topology[i].socket_id << " " << topology[i].os_id << " " << topology[i].core_id << "\n";
1476
1476
}
1477
1477
#endif
1478
1478
if (threads_per_core == 0 )
1479
1479
{
1480
1480
for (int i = 0 ; i < (int )num_cores; ++i)
1481
1481
{
1482
- if (topology[i].socket == topology[0 ].socket && topology[i].core_id == topology[0 ].core_id )
1482
+ if (topology[i].socket_id == topology[0 ].socket_id && topology[i].core_id == topology[0 ].core_id )
1483
1483
++threads_per_core;
1484
1484
}
1485
1485
assert (threads_per_core != 0 );
@@ -1494,7 +1494,7 @@ bool PCM::discoverSystemTopology()
1494
1494
{
1495
1495
if (isCoreOnline (i))
1496
1496
{
1497
- socketRefCore[topology[i].socket ] = i;
1497
+ socketRefCore[topology[i].socket_id ] = i;
1498
1498
}
1499
1499
}
1500
1500
@@ -3132,16 +3132,16 @@ void PCM::printDetailedSystemTopology(const int detailLevel)
3132
3132
if (detailLevel > 0 ) std::cerr << std::setw (16 ) << it->module_id ;
3133
3133
std::cerr << std::setw (16 ) << it->tile_id ;
3134
3134
if (detailLevel > 0 ) std::cerr << std::setw (16 ) << it->die_id << std::setw (16 ) << it->die_grp_id ;
3135
- std::cerr << std::setw (16 ) << it->socket
3135
+ std::cerr << std::setw (16 ) << it->socket_id
3136
3136
<< std::setw (16 ) << it->getCoreTypeStr ()
3137
3137
<< std::setw (16 ) << it->native_cpu_model
3138
3138
<< " \n " ;
3139
- if (std::find (core_id_by_socket[it->socket ].begin (), core_id_by_socket[it->socket ].end (), it->core_id )
3140
- == core_id_by_socket[it->socket ].end ())
3141
- core_id_by_socket[it->socket ].push_back (it->core_id );
3139
+ if (std::find (core_id_by_socket[it->socket_id ].begin (), core_id_by_socket[it->socket_id ].end (), it->core_id )
3140
+ == core_id_by_socket[it->socket_id ].end ())
3141
+ core_id_by_socket[it->socket_id ].push_back (it->core_id );
3142
3142
// add socket offset to distinguish cores and tiles from different sockets
3143
- os_id_by_core[(it->socket << 15 ) + it->core_id ].push_back (it->os_id );
3144
- os_id_by_tile[(it->socket << 15 ) + it->tile_id ].push_back (it->os_id );
3143
+ os_id_by_core[(it->socket_id << 15 ) + it->core_id ].push_back (it->os_id );
3144
+ os_id_by_tile[(it->socket_id << 15 ) + it->tile_id ].push_back (it->os_id );
3145
3145
3146
3146
++counter;
3147
3147
}
@@ -3233,7 +3233,7 @@ void PCM::showSpecControlMSRs()
3233
3233
3234
3234
bool PCM::isCoreOnline (int32 os_core_id) const
3235
3235
{
3236
- return (topology[os_core_id].os_id != -1 ) && (topology[os_core_id].core_id != -1 ) && (topology[os_core_id].socket != -1 );
3236
+ return (topology[os_core_id].os_id != -1 ) && (topology[os_core_id].core_id != -1 ) && (topology[os_core_id].socket_id != -1 );
3237
3237
}
3238
3238
3239
3239
bool PCM::isSocketOnline (int32 socket_id) const
@@ -6674,7 +6674,7 @@ void PCM::readQPICounters(SystemCounterState & result)
6674
6674
6675
6675
if (core == socketRefCore[0 ]) MSR[core]->read (W_MSR_PMON_FIXED_CTR, &(result.uncoreTSC ));
6676
6676
6677
- uint32 s = topology[core].socket ;
6677
+ uint32 s = topology[core].socket_id ;
6678
6678
6679
6679
if (!SocketProcessed[s])
6680
6680
{
@@ -6802,7 +6802,7 @@ SocketCounterState PCM::getSocketCounterState(uint32 socket)
6802
6802
{
6803
6803
// reading core and uncore counter states
6804
6804
for (int32 core = 0 ; core < num_cores; ++core)
6805
- if (isCoreOnline (core) && (topology[core].socket == int32 (socket)))
6805
+ if (isCoreOnline (core) && (topology[core].socket_id == int32 (socket)))
6806
6806
result.readAndAggregate (MSR[core]);
6807
6807
6808
6808
readAndAggregateUncoreMCCounters (socket, result);
@@ -6836,7 +6836,7 @@ void PCM::getAllCounterStates(SystemCounterState & systemState, std::vector<Sock
6836
6836
coreStates[core].readAndAggregate (MSR[core]);
6837
6837
if (readAndAggregateSocketUncoreCounters)
6838
6838
{
6839
- socketStates[topology[core].socket ].UncoreCounterState ::readAndAggregate (MSR[core]); // read package C state counters
6839
+ socketStates[topology[core].socket_id ].UncoreCounterState ::readAndAggregate (MSR[core]); // read package C state counters
6840
6840
}
6841
6841
readMSRs (MSR[core], threadMSRConfig, coreStates[core]);
6842
6842
}
@@ -6876,7 +6876,7 @@ void PCM::getAllCounterStates(SystemCounterState & systemState, std::vector<Sock
6876
6876
for (int32 core = 0 ; core < num_cores; ++core)
6877
6877
{ // aggregate core counters into sockets
6878
6878
if (isCoreOnline (core))
6879
- socketStates[topology[core].socket ] += coreStates[core];
6879
+ socketStates[topology[core].socket_id ] += coreStates[core];
6880
6880
}
6881
6881
6882
6882
for (int32 s = 0 ; s < num_sockets; ++s)
@@ -6915,7 +6915,7 @@ void PCM::getUncoreCounterStates(SystemCounterState & systemState, std::vector<S
6915
6915
{
6916
6916
for (uint32 core=0 ; core < getNumCores (); ++core)
6917
6917
{
6918
- if (topology[core].socket == s && isCoreOnline (core))
6918
+ if (topology[core].socket_id == s && isCoreOnline (core))
6919
6919
socketStates[s] += refCoreStates[s];
6920
6920
}
6921
6921
}
0 commit comments