mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-12-25 23:19:06 +01:00
Fix DieList() if system does not support dies. Explicitly set entries in CpuData list
This commit is contained in:
parent
c506114480
commit
622e94ae0e
@ -169,8 +169,11 @@ func DieList() []int {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(dielist) > 0 {
|
||||||
return dielist
|
return dielist
|
||||||
}
|
}
|
||||||
|
return SocketList()
|
||||||
|
}
|
||||||
|
|
||||||
type CpuEntry struct {
|
type CpuEntry struct {
|
||||||
Cpuid int
|
Cpuid int
|
||||||
@ -261,7 +264,7 @@ func CpuData() []CpuEntry {
|
|||||||
for _, c := range CpuList() {
|
for _, c := range CpuList() {
|
||||||
clist = append(clist, CpuEntry{Cpuid: c})
|
clist = append(clist, CpuEntry{Cpuid: c})
|
||||||
}
|
}
|
||||||
for _, centry := range clist {
|
for i, centry := range clist {
|
||||||
centry.Socket = -1
|
centry.Socket = -1
|
||||||
centry.Numadomain = -1
|
centry.Numadomain = -1
|
||||||
centry.Die = -1
|
centry.Die = -1
|
||||||
@ -289,6 +292,8 @@ func CpuData() []CpuEntry {
|
|||||||
// Lookup NUMA domain id
|
// Lookup NUMA domain id
|
||||||
centry.Numadomain = getNumaDomain(base)
|
centry.Numadomain = getNumaDomain(base)
|
||||||
|
|
||||||
|
// Update values in output list
|
||||||
|
clist[i] = centry
|
||||||
}
|
}
|
||||||
return clist
|
return clist
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user