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

Function LoadCollectionSpec

elf_reader.go:63–75  ·  view source on GitHub ↗

LoadCollectionSpec parses an ELF file into a CollectionSpec.

(file string)

Source from the content-addressed store, hash-verified

61
62// LoadCollectionSpec parses an ELF file into a CollectionSpec.
63func LoadCollectionSpec(file string) (*CollectionSpec, error) {
64 f, err := os.Open(file)
65 if err != nil {
66 return nil, err
67 }
68 defer f.Close()
69
70 spec, err := LoadCollectionSpecFromReader(f)
71 if err != nil {
72 return nil, fmt.Errorf("file %s: %w", file, err)
73 }
74 return spec, nil
75}
76
77// LoadCollectionSpecFromReader parses an ELF file into a CollectionSpec.
78func LoadCollectionSpecFromReader(rd io.ReaderAt) (*CollectionSpec, error) {

Callers 15

TestCORERelocationReadFunction · 0.92
TestCOREPoisonLineInfoFunction · 0.92
testFreplaceFunction · 0.92
TestFentryFexitFunction · 0.92
convertMethod · 0.92
TestCollectGlobalTypesFunction · 0.92
DocLoadCollectionSpecFunction · 0.92
DocNewCollectionFunction · 0.92
DocLoadAndAssignFunction · 0.92
DocBTFTypeByNameFunction · 0.92
TestProgInfoExtBTFFunction · 0.85

Calls 3

OpenMethod · 0.80
CloseMethod · 0.65

Tested by 15

TestCORERelocationReadFunction · 0.74
TestCOREPoisonLineInfoFunction · 0.74
testFreplaceFunction · 0.74
TestFentryFexitFunction · 0.74
TestCollectGlobalTypesFunction · 0.74
DocLoadCollectionSpecFunction · 0.74
DocNewCollectionFunction · 0.74
DocLoadAndAssignFunction · 0.74
DocBTFTypeByNameFunction · 0.74
TestProgInfoExtBTFFunction · 0.68
TestBatchMapWithLockFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…