README ¶
Description ------------ cpu package reports (some) processor topology information Note that the term package refers to a physical processor and system refers to multiple packages. Also, a processor's hardware capability may differ from its configuration. Usage ----- See cpu_example.go for output information and usage Installation ------------ $ go get bitbucket.org/jpoirier/cpu Testing ------- $ go run cpu_example.go TODO ---- - add error enumerations - if 64-bit, or newer 32-bit, and the leaf value is less than 4 check IA32_MISC_ENABLES bit 22 Misc ---- - Package refers to a physical processor that plugs in to a socket - Core refers to a physical sub-system of a package. A core may contain 1 or more logical processors. - A logical processor refers to a hardware resource that can execute a single thread. - Hyper-threading refers to the technology that allows a processor core to provide the functionality of more than one logical core. - Simultaneous Multi-Threading refers to multiple logical processors within the same core. - MultiCore Processor contains more than one physical core. - MultiProcessor Platform contains multiple physical sockets. - Hardware Multithreading refers to any combination of hardware support to allow multithreading, which could be any combination of SMT, multi-core, and multi-processor. - Processor Topology is the hierarchical relationship of shared vs dedicated hardware resources.
Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CpuidPresent bool
CpuidPresent indicates whether the cpuid instruction is present.
var HardwareThreading bool
HardwareThreading indicates whether hardware multi-threading is supported, can be hyper-threading and/or multiple physical cores within a package.
var HyperThreadingEnabled bool
HyperThreadingEnabled indicates whether the package has hyper-threading enabled.
var HyperThreadingProcsConf uint32
HyperThreadingProcsConf is the number of hyper-threading logical processors configured in the package.
var HyperThreadingProcsPkg uint32
HyperThreadingProcsPkg is the number of hyper-threading logical processors available in the package.
var LogicalProcsConf uint32
LogicalProcsConf is the number of logical processors configured in the package.
var LogicalProcsPkg uint32
LogicalProcsPkg is the maximum number of addressable logical processors in the package, but not necessarily occupied by a logical processors
var LogicalProcsSharingCache uint32
LogicalProcsSharingCache
var MaxProcs uint32
MaxProcs is the maximum number of logical processors supported by the OS. This may include logical processors from packages outside of the one being reported on.
var OnlnProcs uint32
OnlnProcs is the number of logical processors that are on line.
var PackageVersion string = "v0.14.0"
var PhysicalCoresConf uint32
PhysicalCoresConf is the number of physical cores configured in the package.
var PhysicalCoresPkg uint32
PhysicalCoresPkg is the number of physical cores in the package.
var ProcessorFamily string
var ProcessorL2Cache uint32
var ProcessorL2CacheLine uint32
var Processors uint32
Processors is the number of physical processors (that plug in to a socket).
var Vendor string
Vendor is the package vendor's name.
Functions ¶
func ConfProcs ¶
func ConfProcs() uint32
ConfProcs returns the maximum number of logical processors supported by the OS.
func Cpuid ¶
func Cpuid(r *regs, f1, f2 uint32)
Cpuid executes the EAX function f1 and ECX sub function f2, the output registers from the operation returned in r.
func OnlineProcs ¶
func OnlineProcs() uint32
OnlinenProcs returns the number of logical processors that are on line.
Types ¶
This section is empty.