-
Notifications
You must be signed in to change notification settings - Fork 302
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
Implement HashOfMaps and ArrayOfMaps #70
base: main
Are you sure you want to change the base?
Conversation
e17a3b6
to
0ebee15
Compare
Thanks for taking this up! I only skimmed through the changes. The user space side looks ok, the ebpf side I think should probably be a bit different. Right now maps of maps return an integer from #[map]
static mut OUTER: ArrayOfMaps<HashMap<X, Y>> = ...
fn some_probe(...) -> Result {
let inner_map: HashMap<X, Y> = unsafe { OUTER.get(0).ok_or(())? };
inner_map.insert(x_value, y_value);
...
} This will also require adding some kind of |
This is of interest to us! |
@jeromegn awesome! i'll get back to this after #127... and probably after #151 since may as well handle internal changes to fetching internal maps/programs by id together... @alessandrod I haven't looked into the kernel side yet, but are all maps in the array/hashmap constrained to being of the same type? if not, it won't be possible to return a strongly typed wrapper.... |
@dave-tucker Any interest in continuing on this?
If I'm not mistaken, all the values are the same for the map of maps. They're refs u32. |
I'd like to take a stab at getting this up to day/ finishing if need be! WDYT @dave-tucker? |
@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. |
Our project could use this feature. Any updates? Glad to lend a hand in finishing this up if needed. |
I've needed this too recently so I'd like to get it landed. We've changed the implementation of maps so the code in this PR needs to be updated. Getting it to compile/work would be a good first step I guess? |
@dave-tucker, this pull request is now in conflict and requires a rebase. |
0ebee15
to
26ec01e
Compare
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]>
26ec01e
to
8346d78
Compare
❌ Deploy Preview for aya-rs-docs failed.
|
8346d78
to
f32db40
Compare
❌ Deploy Preview for aya-rs-docs failed.
|
f32db40
to
c74911c
Compare
This commit implements the Array of Maps and Hash of Maps to eBPF. Signed-off-by: Dave Tucker <[email protected]>
c74911c
to
078c638
Compare
Still a work in progress. Remaining TODO items:
|
This PR adds user and kernel space implementations of HashOfMaps and ArrayOfMaps.
This change is