(module string, base *Spec)
| 85 | } |
| 86 | |
| 87 | func loadKernelModuleSpec(module string, base *Spec) (*Spec, error) { |
| 88 | if platform.IsWindows { |
| 89 | return nil, internal.ErrNotSupportedOnOS |
| 90 | } |
| 91 | |
| 92 | dir, file := filepath.Split(module) |
| 93 | if dir != "" || filepath.Ext(file) != "" { |
| 94 | return nil, fmt.Errorf("invalid module name %q", module) |
| 95 | } |
| 96 | |
| 97 | fh, err := os.Open(filepath.Join("/sys/kernel/btf", module)) |
| 98 | if err != nil { |
| 99 | return nil, err |
| 100 | } |
| 101 | defer fh.Close() |
| 102 | |
| 103 | return LoadSplitSpecFromReader(fh, base) |
| 104 | } |
| 105 | |
| 106 | // findVMLinux scans multiple well-known paths for vmlinux kernel images. |
| 107 | func findVMLinux() (*os.File, error) { |
no test coverage detected
searching dependent graphs…