Fix reading cache info for machines with unused packages.

Use thread ids instead of core-ids to identify caches.
This commit is contained in:
Rohit Jnagal 2015-01-04 02:40:54 +00:00
parent 45334c6f71
commit 1d26484681

View File

@ -179,7 +179,7 @@ func getTopology(sysFs sysfs.SysFs, cpuinfo string) ([]info.Node, int, error) {
return nil, numCores, fmt.Errorf("could not detect any cores")
}
for idx, node := range nodes {
caches, err := sysinfo.GetCacheInfo(sysFs, node.Cores[0].Id)
caches, err := sysinfo.GetCacheInfo(sysFs, node.Cores[0].Threads[0])
if err != nil {
return nil, -1, fmt.Errorf("failed to get cache information for node %d: %v", node.Id, err)
}