(ctx context.Context)
| 28 | ) |
| 29 | |
| 30 | func (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 | |
| 45 | func processorsGet(ctx context.Context) []*Processor { |
| 46 | paths := linuxpath.New(ctx) |
nothing calls this directly
no test coverage detected