Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NamespaceKind ¶
type NamespaceKind int
NamespaceKind is the type of Linux namespaces.
const ( // NetworkNS is the network namespace. NetworkNS NamespaceKind = iota // IPCNS is the SysV IPC namespace. IPCNS // UTSNS is the UTS namespace. UTSNS // MountNS is the mount namespace. MountNS // PIDNS is the PID namespace. PIDNS // UserNS is the user namespace. UserNS // CgroupNS is the cgroup namespace. CgroupNS )
type Observer ¶
type Observer struct {
// contains filtered or unexported fields
}
Observer is the object that will observe the system. An observer is first configured to listen to various events such as tracepoints or kprobes being hit. Then events can be read from the observer when they occur.
func (*Observer) AddTracepoint ¶
func (o *Observer) AddTracepoint(name string) EventSource
AddTracepoint adds a tracepoint to watch for.
func (*Observer) Close ¶
func (o *Observer) Close()
Close frees precious resources acquired during Open.
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
Process provides mechanisms to retrieve information about a process.
type TracepointEvent ¶
type TracepointEvent struct {
// contains filtered or unexported fields
}
TracepointEvent is fired when a Tracepoint is hit.
func (*TracepointEvent) Data ¶
func (e *TracepointEvent) Data() []byte
Data returns the tracepoint raw data.
func (*TracepointEvent) GetInt ¶
func (e *TracepointEvent) GetInt(name string) int
GetInt retrieves an integer corresponding to the field named 'name' from the tracepoint data. If 'name' isn't a valid field name, GetInt returns -1.
One can consult the list of per-event fields in its format file:
# cat /sys/kernel/debug/tracing/events/sched/sched_process_exec/format name: sched_process_exec ID: 266 format: field:unsigned short common_type; offset:0; size:2; signed:0; field:unsigned char common_flags; offset:2; size:1; signed:0; field:unsigned char common_preempt_count; offset:3; size:1; signed:0; field:int common_pid; offset:4; size:4; signed:1; field:__data_loc char[] filename; offset:8; size:4; signed:1; field:pid_t pid; offset:12; size:4; signed:1; field:pid_t old_pid; offset:16; size:4; signed:1;
func (TracepointEvent) GetSource ¶
func (e TracepointEvent) GetSource() EventSource
GetSource returns the source ID of the object that has emitted e.
func (*TracepointEvent) GetString ¶
func (e *TracepointEvent) GetString(name string) string
GetString retrieves an integer corresponding to the field named 'name' from the tracepoint data. If 'name' isn't a valid field name, GetString returns "".