coreIDFromLogicalProcessorID returns the core ID for the supplied logical processor ID
(ctx context.Context, lpID int)
| 178 | // coreIDFromLogicalProcessorID returns the core ID for the supplied logical |
| 179 | // processor ID |
| 180 | func coreIDFromLogicalProcessorID(ctx context.Context, lpID int) int { |
| 181 | paths := linuxpath.New(ctx) |
| 182 | // Fetch CPU ID |
| 183 | path := filepath.Join( |
| 184 | paths.SysDevicesSystemCPU, |
| 185 | fmt.Sprintf("cpu%d", lpID), |
| 186 | "topology", "core_id", |
| 187 | ) |
| 188 | return util.SafeIntFromFile(ctx, path) |
| 189 | } |
| 190 | |
| 191 | func CoresForNode(ctx context.Context, nodeID int) ([]*ProcessorCore, error) { |
| 192 | // The /sys/devices/system/node/nodeX directory contains a subdirectory |
no test coverage detected
searching dependent graphs…