GetCacheInfo return information about a cache accessible from the given cpu thread
(sysFs sysfs.SysFs, id int)
| 517 | |
| 518 | // GetCacheInfo return information about a cache accessible from the given cpu thread |
| 519 | func GetCacheInfo(sysFs sysfs.SysFs, id int) ([]sysfs.CacheInfo, error) { |
| 520 | caches, err := sysFs.GetCaches(id) |
| 521 | if err != nil { |
| 522 | return nil, err |
| 523 | } |
| 524 | |
| 525 | info := []sysfs.CacheInfo{} |
| 526 | for _, cache := range caches { |
| 527 | if !strings.HasPrefix(cache.Name(), "index") { |
| 528 | continue |
| 529 | } |
| 530 | cacheInfo, err := sysFs.GetCacheInfo(id, cache.Name()) |
| 531 | if err != nil { |
| 532 | return nil, err |
| 533 | } |
| 534 | info = append(info, cacheInfo) |
| 535 | } |
| 536 | return info, nil |
| 537 | } |
| 538 | |
| 539 | func getNetworkStats(name string, sysFs sysfs.SysFs) (info.InterfaceStats, error) { |
| 540 | var stats info.InterfaceStats |
searching dependent graphs…