-
Notifications
You must be signed in to change notification settings - Fork 26
Preflight checks for BTF support #1120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Skipping CI for Draft Pull Request. |
If any dependency is missing, we fail with a clear message.
dde33b8
to
29a7691
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good. Couple of commentaries below, but also one request, would it be hard to add a few unit tests?
res = libbpf_probe_bpf_map_type(BPF_MAP_TYPE_RINGBUF, NULL); | ||
|
||
if (res < 0) { | ||
CLOG(WARNING) << "Unable to check for the BPF RingBuffer availability. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case libbpf
says feature detection may failed, makes sense to report errno
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find a reference to the errno availability in the docs for that case. And the code suggests that it does not reflect the actual error reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one [1]? It seems this function does sys_bpf_fd
and returns -errno
if fd < 0
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errno is tested underneath, but when the error if reported at the API level, I am afraid this information is lost.
We only care for the availability of the symbols, not where they come from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, overall looks good.
Description
Add steps to the host heuristics to check the presence of some features required by the core_bpf collection method.
closes #1018
Checklist
Automated testing
Testing Performed