exitsnoop

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureRunning

func EnsureRunning(bpffsRoot string) error

EnsureRunning makes sure that the exitsnoop has been pinned in BPF filesystem.

Types

type ExitStatus

type ExitStatus struct {
	Pid           uint32
	ExitCode      int32
	StartBoottime uint64
	ExittedTime   uint64
}

ExitStatus is used to record the exit event when the target task exits.

type PidnsInfo

type PidnsInfo struct {
	Dev uint64
	Ino uint64
}

type Store

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

Store is used to trace target task and receive the exited event by trace ID.

func NewStore

func NewStore(bpffsRoot string) (*Store, error)

func NewStoreFromAttach

func NewStoreFromAttach() (_ *Store, retErr error)

NewStoreFromAttach loads exitsnoop and attaches to sched_process_exit and returns the Store as interface.

TODO(fuweid):

NewStoreFromAttach only opens but not pinned in bpffs, which has common functionality with EnsureRunning. I think we should use options to merge two function in the future.

func (*Store) Close

func (store *Store) Close() error

func (*Store) DeleteExitedEvent

func (store *Store) DeleteExitedEvent(traceEventID uint64) error

func (*Store) DeleteTracingTask

func (store *Store) DeleteTracingTask(pid uint32) error

func (*Store) ExitedEventFromWaitStatus

func (store *Store) ExitedEventFromWaitStatus(traceEventID uint64, pid uint32, status uint32) error

func (*Store) GetExitedEvent

func (store *Store) GetExitedEvent(traceEventID uint64) (*ExitStatus, error)

func (*Store) GetTracingTask

func (store *Store) GetTracingTask(pid uint32) (*TaskInfo, error)

func (*Store) Trace

func (store *Store) Trace(pid uint32, taskInfo *TaskInfo) error

type TaskInfo

type TaskInfo struct {
	// TraceID is allocated by userspace to identity the pid of task.
	TraceID uint64
	// PidnsInfo is used to check the pid namespace.
	PidnsInfo PidnsInfo
}

TaskInfo is used to trace the target task.

Jump to

Keyboard shortcuts

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