Skip to content

probes: remove bpftool dependency #39438

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 6 commits into from
May 12, 2025
Merged

Conversation

ti-mo
Copy link
Contributor

@ti-mo ti-mo commented May 8, 2025

This PR replaces bpftool-based feature detection with real bpf() and netlink-based feature probes. It also removes the concept of 'optional' dependencies since they were relatively hidden in the log and have been rotting for several years.
With this, the ProbeManager has been sunset.

  • Cgroups: used for socketlb, will throw an error anyway when the user tries
    to enable and cgroup-bpf support is compiled out
  • Events: unused by Cilium, though external tools like pwru rely on it for
    troubleshooting. Let this be documented by those external tools instead.
  • LWTunnel: unused by Cilium

Contributes towards: #38979
Fixes: #22514

Remove dependency on /boot/config* and/or /proc/config* for feature detection

@ti-mo ti-mo requested a review from a team as a code owner May 8, 2025 13:55
@ti-mo ti-mo added the release-note/minor This PR changes functionality that users may find relevant to operating Cilium. label May 8, 2025
@ti-mo ti-mo requested a review from rgo3 May 8, 2025 13:55
@ti-mo ti-mo force-pushed the tb/remove-bpftool-probes branch from a7782aa to 41b6285 Compare May 8, 2025 14:03
@ti-mo
Copy link
Contributor Author

ti-mo commented May 8, 2025

/test

Copy link
Contributor

@rgo3 rgo3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one doc string nit, otherwise very nice. Makes me happy to finally see this completed after all this time :feelsgood:

@ti-mo ti-mo force-pushed the tb/remove-bpftool-probes branch 2 times, most recently from ee5aa2c to acf40fc Compare May 9, 2025 08:02
@ti-mo
Copy link
Contributor Author

ti-mo commented May 9, 2025

@borkmann PTAL just in case. If tcx is enabled on the agent, we'll require tcx, otherwise we require tc-bpf.

@ti-mo
Copy link
Contributor Author

ti-mo commented May 9, 2025

/test

ti-mo added 6 commits May 12, 2025 10:05
Signed-off-by: Timo Beckers <timo@isovalent.com>
Signed-off-by: Timo Beckers <timo@isovalent.com>
CONFIG_BPF is theoretically used to enable the legacy BPF interpreter,
but it is rarely and inconsistently used throughout the Linux kernel.

CONFIG_BPF_SYSCALL has it as a dependency, so let's only probe for that
one instead. Replace the CONFIG_BPF_SYSCALL kconfig check with a 'real'
syscall probe.

Signed-off-by: Timo Beckers <timo@isovalent.com>
BPF_JIT and HAVE_EBPF_JIT both need to be enabled for the JIT to work.
Replace the kconfig check with a real bpf()-based probe.

Signed-off-by: Timo Beckers <timo@isovalent.com>
…/CLS_BPF

Replace with a netlink-based probe.

Signed-off-by: Timo Beckers <timo@isovalent.com>
This commit removes the leftover bits of bpftool-based kconfig parsing
after being mostly replaced with bpf() and netlink-based feature probes in
prior commits.

This commit also removes the concept of 'optional' dependencies since they
were relatively hidden in the log and have been rotting for several years.
With this, the ProbeManager has been sunset.

- Cgroups: used for socketlb, will throw an error anyway when the user tries
  to enable and cgroup-bpf support is compiled out
- Events: unused by Cilium, though external tools like pwru rely on it for
  troubleshooting. Let this be documented by those external tools instead.
- LWTunnel: unused by Cilium

Signed-off-by: Timo Beckers <timo@isovalent.com>
@ti-mo ti-mo force-pushed the tb/remove-bpftool-probes branch from acf40fc to 1e8235f Compare May 12, 2025 08:06
@ti-mo
Copy link
Contributor Author

ti-mo commented May 12, 2025

/test

@ti-mo ti-mo enabled auto-merge May 12, 2025 08:09
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label May 12, 2025
@ti-mo ti-mo added this pull request to the merge queue May 12, 2025
Merged via the queue into cilium:main with commit 41b94b8 May 12, 2025
66 checks passed
@ti-mo ti-mo deleted the tb/remove-bpftool-probes branch May 12, 2025 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Probes: remove dependency on kernel configuration (/proc/config.gz)
3 participants