ccTopology

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const SYSFS_CPUBASE = `/sys/devices/system/cpu`

Variables

This section is empty.

Functions

func CoreList

func CoreList() []int

CoreList gets the list of CPU core IDs in the order of listing in /proc/cpuinfo

func CpuList

func CpuList() []int

Get list of hardware thread IDs in the order of listing in /proc/cpuinfo Deprecated! Use HwthreadList()

func DieList

func DieList() []int

DieList gets the list of CPU die IDs

func GetCoreHwthreads

func GetCoreHwthreads(core int) []int

GetCoreHwthreads get all hardware thread IDs associated with a CPU core

func GetDieHwthreads

func GetDieHwthreads(die int) []int

GetDieHwthreads gets all hardware thread IDs associated with a CPU die

func GetHwthreadCore

func GetHwthreadCore(cpuID int) int

GetHwthreadCore gets the CPU core ID for a given hardware thread ID In case hardware thread ID is not found -1 is returned

func GetHwthreadDie

func GetHwthreadDie(cpuID int) int

GetHwthreadDie gets the CPU die ID for a given hardware thread ID In case hardware thread ID is not found -1 is returned

func GetHwthreadNumaDomain

func GetHwthreadNumaDomain(cpuID int) int

GetHwthreadNumaDomain gets the NUMA domain ID for a given hardware thread ID In case hardware thread ID is not found -1 is returned

func GetHwthreadSocket

func GetHwthreadSocket(cpuID int) int

GetHwthreadSocket gets the CPU socket ID for a given hardware thread ID In case hardware thread ID is not found -1 is returned

func GetNumaDomainHwthreads

func GetNumaDomainHwthreads(numaDomain int) []int

GetNumaDomainHwthreads gets the all hardware thread IDs associated with a NUMA domain

func GetSocketHwthreads

func GetSocketHwthreads(socket int) []int

GetSocketHwthreads gets all hardware thread IDs associated with a CPU socket

func GetTypeList

func GetTypeList(topology_type string) []int

GetTypeList gets the list of specified type using the naming format inside ClusterCockpit

func HwthreadList

func HwthreadList() []int

HwthreadList gets the list of hardware thread IDs in the order of listing in /proc/cpuinfo

func NumaNodeList

func NumaNodeList() []int

Get list of NUMA node IDs

func SocketList

func SocketList() []int

SocketList gets the list of CPU socket IDs

Types

type CpuInformation

type CpuInformation struct {
	NumHWthreads   int
	SMTWidth       int
	NumSockets     int
	NumDies        int
	NumCores       int
	NumNumaDomains int
}

Structure holding basic information about a CPU

func CpuInfo

func CpuInfo() CpuInformation

CpuInformation reports basic information about the CPU

type HwthreadEntry

type HwthreadEntry struct {
	// for each CPUx:
	CpuID        int   // CPU / hardware thread ID
	SMT          int   // Simultaneous Multithreading ID
	CoreCPUsList []int // CPUs within the same core
	Core         int   // Socket local core ID
	Socket       int   // Sockets (physical) ID
	Die          int   // Die ID
	NumaDomain   int   // NUMA Domain
}

Structure holding all information about a hardware thread See https://www.kernel.org/doc/Documentation/ABI/stable/sysfs-devices-system-cpu

func CpuData

func CpuData() []HwthreadEntry

CpuData returns CPU data for each hardware thread

Jump to

Keyboard shortcuts

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