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

Function LoadKernelModuleSpec

btf/kernel.go:79–85  ·  view source on GitHub ↗

LoadKernelModuleSpec returns the BTF information for the named kernel module. Using [Cache.Module] is faster when loading BTF for more than one module. Defaults to /sys/kernel/btf/ . Returns an error wrapping ErrNotSupported if BTF is not enabled. Returns an error wrapping fs.ErrNotExist if

(module string)

Source from the content-addressed store, hash-verified

77// Returns an error wrapping ErrNotSupported if BTF is not enabled.
78// Returns an error wrapping fs.ErrNotExist if BTF for the specific module doesn't exist.
79func LoadKernelModuleSpec(module string) (*Spec, error) {
80 base, err := LoadKernelSpec()
81 if err != nil {
82 return nil, err
83 }
84 return loadKernelModuleSpec(module, base)
85}
86
87func loadKernelModuleSpec(module string, base *Spec) (*Spec, error) {
88 if platform.IsWindows {

Callers 2

TestLoadKernelModuleSpecFunction · 0.85

Calls 2

LoadKernelSpecFunction · 0.85
loadKernelModuleSpecFunction · 0.85

Tested by 2

TestLoadKernelModuleSpecFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…