Skip to content

Commit

Permalink
add implicit SocketPackageDomain
Browse files Browse the repository at this point in the history
Change-Id: I82d478edb79895a957f122269963c5951820a1d3
  • Loading branch information
rdementi committed Dec 4, 2023
1 parent b024e4d commit 59fae52
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/cpucounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ bool PCM::discoverSystemTopology()

struct domain
{
unsigned type, levelShift, nextLevelShift, width;
unsigned type = 0, levelShift = 0, nextLevelShift = 0, width = 0;
};
std::vector<domain> topologyDomains;
if (max_cpuid >= 0x1F)
Expand All @@ -1182,6 +1182,16 @@ bool PCM::discoverSystemTopology()
topologyDomains.push_back(d);
++subleaf;
} while (true);

if (topologyDomains.size())
{
domain d;
d.type = TopologyEntry::DomainTypeID::SocketPackageDomain;
d.levelShift = topologyDomains.back().nextLevelShift;
d.nextLevelShift = 32;
d.width = d.nextLevelShift - d.levelShift;
topologyDomains.push_back(d);
}
#if 0
for (size_t l = 0; l < topologyDomains.size(); ++l)
{
Expand Down
4 changes: 3 additions & 1 deletion src/topologyentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ struct PCM_API TopologyEntry // describes a core
ModuleDomain = 3,
TileDomain = 4,
DieDomain = 5,
DieGrpDomain = 6
DieGrpDomain = 6,
SocketPackageDomain = 0xffff
};
enum CoreType
{
Expand Down Expand Up @@ -62,6 +63,7 @@ struct PCM_API TopologyEntry // describes a core
case TileDomain: return "Tile";
case DieDomain: return "Die";
case DieGrpDomain: return "DieGroup";
case SocketPackageDomain: return "Socket/Package";
}
return "unknown";
}
Expand Down

0 comments on commit 59fae52

Please sign in to comment.