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

Use bpf_link for perf_attach programs (Kprobe/Uprobe/Tracepoint etc...) #522

Merged
merged 4 commits into from
Feb 12, 2023

Conversation

dave-tucker
Copy link
Member

This adds support for using bpf_link to perf_attach programs.

In addition, it also makes the feature detection a lazy-static, which while not strictly necessary should allow applications to do feature detection only once when using Aya vs. every time a Bpf object is created.
This also allows for features to be used in other parts of the codebase that might require feature discovery to have happened already - I think I ran into this in the USDT probe PR which is why I implemented this in the first place!

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
@netlify
Copy link

netlify bot commented Feb 10, 2023

Deploy Preview for aya-rs-docs ready!

Name Link
🔨 Latest commit 7479c1d
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/63e8cced85a3fd0007edf9dd
😎 Deploy Preview https://deploy-preview-522--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 settings.

@dave-tucker
Copy link
Member Author

/cc @astoycos if you want to pull this for testing

Copy link
Collaborator

@alessandrod alessandrod left a comment

Choose a reason for hiding this comment

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

Great PR! Just a couple of smol nits

aya/src/bpf.rs Outdated Show resolved Hide resolved
aya/src/sys/bpf.rs Outdated Show resolved Hide resolved
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
This adds support for bpf_link to PerfEvent, Tracepoint, Kprobe and
Uprobe programs.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Just use the Debug formatter vs. printing a message for each probe.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
@alessandrod alessandrod merged commit d7d6442 into aya-rs:main Feb 12, 2023
@dave-tucker dave-tucker added feature A PR that implements a new feature or enhancement aya This is about aya (userspace) labels Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aya This is about aya (userspace) feature A PR that implements a new feature or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants