Skip to content

Conversation

d-e-s-o
Copy link
Collaborator

@d-e-s-o d-e-s-o commented Sep 5, 2025

Add the Program::attach_iter_with_opts() method to allow for iterator attachment with support for providing additional options.

Add the Program::attach_iter_with_opts() method to allow for iterator
attachment with support for providing additional options.

Signed-off-by: Daniel Müller <[email protected]>
@d-e-s-o
Copy link
Collaborator Author

d-e-s-o commented Sep 5, 2025

And I see that bpf_iter_link_info is a union, so we probably want to model that a tad differently then.

@tyrone-wu
Copy link

Heyo o/

This was how I ended up implementing the iter variants when I implemented link_info in aya.
https://github.com/tyrone-wu/aya/blob/aya/link-info/aya/src/links/info.rs#L118

It's kind old code (about a yearish ago) that I ended up not having the time & energy to get merged to upstream aya, and probly won't get around to since i'm kinda moving away from aya. 🫠 so it's been sitting in limbo ever since.

If it's still the same today, the .target_name should map to the bpf_iter_link_info variants:

  • "bpf_map_elem" | "bpf_sk_storage_map" to map
  • "cgroup" to cgroup
  • "task" | "task_file" | "task_vma" to task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants