golang compiles to eBPF? including the whole golang runtime with garbage collector? that... surprises me
edit: I don't see anything on the web that would show golang compiles to eBPF. I see bpf2go which is the other way around.
edit: I don't see anything on the web that would show golang compiles to eBPF. I see bpf2go which is the other way around.
Cilium's eBPF library is the Go one I had in mind: https://github.com/cilium/ebpf
Here's an example from that repo: https://github.com/cilium/ebpf/tree/main/examples/ringbuffer
The subset of C you can use is fairly limited, only what their compiler supports. So what people have done is written compilers that can take Go or Python and compile it to BPF bytecode.