parca-dev / parca-agent

eBPF based always-on profiler auto-discovering targets in Kubernetes and systemd, zero code changes or restarts needed!
https://parca.dev/
Apache License 2.0
533 stars 66 forks source link

docs: Add documentation about eBPF and BTF support #333

Open v-thakkar opened 2 years ago

v-thakkar commented 2 years ago

eBPF was introduced in one of the 3.x kernel and BTF support was added in one of the 5.x version. Although a lot of these features have been backported in different mainline stable kernels as well as in distro-specific kernels. We should add documentation with some commands so that it's easier for users to identify if their host kernel has BPF and BTF support or not.

brancz commented 2 years ago

Could we maybe even have the Parca Agent do a few tests on startup to identify whether the features it needs are available and error out with that exact feature if it isn't available?

v-thakkar commented 2 years ago

Yes, good idea. We should do that. Probably a separate issue for that? I think having this somewhere under system requirements will still be beneficial for the new users. Wdyt?

brancz commented 2 years ago

Agreed, definitely, both are important and useful!

kakkoyun commented 2 years ago

FWIW I had this in our stack unwinding PR, I can extract it out as another PR. https://github.com/parca-dev/parca-agent/blob/8e02f0acd9b8c5969c066a4ed3ca66ea2509b955/pkg/agent/profile.go#L285-L348

It's a little rudimentary, it's just checking for the underlying Linux version of the host. We can improve the logic.

v-thakkar commented 2 years ago

Ah, nice. This looks almost perfect. Just to be more accurate, instead of checking it via OS version we should probably check it via config options of the running kernel. My idea was to check with 'cat /boot/config-$(uname -r) | grep BTF' or something similar.

kakkoyun commented 2 years ago

Yep, sounds good. If you want to handle that, please go ahead. Otherwise, I can handle it.

v-thakkar commented 2 years ago

Sure, I can take care of it.