Skip to content
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

feat(aya): Add is_program_type_supported #1145

Closed
wants to merge 1 commit into from

Conversation

dave-tucker
Copy link
Member

@dave-tucker dave-tucker commented Jan 24, 2025

This adds a new API to test whether a given program type is supported.

This is to support 3 usecases:

  1. A project like bpfman (which uses Aya) may wish to prevent users with a list of program types that are supported on the target system
  2. A user of Aya may wish to test whether Fentry/Fexit programs are supported and code their own behaviour to fallback to Kprobes
  3. Our own integration tests can be made to skip certain program tests when kernel features are missing.

This change is Reviewable

Copy link

netlify bot commented Jan 24, 2025

Deploy Preview for aya-rs-docs ready!

Name Link
🔨 Latest commit 7af8bf8
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/6793ca2d86e3e200087f6f1e
😎 Deploy Preview https://deploy-preview-1145--aya-rs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

mergify bot commented Jan 24, 2025

Hey @alessandrod, this pull request changes the Aya Public API and requires your review.

@mergify mergify bot added the api/needs-review Makes an API change that needs review label Jan 24, 2025
@mergify mergify bot requested a review from alessandrod January 24, 2025 16:39
@mergify mergify bot added aya This is about aya (userspace) test A PR that improves test cases or CI labels Jan 24, 2025
This adds a new API to test whether a given program type is supported.

This is to support 3 usecases:

1. A project like bpfman (which uses Aya) may wish to prevent users with
   a list of program types that are supported on the target system
2. A user of Aya may wish to test whether Fentry/Fexit programs are
   supported and code their own behaviour to fallback to Kprobes
3. Our own integration tests can be made to skip certain program tests
   when kernel features are missing.

Signed-off-by: Dave Tucker <[email protected]>
@tyrone-wu
Copy link
Contributor

Hi! I was wondering if #1063 could address the first usecase. I haven't updated it in a while, however last time I checked, program type and map type feature probing should be working correctly. I had planned to including another api for bpf_link_type probing along with bpf_attach_type, but I haven't had much time recently to work on it.

If it fits your first usecase, I can try to get my PR updated as soon as I can. :)

@dave-tucker
Copy link
Member Author

Hi! I was wondering if #1063 could address the first usecase. I haven't updated it in a while, however last time I checked, program type and map type feature probing should be working correctly. I had planned to including another api for bpf_link_type probing along with bpf_attach_type, but I haven't had much time recently to work on it.

If it fits your first usecase, I can try to get my PR updated as soon as I can. :)

Here's the thing. This was just a quick hack to unblock #1135 and I totally forgot about your PR @tyrone-wu - sorry.
If you're up for it, let's do this.

  1. I'll close this PR
  2. You can Cherry-pick 6c3b2a6 and submit as it's own PR. It's mergeable pretty much immediately... and it reduces the diff making your other changes easier to review.
  3. Rebase your remaining commits and mark it as ready for review so I can take a look. Having given it a quick glance I'm generally "ok" with it but I'd like to review it properly - I have questions that we may want to address in that PR, or as a follow up.

@tyrone-wu
Copy link
Contributor

tyrone-wu commented Feb 3, 2025

Srry for the delay. 😖

  1. You can Cherry-pick 6c3b2a6 and submit as it's own PR. It's mergeable pretty much immediately... and it reduces the diff making your other changes easier to review.

That commit is now separated into #1162.

  1. Rebase your remaining commits and mark it as ready for review so I can take a look. Having given it a quick glance I'm generally "ok" with it but I'd like to review it properly - I have questions that we may want to address in that PR, or as a follow up.

Just finished up some final testing for the remaining work, which should be updated in #1063. 👍

@dave-tucker
Copy link
Member Author

Thanks so much @tyrone-wu!

@dave-tucker dave-tucker closed this Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api/needs-review Makes an API change that needs review aya This is about aya (userspace) test A PR that improves test cases or CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants