irqbalance

package
v0.0.0-...-db53517 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MulanPSL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LineSeparator = "\n"
)

Variables

This section is empty.

Functions

func GetCpu

func GetCpu(data string) (int64, error)

func GetIrqs

func GetIrqs(data string, device string, cpus []int64) ([]string, error)

func RemoveEmptyElm

func RemoveEmptyElm(arr []string) []string

RemoveEmptyElm 数组去除空白元素

func SlicePop

func SlicePop(dwarfs []int64) (int64, []int64, error)

func SyncExecute

func SyncExecute(name string) (string, error)

Types

type CmdStatus

type CmdStatus struct {
	Cmd      string  `json:"cmd"`
	PID      int     `json:"pid"`
	Complete bool    `json:"complete"`                   // false if stopped or signaled
	Exit     int     `json:"exit"`                       // exit code of process
	Error    error   `json:"error" swaggertype:"string"` // Go error
	StartTs  int64   `json:"startTs"`                    // Unix ts (nanoseconds), zero if Cmd not started
	StopTs   int64   `json:"stopTs"`                     // Unix ts (nanoseconds), zero if Cmd not started or running
	Runtime  float64 `json:"runtime"`                    // seconds, zero if Cmd not started
	Stderr   string  `json:"stderr"`
	Stdout   string  `json:"stdout"`
}

type ExecConfig

type ExecConfig struct {
	Devices []string `json:"devices"`
	CpuNum  int64    `json:"cpu_num"`
}

func NewExecConfig

func NewExecConfig(configPath string) (*ExecConfig, error)

func (*ExecConfig) BalanceDeviceIrq

func (execConfig *ExecConfig) BalanceDeviceIrq(device string) error

func (*ExecConfig) CheckDeviceIrqBalance

func (execConfig *ExecConfig) CheckDeviceIrqBalance(device string) (bool, error)

func (*ExecConfig) ReadConfig

func (execConfig *ExecConfig) ReadConfig(configFilePath string) error

func (*ExecConfig) Run

func (execConfig *ExecConfig) Run()

func (*ExecConfig) SetCpuNum

func (execConfig *ExecConfig) SetCpuNum() error

Jump to

Keyboard shortcuts

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