process

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

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

Go to latest
Published: Aug 21, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

Instance represents a process instance.

func New

func New(discoveryMode bool, pinMode, procNameFilterRegularExpression, procDirectory string) (*Instance, error)

New returns a new process instance.

func (*Instance) GetProcDirectory

func (i *Instance) GetProcDirectory() string

GetProcDirectory is a getter for procDirectory.

func (*Instance) Pin

func (i *Instance) Pin(pid int) error

Pin pins a process with pid. It retrieves the process name and CPUs allowed list from /proc/<pid>/status. Then, it checks if the process name matches the process name filter regex. If discovery mode is configured, only print values. Otherwise, pin the process.

func (*Instance) PinAll

func (i *Instance) PinAll() error

PinAll scans directory /proc or /host/proc for processes that match procNameFilterRegex. Matching processes are pinned to pinMode, or their details are printed if in discovery mode.

Jump to

Keyboard shortcuts

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