How does it compare to github.com/iovisor/gobpf
tamalsaha opened this issue · 4 comments
Hi,
I am trying to learn about eBPF and interested in writing BPF code in C and then call from my Go library. I am 2 weeks into my exploration into this. So, pardon my ignorance. How does it compare to https://github.com/iovisor/gobpf ?
Thanks.
Thanks for the detailed answer. It is starting to make sense. I agree that shipping LLVM with prod application is not preferred. Instead precompile and bundle the generated ELF files. I also found https://github.com/andrewkroh/go-ebpf project which takes a similar view but uses gobpf to load ELF files.
One thing is not clear to me if the cBPF reference (especially the maps macros) https://github.com/iovisor/bcc/blob/master/docs/reference_guide.md#maps is purely reference to kernel ABI or some custom helpers bcc project has written. The latter seems to be the case. Am I right?
Yes, the map macros are a BCC specific thing. The actual ABI is documented in the kernel. It's not too different from BCC though. You'll need some header files to get started, I recommend you have a look at the ones from the cilium project.
@tamalsaha I'm going to close this. Feel free to keep asking questions, of course.