Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

How does it compare to github.com/iovisor/gobpf #54

Closed
tamalsaha opened this issue Jul 14, 2018 · 4 comments
Closed

How does it compare to github.com/iovisor/gobpf #54

tamalsaha opened this issue Jul 14, 2018 · 4 comments

Comments

@tamalsaha
Copy link

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.

@lmb
Copy link
Collaborator

lmb commented Jul 15, 2018 via email

@tamalsaha
Copy link
Author

tamalsaha commented Jul 15, 2018

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?

@lmb
Copy link
Collaborator

lmb commented Jul 15, 2018

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.

@nathanjsweet
Copy link
Member

@tamalsaha I'm going to close this. Feel free to keep asking questions, of course.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants