Documentation ¶
Index ¶
- Constants
- Variables
- func DiscoverChildProcesses(pid int) ([]int, error)
- func ExecCmdBgWithSudoAndCtx(ctx context.Context, command string) (int, chan error)
- func ExecPinnedCmdWithTimeout(command string, timeout time.Duration) (int, error)
- func IsSudoCmdAvailableForThisUser() bool
- func ParseCmd(fullCmd string) (string, []string, error)
- func PinProccessToCPU(id ...int)
- func SudoKillProcess(pid int, force bool) error
- type RunningTracee
- type TraceeStatus
Constants ¶
const ( SIGTERM = "-15" SIGKILL = "-9" )
const CPUForTests = 0 // CPU to pin test processes to
Variables ¶
var ( TraceeBinary = "../../dist/tracee" TraceeHostname = "localhost" TraceePort = 3366 )
Functions ¶
func DiscoverChildProcesses ¶
DiscoverChildProcesses discovers all child processes of a given PID.
func ExecCmdBgWithSudoAndCtx ¶
ExecCmdBgWithSudoAndCtx executes a command with sudo in the background, and returns the PID of the process and a channel to wait for the command to exit (Check RunningTracee object about how to use this).
func ExecPinnedCmdWithTimeout ¶
ExecPinnedCmdWithTimeout executes a cmd with a timeout and returns the PID of the process.
func IsSudoCmdAvailableForThisUser ¶
func IsSudoCmdAvailableForThisUser() bool
IsSudoCmdAvailableForThisUser checks if the sudo command is available for the current user.
func PinProccessToCPU ¶
func PinProccessToCPU(id ...int)
PinProccessToCPU pins the current process to a specific CPU
func SudoKillProcess ¶
SudoKillProcess kills a process with sudo.
Types ¶
type RunningTracee ¶
type RunningTracee struct {
// contains filtered or unexported fields
}
RunningTracee is a wrapper for a running tracee process as a regular process.
func NewRunningTracee ¶
func NewRunningTracee(givenCtx context.Context, cmdLine string) *RunningTracee
NewRunningTracee creates a new RunningTracee instance.
func (*RunningTracee) IsReady ¶
func (r *RunningTracee) IsReady() bool
IsReady checks if the tracee process is ready.
func (*RunningTracee) Start ¶
func (r *RunningTracee) Start() (<-chan TraceeStatus, error)
Start starts the tracee process.
type TraceeStatus ¶
type TraceeStatus int
const ( TraceeStarted TraceeStatus = iota TraceeFailed TraceeTimedout TraceeAlreadyRunning )