profilecreator

package
v0.0.0-...-d24467f Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnableHardwareTuning  = "enableHardwareTuning"
	HardwareTuningMessage = `` /* 364-byte string literal not displayed */

	DifferentCoreIDs        = "differentCoreIDs"
	DifferentCoreIDsMessage = `` /* 660-byte string literal not displayed */

)
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, tolerations TolerationSet) error

EnsureNodesHaveTheSameHardware returns an error if all the input nodes do not have the same hardware configuration and updates the toleration set to consider as warnings/comments when publishing the generated profile

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 IsExternalControlPlaneCluster

func IsExternalControlPlaneCluster(mustGatherDirPath string) (bool, error)

IsExternalControlPlaneCluster return whether the control plane is running on externally outside the cluster

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

type TolerationSet

type TolerationSet map[string]bool

TolerationSet records the data to be tolerated or warned about based on the tool handling

Jump to

Keyboard shortcuts

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