Skip to content

aya-obj: add several accessors for BTF types parsed by aya-obj#1580

Open
Evian-Zhang wants to merge 1 commit into
aya-rs:mainfrom
Evian-Zhang:btf-accessor
Open

aya-obj: add several accessors for BTF types parsed by aya-obj#1580
Evian-Zhang wants to merge 1 commit into
aya-rs:mainfrom
Evian-Zhang:btf-accessor

Conversation

@Evian-Zhang

@Evian-Zhang Evian-Zhang commented May 24, 2026

Copy link
Copy Markdown

I'm new to this project, and I want to use aya to extract BTF information in an ebpf object. I find aya extremely powerful in parsing ebpf objects, with aya_obj::Object::parse (by printing the parsed object, I'm sure that all BTF information is parsed). However, current API design makes it hardly to do anything with parsed BTF information. Almost all accessors are pub(crate). The only thing I can do is id_by_type_name_kind, which has far less information than aya actually got.

So in this PR, I make some pub(crate) APIs public, and add some new accessors.

Added/updated tests?

We strongly encourage you to add a test for your changes.

  • Yes
  • No, and this is why: the pub(crate) APIs are already tested previously
  • I need help with writing tests

Checklist

  • Rust code has been formatted with cargo +nightly fmt.
  • All clippy lints have been fixed.
    You can find failing lints with cargo xtask clippy.
  • Unit tests are passing locally with cargo test.
  • The Integration tests are passing locally.
  • I have blessed any API changes with cargo xtask public-api --bless.

(Optional) What GIF best describes this PR or how it makes you feel?


This change is Reviewable

@Evian-Zhang Evian-Zhang requested a review from a team as a code owner May 24, 2026 09:26
@netlify

netlify Bot commented May 24, 2026

Copy link
Copy Markdown

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit c958064
🔍 Latest deploy log https://app.netlify.com/projects/aya-rs-docs/deploys/6a12c444511ff600077b836c
😎 Deploy Preview https://deploy-preview-1580--aya-rs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

1 participant