ps

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

README

ps

ps displays data about all running processes in the current mount namespace.

Build
  1. to build run make .
  2. to install it run make install.
Listing Processes:
./ps | head -n5

USER     PID    PPID   CPU     ELAPSED          TTY    TIME   COMMAND
root     7      1      0.000   29m26.0628125s   tty1   0s     /init
root     7      1      0.000   29m26.0640173s   tty1   0s     /init
abdfnx   8      7      0.000   29m26.0640615s   tty1   0s     -bash
abdfnx   317    8      0.290   28m44.0652407s   tty1   5s     zsh
Display Different Format Descriptors:
./ps -format "pid, user, group, tty" | head -n5

PID    USER     GROUP    TTY
1      root     root     tty1
7      root     root     tty1
8      abdfnx   abdfnx   tty1
317    abdfnx   abdfnx   tty1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultDescriptors is the `ps -ef` compatible default format.
	DefaultDescriptors = []string{"user", "pid", "ppid", "pcpu", "etime", "tty", "time", "args"}

	// ErrUnknownDescriptor is returned when an unknown descriptor is parsed.
	ErrUnknownDescriptor = errors.New("unknown descriptor")
)

Functions

func JoinNamespaceAndProcessInfo

func JoinNamespaceAndProcessInfo(pid string, descriptors []string) ([][]string, error)

func JoinNamespaceAndProcessInfoByPids

func JoinNamespaceAndProcessInfoByPids(pids []string, descriptors []string) ([][]string, error)

func JoinNamespaceAndProcessInfoByPidsWithOptions

func JoinNamespaceAndProcessInfoByPidsWithOptions(pids []string, descriptors []string, options *JoinNamespaceOpts) ([][]string, error)

func JoinNamespaceAndProcessInfoWithOptions

func JoinNamespaceAndProcessInfoWithOptions(pid string, descriptors []string, options *JoinNamespaceOpts) ([][]string, error)

func ListDescriptors

func ListDescriptors() (list []string)

func ProcessInfo

func ProcessInfo(descriptors []string) ([][]string, error)

func ProcessInfoByPids

func ProcessInfoByPids(pids []string, descriptors []string) ([][]string, error)

Types

type IDMap

type IDMap struct {
	ContainerID int
	HostID      int
	Size        int
}

type JoinNamespaceOpts

type JoinNamespaceOpts struct {
	UIDMap       []IDMap
	GIDMap       []IDMap
	FillMappings bool
}

Directories

Path Synopsis
internal
cap
dev

Jump to

Keyboard shortcuts

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