MCPcopy Create free account
hub / github.com/SeeFlowerX/stackplz / CheckKernelConfig

Function CheckKernelConfig

user/util/bpf.go:60–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58var HasEnableBTF bool = false
59
60func 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}

Callers 1

persistentPreRunEFuncFunction · 0.92

Calls 1

GetSystemConfigFunction · 0.85

Tested by

no test coverage detected