Documentation ¶
Overview ¶
Package proc implements process manipulation through syscalls.
Index ¶
- func Affinity(pid int) ([]int, error)
- func AffinitySelf() ([]int, error)
- func Exec(args []string) error
- func SetCPUSet(pid int, name string) error
- func SetCPUSetSelf(name string) error
- func SetPriority(pid, priority int) error
- func SetScheduler(pid int, policy Policy, param *SchedParam) error
- type Policy
- type SchedParam
- type Stat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exec ¶
Exec executes the given command using the execve(2) system call, inheriting environment.
func SetCPUSetSelf ¶
SetCPUSetSelf moves this thread to the named cpuset.
func SetPriority ¶
SetPriority sets the priority of process with the given pid, where 0 is the calling process.
func SetScheduler ¶
func SetScheduler(pid int, policy Policy, param *SchedParam) error
SetScheduler sets the linux scheduling policy for process pid, where 0 is the calling process.
Types ¶
type Policy ¶
type Policy int
Policy is a linux scheduling policy.
const ( SCHED_OTHER Policy = 0 SCHED_FIFO Policy = 1 SCHED_RR Policy = 2 SCHED_BATCH Policy = 3 SCHED_IDLE Policy = 5 SCHED_DEADLINE Policy = 6 )
Linux scheduling policies.
/* * Scheduling policies */ #define SCHED_NORMAL 0 #define SCHED_FIFO 1 #define SCHED_RR 2 #define SCHED_BATCH 3 /* SCHED_ISO: reserved but not implemented yet */ #define SCHED_IDLE 5 #define SCHED_DEADLINE 6
- SCHED_NORMAL (traditionally called SCHED_OTHER): The scheduling policy that is used for regular tasks.
type SchedParam ¶
type SchedParam struct {
Priority int
}
SchedParam is the linux sched_param struct.
struct sched_param { int sched_priority; };
type Stat ¶
type Stat struct{}
Stat is a config provider based on the `/proc/*/stat` file.
func (Stat) Configuration ¶
func (Stat) Configuration() (cfg.Configuration, error)
Configuration reports performance-critical parameters from the /proc/self/stat file.
Click to show internal directories.
Click to hide internal directories.