Documentation
¶
Overview ¶
Package probes provides BPF features checks based on bpftool.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Features ¶
type Features struct {
SystemConfig `json:"system_config"`
MapTypes `json:"map_types"`
Helpers map[string][]string `json:"helpers"`
}
Features contains BPF feature checks returned by bpftool.
type KernelParam ¶
type KernelParam string
KernelParam is a type based on string which represents CONFIG_* kernel parameters which usually have values "y", "n" or "m".
func (KernelParam) Enabled ¶
func (kp KernelParam) Enabled() bool
Enabled checks whether the kernel parameter is enabled.
func (KernelParam) Module ¶
func (kp KernelParam) Module() bool
Module checks whether the kernel parameter is enabled as a module.
type MapTypes ¶
type MapTypes struct {
HaveHashMapType bool `json:"have_hash_map_type"`
HaveArrayMapType bool `json:"have_array_map_type"`
HaveProgArrayMapType bool `json:"have_prog_array_map_type"`
HavePerfEventArrayMapType bool `json:"have_perf_event_array_map_type"`
HavePercpuHashMapType bool `json:"have_percpu_hash_map_type"`
HavePercpuArrayMapType bool `json:"have_percpu_array_map_type"`
HaveStackTraceMapType bool `json:"have_stack_trace_map_type"`
HaveCgroupArrayMapType bool `json:"have_cgroup_array_map_type"`
HaveLruHashMapType bool `json:"have_lru_hash_map_type"`
HaveLruPercpuHashMapType bool `json:"have_lru_percpu_hash_map_type"`
HaveLpmTrieMapType bool `json:"have_lpm_trie_map_type"`
HaveArrayOfMapsMapType bool `json:"have_array_of_maps_map_type"`
HaveHashOfMapsMapType bool `json:"have_hash_of_maps_map_type"`
HaveDevmapMapType bool `json:"have_devmap_map_type"`
HaveSockmapMapType bool `json:"have_sockmap_map_type"`
HaveCpumapMapType bool `json:"have_cpumap_map_type"`
HaveXskmapMapType bool `json:"have_xskmap_map_type"`
HaveSockhashMapType bool `json:"have_sockhash_map_type"`
HaveCgroupStorageMapType bool `json:"have_cgroup_storage_map_type"`
HaveReuseportSockarrayMapType bool `json:"have_reuseport_sockarray_map_type"`
HavePercpuCgroupStorageMapType bool `json:"have_percpu_cgroup_storage_map_type"`
HaveQueueMapType bool `json:"have_queue_map_type"`
HaveStackMapType bool `json:"have_stack_map_type"`
}
MapTypes contains bools indicating which types of BPF maps the currently running kernel supports.
type ProbeManager ¶
type ProbeManager struct {
// contains filtered or unexported fields
}
ProbeManager is a manager of BPF feature checks.
func NewProbeManager ¶
func NewProbeManager() *ProbeManager
NewProbeManager returns a new instance of ProbeManager - a manager of BPF feature checks.
func (*ProbeManager) GetHelpers ¶ added in v1.7.0
func (p *ProbeManager) GetHelpers(prog string) map[string]struct{}
GetHelpers returns information about available BPF helpers for the given program type. If program type is not found, returns nil.
func (*ProbeManager) GetMapTypes ¶ added in v1.7.0
func (p *ProbeManager) GetMapTypes() *MapTypes
GetMapTypes returns information about supported BPF map types.
func (*ProbeManager) SystemConfigProbes ¶
func (p *ProbeManager) SystemConfigProbes() error
SystemConfigProbes performs a check of kernel configuration parameters. It returns an error when parameters required by Cilium are not enabled. It logs warnings when optional parameters are not enabled.
type SystemConfig ¶
type SystemConfig struct {
UnprivilegedBpfDisabled int `json:"unprivileged_bpf_disabled"`
BpfJitEnable int `json:"bpf_jit_enable"`
BpfJitHarden int `json:"bpf_jit_harden"`
BpfJitKallsyms int `json:"bpf_jit_kallsyms"`
BpfJitLimit int `json:"bpf_jit_limit"`
ConfigBpf KernelParam `json:"CONFIG_BPF"`
ConfigBpfSyscall KernelParam `json:"CONFIG_BPF_SYSCALL"`
ConfigHaveEbpfJit KernelParam `json:"CONFIG_HAVE_EBPF_JIT"`
ConfigBpfJit KernelParam `json:"CONFIG_BPF_JIT"`
ConfigBpfJitAlwaysOn KernelParam `json:"CONFIG_BPF_JIT_ALWAYS_ON"`
ConfigCgroups KernelParam `json:"CONFIG_CGROUPS"`
ConfigCgroupBpf KernelParam `json:"CONFIG_CGROUP_BPF"`
ConfigCgroupNetClassID KernelParam `json:"CONFIG_CGROUP_NET_CLASSID"`
ConfigSockCgroupData KernelParam `json:"CONFIG_SOCK_CGROUP_DATA"`
ConfigBpfEvents KernelParam `json:"CONFIG_BPF_EVENTS"`
ConfigKprobeEvents KernelParam `json:"CONFIG_KPROBE_EVENTS"`
ConfigUprobeEvents KernelParam `json:"CONFIG_UPROBE_EVENTS"`
ConfigTracing KernelParam `json:"CONFIG_TRACING"`
ConfigFtraceSyscalls KernelParam `json:"CONFIG_FTRACE_SYSCALLS"`
ConfigFunctionErrorInjection KernelParam `json:"CONFIG_FUNCTION_ERROR_INJECTION"`
ConfigBpfKprobeOverride KernelParam `json:"CONFIG_BPF_KPROBE_OVERRIDE"`
ConfigNet KernelParam `json:"CONFIG_NET"`
ConfigXdpSockets KernelParam `json:"CONFIG_XDP_SOCKETS"`
ConfigLwtunnelBpf KernelParam `json:"CONFIG_LWTUNNEL_BPF"`
ConfigNetActBpf KernelParam `json:"CONFIG_NET_ACT_BPF"`
ConfigNetClsBpf KernelParam `json:"CONFIG_NET_CLS_BPF"`
ConfigNetClsAct KernelParam `json:"CONFIG_NET_CLS_ACT"`
ConfigNetSchIngress KernelParam `json:"CONFIG_NET_SCH_INGRESS"`
ConfigXfrm KernelParam `json:"CONFIG_XFRM"`
ConfigIPRouteClassID KernelParam `json:"CONFIG_IP_ROUTE_CLASSID"`
ConfigIPv6Seg6Bpf KernelParam `json:"CONFIG_IPV6_SEG6_BPF"`
ConfigBpfLircMode2 KernelParam `json:"CONFIG_BPF_LIRC_MODE2"`
ConfigBpfStreamParser KernelParam `json:"CONFIG_BPF_STREAM_PARSER"`
ConfigNetfilterXtMatchBpf KernelParam `json:"CONFIG_NETFILTER_XT_MATCH_BPF"`
ConfigBpfilter KernelParam `json:"CONFIG_BPFILTER"`
ConfigBpfilterUmh KernelParam `json:"CONFIG_BPFILTER_UMH"`
ConfigTestBpf KernelParam `json:"CONFIG_TEST_BPF"`
}
SystemConfig contains kernel configuration and sysctl parameters related to BPF functionality.