syscache

package
v0.0.0-...-8365721 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SysCPUPath is patch of cpu device
	SysCPUPath = "/sys/devices/system/cpu/"
)

Variables

This section is empty.

Functions

func AvailableCacheLevel

func AvailableCacheLevel() []string

AvailableCacheLevel returns the L2 and L3 level cache, strip L1 cache. By default, get the info from cpu0 path, any issue? The type of return should be string or int?

func GetLLC

func GetLLC() uint32

GetLLC return the last level of the cache on the host

func GetSysCaches

func GetSysCaches(level int) (map[string]SysCache, error)

GetSysCaches traverse all sys cache file for a specify level

Types

type SysCache

type SysCache struct {
	CoherencyLineSize     string
	ID                    string
	Level                 string
	NumberOfSets          string
	PhysicalLinePartition string
	SharedCPUList         string
	SharedCPUMap          string
	Size                  string
	Type                  string
	WaysOfAssociativity   string
}

SysCache is struct of cache of host

Jump to

Keyboard shortcuts

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