replace BCC with golang native ebpf libs? #323
Replies: 4 comments 4 replies
-
I looked at cilium library before, I like the pure go library. There is a more detailed analysis written a couple of years ago (things may have already changed since then) |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
There is a big limitation of using the cilium/ebpf library, it doesn't support reading hardware counters. I opened an issue requesting HC support, but it may take some time. Regarding aquasecurity/libbpfgo., although it can be compiled with static libraries without dependency on kernel libraries, this library requires BTF support from the kernel. Which is only available by default on newer Linux distributions, for example ubuntu 20.10. Otherwise we need to recompile the kernel. However, aquasecurity/libbpfgo. also created a tool called BTFGEN for kernels that don't support BTF. I will try to use it. |
Beta Was this translation helpful? Give feedback.
-
Libbpf support the CO-RE (Compile Once and Run Everywhere), however, this means that we must have an environment with OS that support BTF during the compilation. But to run everywhere, we can use the BTFGEN. Unfortunately, my development env does not support BTF. Of course, we can use a virtual machine for compilation, but the development process will be a little bit harder. I am stopping investigating this now and we can return to it in the future. Btw, the cilium community are discussing the possibility add support to collect HC. |
Beta Was this translation helpful? Give feedback.
-
ref to https://ebpf.io/infrastructure
there golang native ebpf libs as
https://github.com/cilium/ebpf
or
https://github.com/aquasecurity/libbpfgo
do we need to consider that replace bcc by golang native libs for ebpf?
Beta Was this translation helpful? Give feedback.
All reactions