3 ms·
> Is my understanding correct, that this is a GCC port that can target eBPF? Yes. Though before a LLVM based eBPF target was available, so this adds the option
by jabl 7y ago
> Is my understanding correct, that this is a GCC port that can target eBPF?
Yes. Though before a LLVM based eBPF target was available, so this adds the option to use GCC instead. So in principle you could use GFortran to write kernel code; ... profit!
> If so, is there any particular purpose in that, beyond making eBPF an easier place for people to write userspace software that would otherwise be kernel modules?
eBPF is an in-kernel virtual machine, with JIT for popular architectures like x86-64 (maybe arm64 and ppc64le too, not sure?). So you use GCC (or LLVM) to compile code into an eBPF compatible object format, load it into the kernel (with a special syscall IIRC, or maybe it was something netlink-based?), then an in-kernel verifier checks that it doesn't do anything that isn't allowed before it's enabled.
So what can you do with it. Quite a lot, it seems (disclaimer I haven't used it personally). The big use cases at the moment seem to be
- network filtering
- seccomp filtering (that is, check syscall arguments)
- tracing (see bcc/bpftrace) for performance analysis
- simcop2387 7y ago> - seccomp filtering (that is, check syscall arguments) Small correction there, seccomp still uses BPF not eBPF. That leaves a lot of restrictions on what it can do and I believe the bytecode is incompatible too.