profilecreator

package
v0.0.41101 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0 Imports: 19 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

View Source
var (
	// ValidPowerConsumptionModes are a set of valid power consumption modes
	// default => no args
	// low-latency => "nmi_watchdog=0", "audit=0",  "mce=off"
	// ultra-low-latency: low-latency values + "processor.max_cstate=1", "intel_idle.max_cstate=0", "idle=poll"
	// For more information on CPU "C-states" please refer to https://gist.github.com/wmealing/2dd2b543c4d3cff6cab7
	ValidPowerConsumptionModes = []string{"default", "low-latency", "ultra-low-latency"}
)

Functions

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(powerMode string, disableHT bool) []string

GetAdditionalKernelArgs returns a set of kernel parameters based on the power mode

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

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) GetReservedAndIsolatedCPUs

func (ghwHandler GHWHandler) GetReservedAndIsolatedCPUs(reservedCPUCount int, splitReservedCPUsAcrossNUMA bool, disableHTFlag bool) (cpuset.CPUSet, cpuset.CPUSet, error)

GetReservedAndIsolatedCPUs returns Reserved and Isolated CPUs

func (GHWHandler) IsHyperthreadingEnabled

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

IsHyperthreadingEnabled checks if hyperthreading is enabled on the system or not

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