elastic / ebpf

Elastic's eBPF
Other
67 stars 11 forks source link

Add error-check for BTF load call #127

Closed rhysre closed 2 years ago

rhysre commented 2 years ago

Our call to btf__load_vmlinux_btf was not being error checked with libbpf_error(...) and returning a bad pointer on systems with no BTF, which was then used, and caused a segfault.

Also add libEbpfEvents-level logging function that logs to stderr if verbose libbpf logging is turned on. This will make stuff like this much easier to catch in CI.

stanek-michal commented 2 years ago

There's an ebpf_log function in Common.c already, it could clash

rhysre commented 2 years ago

Rebased and fixed naming issue.