cpu

package module
v0.0.0-...-2705afc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2012 License: BSD-3-Clause Imports: 3 Imported by: 0

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

View Source
var CpuidPresent bool

CpuidPresent indicates whether the cpuid instruction is present.

View Source
var HardwareThreading bool

HardwareThreading indicates whether hardware multi-threading is supported, can be hyper-threading and/or multiple physical cores within a package.

View Source
var HyperThreadingEnabled bool

HyperThreadingEnabled indicates whether the package has hyper-threading enabled.

View Source
var HyperThreadingProcsConf uint32

HyperThreadingProcsConf is the number of hyper-threading logical processors configured in the package.

View Source
var HyperThreadingProcsPkg uint32

HyperThreadingProcsPkg is the number of hyper-threading logical processors available in the package.

View Source
var LogicalProcsConf uint32

LogicalProcsConf is the number of logical processors configured in the package.

View Source
var LogicalProcsPkg uint32

LogicalProcsPkg is the maximum number of addressable logical processors in the package, but not necessarily occupied by a logical processors

View Source
var LogicalProcsSharingCache uint32

LogicalProcsSharingCache

View Source
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.

View Source
var OnlnProcs uint32

OnlnProcs is the number of logical processors that are on line.

View Source
var PackageVersion string = "v0.14.0"
View Source
var PhysicalCoresConf uint32

PhysicalCoresConf is the number of physical cores configured in the package.

View Source
var PhysicalCoresPkg uint32

PhysicalCoresPkg is the number of physical cores in the package.

View Source
var ProcessorFamily string
View Source
var ProcessorL2Cache uint32
View Source
var ProcessorL2CacheLine uint32
View Source
var Processors uint32

Processors is the number of physical processors (that plug in to a socket).

View Source
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.

func Params

func Params()

Params

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL