MCPcopy
hub / github.com/cilium/ebpf / Link

Interface Link

link/link.go:21–56  ·  view source on GitHub ↗

Link represents a Program attached to a BPF hook.

Source from the content-addressed store, hash-verified

19
20// Link represents a Program attached to a BPF hook.
21type Link interface {
22 // Replace the current program with a new program.
23 //
24 // Passing a nil program is an error. May return an error wrapping ErrNotSupported.
25 Update(*ebpf.Program) error
26
27 // Persist a link by pinning it into a bpffs.
28 //
29 // May return an error wrapping ErrNotSupported.
30 Pin(string) error
31
32 // Undo a previous call to Pin.
33 //
34 // May return an error wrapping ErrNotSupported.
35 Unpin() error
36
37 // Close frees resources.
38 //
39 // The link will be broken unless it has been successfully pinned.
40 // A link may continue past the lifetime of the process if Close is
41 // not called.
42 Close() error
43
44 // Detach the link from its corresponding attachment point.
45 //
46 // May return an error wrapping ErrNotSupported.
47 Detach() error
48
49 // Info returns metadata on a link.
50 //
51 // May return an error wrapping ErrNotSupported.
52 Info() (*Info, error)
53
54 // Prevent external users from implementing this interface.
55 isLink()
56}
57
58// NewFromFD creates a link from a raw fd.
59//

Callers 38

TestMapBatchUnprivilegedFunction · 0.65
TestMapWithLockFunction · 0.65
TestExistFunction · 0.65
BenchmarkMapFunction · 0.65
TestUprobeProgramCallFunction · 0.65
TestKprobeProgramCallFunction · 0.65
newMapWithOptionsFunction · 0.65
TestMapPinFunction · 0.65
TestNestedMapPinFunction · 0.65
TestMapPinMultipleFunction · 0.65

Implementers 3

RawLinklink/link.go
progAttachCgrouplink/cgroup.go
simpleRawTracepointlink/raw_tracepoint.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…