Documentation ¶
Overview ¶
SPDX-License-Identifier: Apache-2.0 Copyright Authors of Tetragon
Index ¶
- Variables
- func GetProgramInfo(l *Program) (program, label, prog string)
- func LoadKprobeProgram(bpfDir, mapDir string, load *Program, verbose int) error
- func LoadMultiKprobeProgram(bpfDir, mapDir string, load *Program, verbose int) error
- func LoadOrCreatePinnedMap(pinPath string, mapSpec *ebpf.MapSpec) (*ebpf.Map, error)
- func LoadProgram(bpfDir string, mapDirs []string, load *Program, withProgram AttachFunc, ...) error
- func LoadRawTracepointProgram(bpfDir, mapDir string, load *Program, verbose int) error
- func LoadTailCallProgram(bpfDir, mapDir string, load *Program, verbose int) error
- func LoadTracepointProgram(bpfDir, mapDir string, load *Program, verbose int) error
- type AttachFunc
- type LoadedCollection
- type LoadedMap
- type LoadedProgram
- type Map
- func (m *Map) Close() error
- func (m *Map) GetFD() (int, error)
- func (m *Map) IsCompatibleWith(spec *ebpf.MapSpec) error
- func (m *Map) LoadOrCreatePinnedMap(pinPath string, mapSpec *ebpf.MapSpec) error
- func (m *Map) LoadPinnedMap(path string) error
- func (m *Map) New(spec *ebpf.MapSpec) error
- func (m *Map) Pin(path string) error
- func (m *Map) Unload() error
- type MapLoad
- type Program
- type State
Constants ¶
This section is empty.
Variables ¶
View Source
var (
KeepCollection bool
)
Functions ¶
func GetProgramInfo ¶
func LoadKprobeProgram ¶
func LoadMultiKprobeProgram ¶
func LoadOrCreatePinnedMap ¶ added in v0.8.20
func LoadProgram ¶
func LoadTailCallProgram ¶
Types ¶
type AttachFunc ¶
AttachFunc is the type for the various attachment functions. The function is given the program and it's up to it to close it.
func KprobeAttach ¶
func KprobeAttach(load *Program) AttachFunc
func MultiKprobeAttach ¶
func MultiKprobeAttach(load *Program) AttachFunc
func NoAttach ¶
func NoAttach(load *Program) AttachFunc
func RawAttach ¶
func RawAttach(targetFD int) AttachFunc
func RawTracepointAttach ¶
func RawTracepointAttach(load *Program) AttachFunc
func TracepointAttach ¶
func TracepointAttach(load *Program) AttachFunc
type LoadedCollection ¶
type LoadedCollection struct { Programs map[string]*LoadedProgram Maps map[string]*LoadedMap }
type LoadedProgram ¶
type Map ¶
Map represents BPF maps.
func MapBuilder ¶
func MapBuilderPin ¶
func (*Map) LoadOrCreatePinnedMap ¶ added in v0.8.20
func (*Map) LoadPinnedMap ¶
type Program ¶
type Program struct { // Name is the name of the BPF object file. Name string // Attach is the attachment point, e.g. the kernel function. Attach string // Label is the program section name to load from program. Label string // PinPath is the pinned path to this program. Note this is a relative path // based on the BPF directory FGS is running under. PinPath string // RetProbe indicates whether a kprobe is a kretprobe. RetProbe bool // ErrorFatal indicates whether a program must load and fatal otherwise. // Most program will set this to true. For example, kernel functions hooks // may change across verions so different names are attempted, hence // avoiding fataling when the first attempt fails. ErrorFatal bool // Needs override bpf program Override bool // Type is the type of BPF program. For example, tc, skb, tracepoint, // etc. Type string LoadState State // LoaderData represents per-type specific fields. LoaderData interface{} MapLoad []*MapLoad PinMap map[string]string // available when program.KeepCollection is true LC *LoadedCollection MultiSymbols []string MultiCookies []uint64 // contains filtered or unexported fields }
Program reprents a BPF program.
func (*Program) SetLoaderData ¶
func (*Program) SetRetProbe ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
State represents the state of a BPF program or map.
NB: Currently there is no case where we attempt to load a program that is already loaded. If this changes, we can use the count as a reference count to track users of a bpf program.
Click to show internal directories.
Click to hide internal directories.