-
Notifications
You must be signed in to change notification settings - Fork 524
Push 2025 05 05 #948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Push 2025 05 05 #948
Changes from all commits
05db9fa
7f8ec6b
a53923d
0e07215
49b88ae
0b88492
2c171bf
7913344
d349e66
7349f2f
0996eae
b9028f9
836b132
4bed9d2
c8d6cd5
5d85579
44dee11
21fb054
cc78430
6406663
c663754
4a733de
8cdfbbd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,4 +32,5 @@ latex/ | |
| .vs/ | ||
| .idea/ | ||
| build | ||
| src/simdjson | ||
| src/simdjson | ||
| .vscode/ | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1101,6 +1101,7 @@ bool PCM::discoverSystemTopology() | |||||||||||||||||||||||||||||||
| uint32 smtMaskWidth = 0; | ||||||||||||||||||||||||||||||||
| uint32 coreMaskWidth = 0; | ||||||||||||||||||||||||||||||||
| uint32 l2CacheMaskShift = 0; | ||||||||||||||||||||||||||||||||
| uint32 l3CacheMaskShift = 0; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| struct domain | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
|
|
@@ -1111,7 +1112,7 @@ bool PCM::discoverSystemTopology() | |||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| TemporalThreadAffinity aff0(0); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| if (initCoreMasks(smtMaskWidth, coreMaskWidth, l2CacheMaskShift) == false) | ||||||||||||||||||||||||||||||||
| if (initCoreMasks(smtMaskWidth, coreMaskWidth, l2CacheMaskShift, l3CacheMaskShift) == false) | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| std::cerr << "ERROR: Major problem? No leaf 0 under cpuid function 11.\n"; | ||||||||||||||||||||||||||||||||
| return false; | ||||||||||||||||||||||||||||||||
|
|
@@ -1151,20 +1152,18 @@ bool PCM::discoverSystemTopology() | |||||||||||||||||||||||||||||||
| for (size_t l = 0; l < topologyDomains.size(); ++l) | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| topologyDomainMap[topologyDomains[l].type] = topologyDomains[l]; | ||||||||||||||||||||||||||||||||
| #if 0 | ||||||||||||||||||||||||||||||||
| std::cerr << "Topology level: " << l << | ||||||||||||||||||||||||||||||||
| " type: " << topologyDomains[l].type << | ||||||||||||||||||||||||||||||||
| " (" << TopologyEntry::getDomainTypeStr(topologyDomains[l].type) << ")" << | ||||||||||||||||||||||||||||||||
| " width: " << topologyDomains[l].width << | ||||||||||||||||||||||||||||||||
| " levelShift: " << topologyDomains[l].levelShift << | ||||||||||||||||||||||||||||||||
| " nextLevelShift: " << topologyDomains[l].nextLevelShift << "\n"; | ||||||||||||||||||||||||||||||||
| #endif | ||||||||||||||||||||||||||||||||
| DBG(1 , "Topology level: " , l , | ||||||||||||||||||||||||||||||||
| " type: " , topologyDomains[l].type , | ||||||||||||||||||||||||||||||||
| " (" , TopologyEntry::getDomainTypeStr(topologyDomains[l].type) , ")" , | ||||||||||||||||||||||||||||||||
| " width: " , topologyDomains[l].width , | ||||||||||||||||||||||||||||||||
| " levelShift: " , topologyDomains[l].levelShift , | ||||||||||||||||||||||||||||||||
| " nextLevelShift: " , topologyDomains[l].nextLevelShift); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| #ifndef __APPLE__ | ||||||||||||||||||||||||||||||||
| auto populateEntry = [&topologyDomainMap,&smtMaskWidth, &coreMaskWidth, &l2CacheMaskShift](TopologyEntry& entry) | ||||||||||||||||||||||||||||||||
| auto populateEntry = [&topologyDomainMap,&smtMaskWidth, &coreMaskWidth, &l2CacheMaskShift, &l3CacheMaskShift](TopologyEntry& entry) | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| auto getAPICID = [&](const uint32 leaf) | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
|
|
@@ -1218,6 +1217,7 @@ bool PCM::discoverSystemTopology() | |||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| fillEntry(entry, smtMaskWidth, coreMaskWidth, l2CacheMaskShift, getAPICID(0xb)); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| entry.l3_cache_id = extract_bits_32(getAPICID(0xb), l3CacheMaskShift, 31); | ||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||
| #endif | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
@@ -3231,7 +3231,7 @@ void PCM::printDetailedSystemTopology(const int detailLevel) | |||||||||||||||||||||||||||||||
| std::cerr << "Tile_Id "; | ||||||||||||||||||||||||||||||||
| if (detailLevel > 0) std::cerr << "Die_Id Die_Group_Id "; | ||||||||||||||||||||||||||||||||
| std::cerr << "Package_Id Core_Type Native_CPU_Model\n"; | ||||||||||||||||||||||||||||||||
| std::map<uint32, std::vector<uint32> > os_id_by_core, os_id_by_tile, core_id_by_socket; | ||||||||||||||||||||||||||||||||
| std::map<uint32, std::vector<uint32> > os_id_by_core, os_id_by_tile, core_id_by_socket, os_id_by_l3_cache; | ||||||||||||||||||||||||||||||||
| size_t counter = 0; | ||||||||||||||||||||||||||||||||
| for (auto it = topology.begin(); it != topology.end(); ++it) | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
|
|
@@ -3252,6 +3252,7 @@ void PCM::printDetailedSystemTopology(const int detailLevel) | |||||||||||||||||||||||||||||||
| // add socket offset to distinguish cores and tiles from different sockets | ||||||||||||||||||||||||||||||||
| os_id_by_core[(it->socket_id << 15) + it->core_id].push_back(it->os_id); | ||||||||||||||||||||||||||||||||
| os_id_by_tile[(it->socket_id << 15) + it->tile_id].push_back(it->os_id); | ||||||||||||||||||||||||||||||||
| os_id_by_l3_cache[(it->socket_id << 15) + it->l3_cache_id].push_back(it->os_id); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ++counter; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
@@ -3288,6 +3289,16 @@ void PCM::printDetailedSystemTopology(const int detailLevel) | |||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| std::cerr << ")"; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| std::cerr << "\nL3$ "; | ||||||||||||||||||||||||||||||||
| for (auto core = os_id_by_l3_cache.begin(); core != os_id_by_l3_cache.end(); ++core) | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| auto os_id = core->second.begin(); | ||||||||||||||||||||||||||||||||
| std::cerr << "(" << *os_id; | ||||||||||||||||||||||||||||||||
| for (++os_id; os_id != core->second.end(); ++os_id) { | ||||||||||||||||||||||||||||||||
| std::cerr << "," << *os_id; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| std::cerr << ")"; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| std::cerr << "\n"; | ||||||||||||||||||||||||||||||||
| std::cerr << "\n"; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
@@ -7560,14 +7571,23 @@ void PCM::getPCICFGPMUsFromDiscovery(const unsigned int BoxType, const size_t s, | |||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| std::vector<std::shared_ptr<HWRegister> > CounterControlRegs, CounterValueRegs; | ||||||||||||||||||||||||||||||||
| const auto n_regs = uncorePMUDiscovery->getBoxNumRegs(BoxType, s, pos); | ||||||||||||||||||||||||||||||||
| auto makeRegister = [](const uint64 rawAddr) | ||||||||||||||||||||||||||||||||
| auto makeRegister = [&pos, &numBoxes, &BoxType, &s](const uint64 rawAddr) | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| #ifndef PCI_ENABLE | ||||||||||||||||||||||||||||||||
| constexpr auto PCI_ENABLE = 0x80000000ULL; | ||||||||||||||||||||||||||||||||
| #endif | ||||||||||||||||||||||||||||||||
| UncorePMUDiscovery::PCICFGAddress Addr; | ||||||||||||||||||||||||||||||||
| Addr.raw = rawAddr; | ||||||||||||||||||||||||||||||||
| assert(Addr.raw & PCI_ENABLE); | ||||||||||||||||||||||||||||||||
| if ((Addr.raw & PCI_ENABLE) == 0) | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| std::cerr << "PCM Error: PCI_ENABLE bit not set in address 0x" << std::hex << Addr.raw << std::dec << "\n"; | ||||||||||||||||||||||||||||||||
| std::cerr << "This is likely a bug in the uncore PMU discovery BIOS table. Contact your BIOS vendor.\n"; | ||||||||||||||||||||||||||||||||
| std::cerr << "Socket: " << s << "\n"; | ||||||||||||||||||||||||||||||||
| std::cerr << "Box type: " << BoxType << "\n"; | ||||||||||||||||||||||||||||||||
| std::cerr << "Box position: " << pos << "/" << numBoxes << "\n"; | ||||||||||||||||||||||||||||||||
| std::cerr << "Address: " << Addr.getStr() << "\n"; | ||||||||||||||||||||||||||||||||
| return std::shared_ptr<PCICFGRegister64>(); | ||||||||||||||||||||||||||||||||
|
Comment on lines
+7583
to
+7589
|
||||||||||||||||||||||||||||||||
| std::cerr << "PCM Error: PCI_ENABLE bit not set in address 0x" << std::hex << Addr.raw << std::dec << "\n"; | |
| std::cerr << "This is likely a bug in the uncore PMU discovery BIOS table. Contact your BIOS vendor.\n"; | |
| std::cerr << "Socket: " << s << "\n"; | |
| std::cerr << "Box type: " << BoxType << "\n"; | |
| std::cerr << "Box position: " << pos << "/" << numBoxes << "\n"; | |
| std::cerr << "Address: " << Addr.getStr() << "\n"; | |
| return std::shared_ptr<PCICFGRegister64>(); | |
| std::ostringstream errorMsg; | |
| errorMsg << "PCM Error: PCI_ENABLE bit not set in address 0x" << std::hex << Addr.raw << std::dec << "\n" | |
| << "This is likely a bug in the uncore PMU discovery BIOS table. Contact your BIOS vendor.\n" | |
| << "Socket: " << s << "\n" | |
| << "Box type: " << BoxType << "\n" | |
| << "Box position: " << pos << "/" << numBoxes << "\n" | |
| << "Address: " << Addr.getStr() << "\n"; | |
| throw std::runtime_error(errorMsg.str()); |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -55,7 +55,7 @@ string build_pci_header(const PCIDB & pciDB, uint32_t column_width, const struct | |||||||||||||||||
| for (auto& part : p.parts_no) { | ||||||||||||||||||
| s += std::to_string(part) + ", "; | ||||||||||||||||||
| } | ||||||||||||||||||
| s += "\b\b "; | ||||||||||||||||||
| s.erase(s.size() - 2); | ||||||||||||||||||
|
||||||||||||||||||
| s.erase(s.size() - 2); | |
| if (s.size() >= 2) { | |
| s.erase(s.size() - 2); | |
| } |
Copilot
AI
May 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the string has at least two characters before erasing the last two characters to avoid potential underflow. A guard or assert could prevent unexpected behavior if the string is shorter than expected.
| s.erase(s.size() - 2); | |
| if (s.size() >= 2) { | |
| s.erase(s.size() - 2); | |
| } |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.