proc

package
v0.0.0-...-103c7d6 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindProcessByCmdline

func FindProcessByCmdline(cmdline string) ([]*os.Process, error)

FindProcessByCmdline finds the processes with matching cmdline

func FindProcessByName

func FindProcessByName(name string) (*os.Process, error)

FindProcessByName finds a process by name and returns the process

func GetHostNamespaceDirectory

func GetHostNamespaceDirectory(hostProcDir string) string

GetHostNamespaceDirectory returns the namespace directory for the host namespace.

func GetHostNamespacePID

func GetHostNamespacePID(hostProcDir string) uint64

GetHostNamespacePID returns the PID of the host namespace.

func GetNamespaceDirectory

func GetNamespaceDirectory(procDir, pid string) string

GetNamespaceDirectory returns the namespace directory for the given PID.

func GetProcessAncestorNamespaceDirectory

func GetProcessAncestorNamespaceDirectory(process, procDir string) (string, error)

GetProcessAncestorNamespaceDirectory returns the namespace directory for the ancestor of the given process.

func GetProcessNamespaceDirectory

func GetProcessNamespaceDirectory(processName, procDir string) (string, error)

GetProcessNamespaceDirectory returns the namespace directory for the given process. If processName is ProcessNone, it returns the host namespace directory.

func GetProcessPIDs

func GetProcessPIDs(processName, procDir string) ([]uint64, error)

GetProcessPIDs returns the PIDs for the given process name.

Types

type ProcessFinder

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

ProcessFinder is a struct to find process information.

func NewProcFinder

func NewProcFinder(procDir string) *ProcessFinder

func (*ProcessFinder) FindAncestorByName

func (p *ProcessFinder) FindAncestorByName(ancestorProcess, pid string) (*linux.ProcessStatus, error)

FindAncestorByName returns the ancestor process status for the given process.

func (*ProcessFinder) GetProcessStatus

func (p *ProcessFinder) GetProcessStatus(proc string) (*linux.ProcessStatus, error)

GetProcessStatus returns the process status for the given process.

Jump to

Keyboard shortcuts

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