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

Method Open

link/iter.go:70–81  ·  view source on GitHub ↗

Open creates a new instance of the iterator. Reading from the returned reader triggers the BPF program.

()

Source from the content-addressed store, hash-verified

68//
69// Reading from the returned reader triggers the BPF program.
70func (it *Iter) Open() (io.ReadCloser, error) {
71 attr := &sys.IterCreateAttr{
72 LinkFd: it.fd.Uint(),
73 }
74
75 fd, err := sys.IterCreate(attr)
76 if err != nil {
77 return nil, fmt.Errorf("can't create iterator: %w", err)
78 }
79
80 return fd.File("bpf_iter")
81}
82
83// union bpf_iter_link_info.map
84type bpfIterLinkInfoMap struct {

Callers 15

TestLibBPFCompatFunction · 0.80
scanFdInfoFunction · 0.80
LoadCollectionSpecFunction · 0.80
loadVersionFunction · 0.80
LoadSpecFunction · 0.80
LoadSplitSpecFunction · 0.80
LoadKernelSpecFunction · 0.80
loadKernelModuleSpecFunction · 0.80
findVMLinuxFunction · 0.80
ModulesMethod · 0.80

Calls 3

IterCreateFunction · 0.92
UintMethod · 0.80
FileMethod · 0.45

Tested by 15

TestLibBPFCompatFunction · 0.64
TestCORERelocationFunction · 0.64
TestCORERelocationLoadFunction · 0.64
TestLD64IMMRelocFunction · 0.64
queryNetNSFixturesFunction · 0.64
TestIterFunction · 0.64
TestIterMapElementsFunction · 0.64
TestUDPIterFunction · 0.64
TestSkLookupFunction · 0.64
ExampleAttachNetNsFunction · 0.64
BenchmarkParseFunction · 0.64