aya: fix wrong BPF_LINK_TYPE in TryFrom<FdLink>#1532
Conversation
✅ Deploy Preview for aya-rs-docs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
tamird
left a comment
There was a problem hiding this comment.
Nice. Now that we have 4 identical implementations (there is 1 before this change) could we consolidate them to reduce repetition?
@tamird reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on swananan).
1ae88d8 to
210ece0
Compare
Done, realized these can be consolidated into a macro. And also adjusted the commit message. |
Fix wrong bpf_link_type checks in TryFrom<FdLink> for UProbeLink, KProbeLink and TracePointLink. Consolidate all TryFrom<FdLink> implementations into an impl_try_from_fdlink! macro. Strengthen pin_lifecycle tests to verify the FdLink to link conversion, covering this previously untested path. Found while working on aya-rs#1417.
210ece0 to
76fa6cb
Compare
tamird
left a comment
There was a problem hiding this comment.
@tamird reviewed 9 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on swananan).
Context
UProbe, KProbe, and TracePoint all checked the wrong bpf_link_type when converting from FdLink. All three use perf_attach, which produces BPF_LINK_TYPE_PERF_EVENT links, but the checks matched BPF_LINK_TYPE_TRACING (UProbe, TracePoint) and
BPF_LINK_TYPE_KPROBE_MULTI (KProbe).
Strengthen pin_lifecycle tests to verify the FdLink to link conversion, covering this previously untested path.
Found while working on #1417.
Added/updated tests?
We strongly encourage you to add a test for your changes.
have not been included
Checklist
cargo +nightly fmt.You can find failing lints with
cargo xtask clippy.cargo test.cargo xtask public-api --bless.(Optional) What GIF best describes this PR or how it makes you feel?
This change is