Skip to content

Commit

Permalink
sysfs: dump results in more predictable order.
Browse files Browse the repository at this point in the history
Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Mar 19, 2024
1 parent 5f0fb71 commit 648f0d1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/sysfs/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,26 +327,29 @@ func (sys *system) Discover(flags DiscoveryFlag) error {
}

if sys.DebugEnabled() {
for id, pkg := range sys.packages {
for _, id := range sys.PackageIDs() {
pkg := sys.packages[id]
sys.Info("package #%d:", id)
sys.Debug(" cpus: %s", pkg.cpus)
sys.Debug(" nodes: %s", pkg.nodes)
sys.Debug(" dies: %s", pkg.dies)
for die := range pkg.dies {
for _, die := range pkg.DieIDs() {
sys.Debug(" die #%v nodes: %v", die, pkg.DieNodeIDs(die))
sys.Debug(" die #%v cpus: %s", die, pkg.DieCPUSet(die).String())
}
}

for id, node := range sys.nodes {
for _, id := range sys.NodeIDs() {
node := sys.nodes[id]
sys.Debug("node #%d:", id)
sys.Debug(" cpus: %s", node.cpus)
sys.Debug(" distance: %v", node.distance)
sys.Debug(" package: #%d", node.pkg)
sys.Debug(" die: #%d", node.die)
}

for id, cpu := range sys.cpus {
for _, id := range sys.CPUIDs() {
cpu := sys.cpus[id]
sys.Debug("CPU #%d:", id)
sys.Debug(" pkg: %d", cpu.pkg)
sys.Debug(" die: %d", cpu.die)
Expand Down

0 comments on commit 648f0d1

Please sign in to comment.