profilecreator

package
v0.0.0-...-5a9355e Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ClusterScopedResources defines the subpath, relative to the top-level must-gather directory.
	// A top-level must-gather directory is of the following format:
	// must-gather-dir/quay-io-openshift-kni-performance-addon-operator-must-gather-sha256-<Image SHA>
	// Here we find the cluster-scoped definitions saved by must-gather
	ClusterScopedResources = "cluster-scoped-resources"
	// CoreNodes defines the subpath, relative to ClusterScopedResources, on which we find node-specific data
	CoreNodes = "core/nodes"
	// MCPools defines the subpath, relative to ClusterScopedResources, on which we find the machine config pool definitions
	MCPools = "machineconfiguration.openshift.io/machineconfigpools"
	// YAMLSuffix is the extension of the yaml files saved by must-gather
	YAMLSuffix = ".yaml"
	// Nodes defines the subpath, relative to top-level must-gather directory, on which we find node-specific data
	Nodes = "nodes"
	// SysInfoFileName defines the name of the file where ghw snapshot is stored
	SysInfoFileName = "sysinfo.tgz"
)

Variables

This section is empty.

Functions

func AreAllLogicalProcessorsFromSocketUnused

func AreAllLogicalProcessorsFromSocketUnused(extCpuInfo *extendedCPUInfo, socketId int) bool

func CalculateCPUSets

func CalculateCPUSets(systemInfo *systemInfo, reservedCPUCount int, offlinedCPUCount int, splitReservedCPUsAcrossNUMA bool, disableHTFlag bool, highPowerConsumptionMode bool) (cpuset.CPUSet, cpuset.CPUSet, cpuset.CPUSet, error)

Calculates the resevered, isolated and offlined cpuSets.

func EnsureNodesHaveTheSameHardware

func EnsureNodesHaveTheSameHardware(nodeHandlers []*GHWHandler) error

EnsureNodesHaveTheSameHardware returns an error if all the input nodes do not have the same hardware configuration

func GetAdditionalKernelArgs

func GetAdditionalKernelArgs(disableHT bool) []string

GetAdditionalKernelArgs returns a set of kernel parameters based on configuration

func GetMCP

func GetMCP(mustGatherDirPath, mcpName string) (*machineconfigv1.MachineConfigPool, error)

GetMCP returns an MCP object corresponding to a specified MCP Name

func GetMCPList

func GetMCPList(mustGatherDirPath string) ([]*machineconfigv1.MachineConfigPool, error)

GetMCPList returns the list of MCPs using the mcp YAMLs stored in Must Gather

func GetMCPSelector

func GetMCPSelector(pool *mcfgv1.MachineConfigPool, clusterPools []*mcfgv1.MachineConfigPool) (map[string]string, error)

GetMCPSelector returns a label that is unique to the target pool, error otherwise

func GetNodeList

func GetNodeList(mustGatherDirPath string) ([]*v1.Node, error)

GetNodeList returns the list of nodes using the Node YAMLs stored in Must Gather

func GetNodesForPool

func GetNodesForPool(pool *mcfgv1.MachineConfigPool, clusterPools []*mcfgv1.MachineConfigPool, clusterNodes []*corev1.Node) ([]*corev1.Node, error)

GetNodesForPool returns the nodes belonging to the input mcp Adapted (including dependencies) from: https://github.com/openshift/machine-config-operator/blob/e4aa3bc5a405c67fb112b24e24b2c372457b3358/pkg/controller/node/node_controller.go#L745

func IsLogicalProcessorUsed

func IsLogicalProcessorUsed(extCPUInfo *extendedCPUInfo, logicalProcessor int) bool

Types

type GHWHandler

type GHWHandler struct {
	Node *v1.Node
	// contains filtered or unexported fields
}

GHWHandler is a wrapper around ghw to get the API object

func NewGHWHandler

func NewGHWHandler(mustGatherDirPath string, node *v1.Node) (*GHWHandler, error)

NewGHWHandler is a handler to use ghw options corresponding to a node

func (GHWHandler) CPU

func (ghwHandler GHWHandler) CPU() (*cpu.Info, error)

CPU returns a CPUInfo struct that contains information about the CPUs on the host system

func (GHWHandler) GatherSystemInfo

func (ghwHandler GHWHandler) GatherSystemInfo() (*systemInfo, error)

func (GHWHandler) IsHyperthreadingEnabled

func (ghwHandler GHWHandler) IsHyperthreadingEnabled() (bool, error)

IsHyperthreadingEnabled checks if hyperthreading is enabled on the system or not

func (GHWHandler) SortedCPU

func (ghwHandler GHWHandler) SortedCPU() (*cpu.Info, error)

func (GHWHandler) SortedTopology

func (ghwHandler GHWHandler) SortedTopology() (*topology.Info, error)

SortedTopology returns a TopologyInfo struct that contains information about the Topology sorted by numa ids and cpu ids on the host system

Jump to

Keyboard shortcuts

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