by knorker · 2y ago · 0 comments
You may not use it much, but some people use it all day. I think FAANG engineers have said that they run tens (hundreds?) of these things on all servers, all the time. And that's excluding one-offs. And FAANG has full time kernel coders on staff, so they're also funding this complexity that they use.
But also yes, I've solved problems by using eBPF. Problems that are basically unsolvable by non-kernel-gurus without eBPF. I rarely need it. But when I need it, there's nothing else that does the trick.
In some cases, even for kernel gurus, it's a choice between eBPF or maintaining a custom kernel patch forever.
To add on this point: I successfully used SystemTap a few years ago to debug an issue i was having.
Before going further: keep in mind that my point of view (at the time) was the one of somebody working as a devops engineer, debugging some annoyances with containers (managed by Kubernetes) going OOM. I'm no kernel developer and I have a basic-good understanding of the C language based on first-years university course and geekyness/nerdyness. So in this context I'm a glorified hobbyist.
Learning SystemTap is easier in my opinion. I followed a tutorial by RedHat to get the hang of the manual parts but after that I remember being fairly easy:
1. Try to reproduce the issue you're having (fairly easy for me)
2. Skim the source code of the linux about the part that you think might be relevant (for me it was the oom killer)
3. Add probes in there, see if they fire when you reproduce the issue
4. Look back at the source code of the kernel and see what chain of data structures and fields you can follow to reach the piece of information you need
5. Improve your probes
6. If successful, you're done
7. Goto 4
I think it took like one or two days between following the tutorial and getting a working probe.
It was a pleasant couple of days.
The additional flexibility eBPF gets from this is amazing really. While dtrace is a more-targeted (and for its intended usecases, in some situations still superior to eBPF) but also less-general tool.
(citrus vs. stone fruit ...)
[0] https://bcantrill.dtrace.org/2005/07/19/dtrace-safety/
[1] https://www.usenix.org/legacy/publications/library/proceedin..., §3.3
Until eBPF came around and said we can now prove it to be secure.
Until the sidechannel hackers came around to prove the opposite.
Would you mind giving some examples? I recently started learning about ebpf's from Liz Rice's book and is curious about what makes ebpf the correct choice in a particular scenario.
You may not use it at your smaller scale. But there are millions of machines out there that do use it, and the alternative for the same functionality is much worse.
I bet you never use SCTP sockets either. eBPF is used much more than SCTP.
And its users "fund" its development, so it's not a burden to those who don't use it.
But are you sure your systems don't use it? Run "bpftool prog" to see. Whatever you see there someone thought was better than the alternative.
I look forward to seeing that patch on Google Graveyard in a couple years' time.