()
| 58 | var HasEnableBTF bool = false |
| 59 | |
| 60 | func CheckKernelConfig() error { |
| 61 | |
| 62 | KernelConfig, e := GetSystemConfig() |
| 63 | if e != nil { |
| 64 | return fmt.Errorf("Kernel config read failed, error:%v", e) |
| 65 | } |
| 66 | |
| 67 | for _, item := range configCheckItems { |
| 68 | bc, found := KernelConfig[item] |
| 69 | if !found { |
| 70 | HasEnableBPF = false |
| 71 | return fmt.Errorf("Config not found, item:%s.", item) |
| 72 | } |
| 73 | if bc != "y" { |
| 74 | HasEnableBPF = false |
| 75 | return fmt.Errorf("Config disabled, item :%s.", item) |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | bc, found := KernelConfig[CONFIG_DEBUG_INFO_BTF] |
| 80 | if found && bc == "y" { |
| 81 | HasEnableBTF = true |
| 82 | } |
| 83 | return nil |
| 84 | } |
no test coverage detected