| 1 | package ebpf |
| 2 | |
| 3 | // PossibleCPU returns the max number of CPUs a system may possibly have |
| 4 | // Logical CPU numbers must be of the form 0-n |
| 5 | func PossibleCPU() (int, error) { |
| 6 | return possibleCPU() |
| 7 | } |
| 8 | |
| 9 | // MustPossibleCPU is a helper that wraps a call to PossibleCPU and panics if |
| 10 | // the error is non-nil. |
| 11 | func MustPossibleCPU() int { |
| 12 | cpus, err := PossibleCPU() |
| 13 | if err != nil { |
| 14 | panic(err) |
| 15 | } |
| 16 | return cpus |
| 17 | } |