Comments (5)
I would think the best practice here would be to pin the link before forgetting it... something like what we do here https://github.com/aya-rs/aya/blob/main/test/integration-test/src/tests/load.rs#L437
from aya.
Thank you for your fast answer! Given that these tests are only implemented for Xdp, Uprobe, Kprobe and Tracepoint, do I assume correctly that it is not yet implemented for any other probe type?
E.g. FdLink: From<amzn_aya::programs::CgroupSockLink>
is not implemented.
Or is there another mechanism for these other probes?
from aya.
Spent some more time looking into this, I think the functionality around pinning is not fully implemented for all program types. I wrote this little patch an it works, though it is not ready for a PR.
@astoycos I am willing to work on a clean implementation for this. Since you worked on the implementation of some probe types, did you already have a plan in mind how this is supposed to work for the remaining ones? Should I just implement a suggestion, or should I connect with you or someone else first?
There is also a SOCK_OPS type specific detaching problem I would like to discuss.
from aya.
Hiya @benlcb 👋 Sorry I missed your original response.. It's funny in our documentation for FDLink we tell users that
/// Fd links are returned directly when attaching some program types (for
/// instance [`crate::programs::cgroup_skb::CgroupSkb`]),
But that doesn't seem to be true 🙉 or maybe it was before https://lore.kernel.org/bpf/CAEf4Bzbt_aVR5HyW_MuYvxT1fMBKD3xZOw3rEuHtj1i_T8NO_g@mail.gmail.com/T/ merged... anyways it looks like we need to implement try_from
and try-into
for all the Cgroup link types.
did you already have a plan in mind how this is supposed to work for the remaining ones? Should I just implement a suggestion, or should I connect with you or someone else first?
If you want feel free to open a PR, I'm happy to review! If not I can do it as well. Lets just make sure to add integration tests for the new programs 👍
There is also a SOCK_OPS type specific detaching problem I would like to discuss.
Sure what's the issue?
from aya.
But that doesn't seem to be true 🙉
Haha yes I saw that too. I'll get a PR ready over the weekend.
Sure what's the issue?
SOCK_OPS
does not appear to be detached by simply deleting the FD from the BPF file system. So it keeps running, and I think we need to explicitly detach it using the information in theProgAttachLink
. For example, if a user tries to detach it usingPinnedLink
, that won't work. (I'll get a failing test for that ready as well).
My use case looks like that:
I'm running a program which attaches probes and then quits. Later on, the same program is run again to detach the probes.
I would like to figure out what additions are needed to enable this kind of workflow.
Maybe we can create a public ::new
function for ProgAttachLink
, so users can populate those themselves. But this doesn't sound easy to use, since the user would need to know what FDs to put where.
Another thought might be to derive Serialize, Deserialize for ProgAttachLink
(or their wrappers) so users can save them to disk, and reload them for detaching.
Maybe you have a better idea?
from aya.
Related Issues (20)
- Support non-UTF-8 symbol probing HOT 1
- Build error on macOS m1 HOT 6
- Features are incorrectly detected, resulting in load errors on some older kernels HOT 2
- Remove libc types from the API
- High CPU what Holding References to Maps HOT 1
- Help Adding new helpers HOT 1
- PerfEvent error: Argument list too long (os error 7) HOT 3
- Building hello world XDP program fails HOT 1
- aya_log: Allow aya log to be consumed from C HOT 2
- Bug in Aya log HOT 8
- aya: add take_program API
- Missing Cargo.lock HOT 2
- cargo test Fails on Documentation Test in aya/src/maps/ring_buf.rs
- aarch64: integration-ebpf is being linked with cc, which fails HOT 1
- aya/maps: mechanism to query map max entries
- Error: error relocating function HOT 15
- Raw tracepoint link id type cannot be imported HOT 3
- Publish aya-obj crate to crates.io HOT 7
- Fixup the load time bpf Maps API HOT 2
- Request for information: How to proper cleanup on eBPF program termination/panic. HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aya.