Skip to content

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

Merged
merged 10 commits into from
Apr 26, 2023
Merged

Conversation

ovalenti
Copy link
Contributor

Description

Add steps to the host heuristics to check the presence of some features required by the core_bpf collection method.

closes #1018

Checklist

  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing

  • Added unit tests
  • Added integration tests

Testing Performed

@ovalenti ovalenti added the run-corebpf-tests Use the CO-RE bpf driver in integration tests label Apr 18, 2023
@ovalenti ovalenti self-assigned this Apr 18, 2023
@openshift-ci
Copy link

openshift-ci bot commented Apr 18, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ovalenti ovalenti force-pushed the feature/heuristic_for_btf_support branch from dde33b8 to 29a7691 Compare April 21, 2023 16:17
@github-actions
Copy link

github-actions bot commented Apr 21, 2023

Kernel Method Without Collector Time (secs) With Collector Time (secs) Baseline median (secs) Collector median (secs) PValue
rhel.rhel-8 ebpf 230.457 237.76 204.92 213.7 🟢
ubuntu-os.ubuntu-1804-lts ebpf 248.334 236.254 206.11 213.49 🟢
ubuntu-os.ubuntu-2004-lts ebpf 247.161 242.615 236.1 234.97 🟢
ubuntu-os.ubuntu-2204-lts ebpf 253.711 247.793 222.56 229.05 🟢

@ovalenti ovalenti marked this pull request as ready for review April 21, 2023 20:05
@ovalenti ovalenti requested a review from a team as a code owner April 21, 2023 20:05
Copy link
Contributor

@erthalion erthalion left a 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. "
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@ovalenti ovalenti requested a review from erthalion April 24, 2023 09:49
Copy link
Contributor

@erthalion erthalion left a 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.

@ovalenti ovalenti merged commit a7d03a7 into master Apr 26, 2023
@ovalenti ovalenti deleted the feature/heuristic_for_btf_support branch April 26, 2023 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-corebpf-tests Use the CO-RE bpf driver in integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Heuristic for BTF support
2 participants