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

Method load

pkg/cpu/cpu_linux.go:30–43  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

28)
29
30func (i *Info) load(ctx context.Context) error {
31 i.Processors = processorsGet(ctx)
32 var totCores uint32
33 var totThreads uint32
34 for _, p := range i.Processors {
35 totCores += p.TotalCores
36 totThreads += p.TotalHardwareThreads
37 }
38 i.TotalCores = totCores
39 i.TotalHardwareThreads = totThreads
40 // TODO(jaypipes): Remove TotalThreads before v1.0
41 i.TotalThreads = totThreads
42 return nil
43}
44
45func processorsGet(ctx context.Context) []*Processor {
46 paths := linuxpath.New(ctx)

Callers

nothing calls this directly

Calls 1

processorsGetFunction · 0.70

Tested by

no test coverage detected