Skip to content
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

aya,aya-obj: conversion from u32 to prog, map, and link type #979

Closed
wants to merge 6 commits into from

Conversation

tyrone-wu
Copy link
Contributor

@tyrone-wu tyrone-wu commented Jun 29, 2024

I have a usecase that extracts program type information from from bpf_prog_info. 😺

This PR adds conversion from u32 to bpf_prog_type so that the type_ field in bpf_prog_info can map to the program type enum. This also implements Display for bpf_prog_type for condensed output format. 😺

Also, codegen and public-api appears to be acting a little funky for me.

Copy link

netlify bot commented Jun 29, 2024

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 4668518
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/668b3bcff2781500080a0388
😎 Deploy Preview https://deploy-preview-979--aya-rs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

Copy link

mergify bot commented Jun 29, 2024

Hey @alessandrod, this pull request changes the Aya Public API and requires your review.

@mergify mergify bot requested a review from alessandrod June 29, 2024 04:09
@mergify mergify bot added api/needs-review Makes an API change that needs review aya This is about aya (userspace) aya-obj Relating to the aya-obj crate test A PR that improves test cases or CI labels Jun 29, 2024
@tyrone-wu tyrone-wu marked this pull request as draft June 29, 2024 04:10
Adds conversion from u32 to `bpf_prog_type` so that the `type_` field in
`bpf_prog_info` can map to the program type enum. This also implements
Display for `bpf_prog_type` for condensed output format.
Removes duplicate u32 conversion for  map type
`BPF_MAP_TYPE_BLOOM_FILTER` and `BPF_MAP_TYPE_CGRP_STORAGE`, and adds
`BPF_MAP_TYPE_CGRP_STORAGE`. Also implements display for map type.
Adds conversion from u32 to link type enum. Also implements display for
condensed metadata output.

So far, this is still WIP since this commit/PR also plans to add better
access to `bpf_link_info__bindgen_ty_1` metadata.
@tyrone-wu
Copy link
Contributor Author

So the scope of this PR expanded to include metadata info from bpf_map_info and bpf_link_info. I'm also planning to info for bpf_link_info__bindgen_ty_1.

@tyrone-wu tyrone-wu changed the title aya,aya-obj: conversion for u32 to prog type enum & format enum display aya,aya-obj: conversion from u32 to prog, map, and link type Jul 8, 2024
Add bpf syscall function for BPF_ENABLE_STATS to enable stats tracking
for benchmarking purposes, which returns a file descriptor handler.

This also adds the aya-object api for bpf_stats_type.
Added functions to expose run_time_ns & run_cnt statistics from
ProgramInfo/bpf_prog_info.
@tyrone-wu tyrone-wu closed this Jul 22, 2024
@tyrone-wu
Copy link
Contributor Author

I almost accidently deleted this PR bc of the branch name I had. Since the scope of this PR expanded, this will go under a new branch since the one I'm working on locally is wacky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api/needs-review Makes an API change that needs review aya This is about aya (userspace) aya-obj Relating to the aya-obj crate test A PR that improves test cases or CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant