MCPcopy
hub / github.com/jaypipes/ghw / memoryCacheSharedCPUMap

Function memoryCacheSharedCPUMap

pkg/memory/memory_cache_linux.go:231–248  ·  view source on GitHub ↗
(
	ctx context.Context,
	paths *linuxpath.Paths,
	nodeID int,
	lpID int,
	cacheIndex int,
)

Source from the content-addressed store, hash-verified

229}
230
231func memoryCacheSharedCPUMap(
232 ctx context.Context,
233 paths *linuxpath.Paths,
234 nodeID int,
235 lpID int,
236 cacheIndex int,
237) string {
238 scpuPath := filepath.Join(
239 paths.NodeCPUCacheIndex(nodeID, lpID, cacheIndex),
240 "shared_cpu_map",
241 )
242 sharedCpuMap, err := os.ReadFile(scpuPath)
243 if err != nil {
244 log.Warn(ctx, "%s", err)
245 return ""
246 }
247 return string(sharedCpuMap[:len(sharedCpuMap)-1])
248}

Callers 1

CachesForNodeFunction · 0.85

Calls 2

WarnFunction · 0.92
NodeCPUCacheIndexMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…