processorIDFromLogicalProcessorID returns the processor physical package ID for the supplied logical processor ID
(ctx context.Context, lpID int)
| 165 | // processorIDFromLogicalProcessorID returns the processor physical package ID |
| 166 | // for the supplied logical processor ID |
| 167 | func processorIDFromLogicalProcessorID(ctx context.Context, lpID int) int { |
| 168 | paths := linuxpath.New(ctx) |
| 169 | // Fetch CPU ID |
| 170 | path := filepath.Join( |
| 171 | paths.SysDevicesSystemCPU, |
| 172 | fmt.Sprintf("cpu%d", lpID), |
| 173 | "topology", "physical_package_id", |
| 174 | ) |
| 175 | return util.SafeIntFromFile(ctx, path) |
| 176 | } |
| 177 | |
| 178 | // coreIDFromLogicalProcessorID returns the core ID for the supplied logical |
| 179 | // processor ID |
no test coverage detected
searching dependent graphs…