-
Notifications
You must be signed in to change notification settings - Fork 309
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
Add Support for USDT Probes #329
Draft
dave-tucker
wants to merge
10
commits into
aya-rs:main
Choose a base branch
from
dave-tucker:usdt
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❌ Deploy Preview for aya-rs-docs failed.
|
3522993
to
47220d0
Compare
This commit refactors the handling of /proc/$pid/maps since the collection previously assumed that all entries here could be representeted in a HashMap. Those with a path component are stored in a HashMap for fast lookup via library name. All other entries are cached in a Vec to allow for filtering based on offsets, required for supporting USDT probes. Signed-off-by: Dave Tucker <[email protected]>
Signed-off-by: Dave Tucker <[email protected]>
Signed-off-by: Dave Tucker <[email protected]>
Signed-off-by: Dave Tucker <[email protected]>
6ec3b64
to
8a7cf5e
Compare
Signed-off-by: Dave Tucker <[email protected]>
This commit adds aya-common, which is for code that is shared between aya-bpf and aya. The initial use case is for USDT probes, which require a lot of co-operation between aya and aya-bpf to provide a good UX. Signed-off-by: Dave Tucker <[email protected]>
Signed-off-by: Dave Tucker <[email protected]>
Since these programs require that a few maps are created, we hide this behind a feature since otherwise the maps will get created regardless of the program type. Signed-off-by: Dave Tucker <[email protected]>
Signed-off-by: Dave Tucker <[email protected]>
Signed-off-by: Dave Tucker <[email protected]>
vadorovsky
reviewed
Oct 11, 2022
594784a
to
17e3e35
Compare
cfd7226
to
dfd26f9
Compare
@dave-tucker, this pull request is now in conflict and requires a rebase. |
@dave-tucker, this pull request is now in conflict and requires a rebase. |
@dave-tucker, this pull request is now in conflict and requires a rebase. |
Marking as draft. I intend to come back to this and rebase. |
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)
aya-bpf
This is about aya-bpf (kernel)
aya-log
Relating to aya-log
needs-rebase
test
A PR that improves test cases or CI
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds support for USDT programs.
Doing this required a lot of work despite the uprobe support already existing.
Notable refactoring changes include:
Features
alazy_static
so they can be checked anywhere in the libbpf_link_create
for programs that usePerfLink
As for USDT support itself, it requires the use of maps to unify access to arguments from eBPF (one usdt can have multiple different ways to get the same arg, depending on how the compiler does its thing).
To support this an
aya-common
crate was added.Since the maps would always be created whenever
aya_bpf
was used, USDT is it's own feature.Also, as we don't support
bpf_core_*
functions in eBPF yet there is a second feature to indicate whether you are using thebpf_attach_cookie
or not. This MUST match whatever isAya
uses - which is derived by probing forbpf_attach_cookie
support. Not ideal, but workable in the short term.Test Program: https://github.com/dave-tucker/usdt-test
Wishlist
Required before merge
attach
- would be nice to not have to do that 🤔(Optional) can be tracked in issues afterwards
aya-bpf
such that a USDT prog written in aya could be loaded with libbpflazy_static!
for handling of/proc/pid/maps
so it could be re-used if you're attaching to multiple tracepoints in the same binary.This change is