-
Notifications
You must be signed in to change notification settings - Fork 255
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-obj: Remove name from ProgramSection #720
Conversation
✅ Deploy Preview for aya-rs-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dave-tucker)
aya-obj/src/obj.rs
line 198 at r1 (raw file):
/// - if the section name does not contain any slashes, /// then the program name is just that section name; /// - if there are some slashes, the name is `section_name.rsplitn(2, '/')[0]`,
for my own edification: in libbpf-land the presence of slashes is used to specify default attachment points, right? in other words, might we want the name back in the future?
aya-obj/src/obj.rs
line 341 at r1 (raw file):
} } _ => {
s/_/name/?
aya-obj/src/obj.rs
line 396 at r1 (raw file):
"xdp.frags" => Xdp { name, frags: true }, "tp_btf" => BtfTracePoint { name }, _ if kind.starts_with("tracepoint") || kind.starts_with("tp") => {
nit: s/_/kind/ so I don't have to go up 10 lines to see that kind is the thing being matched on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @dave-tucker)
aya-obj/src/obj.rs
line 280 at r1 (raw file):
"socket" => SocketFilter, "sk_msg" => SkMsg, "sk_skb" => match &*name {
here and everywhere: I think this can be name
rather than &*name
.
884c126
to
7741a21
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @tamird)
aya-obj/src/obj.rs
line 198 at r1 (raw file):
Previously, tamird (Tamir Duberstein) wrote…
for my own edification: in libbpf-land the presence of slashes is used to specify default attachment points, right? in other words, might we want the name back in the future?
We might want to do some more parsing in future, but it will never be `name, which Aya used as workaround for the lack of support for multiple programs in the same ELF section - something that was added to libbpf 0.2 onwards.
The format is described here:
https://www.kernel.org/doc/html/latest/bpf/libbpf/program_types.html#rawtp
What comes after the first /
differs depending on program type, and we'd need to properly parse this.
aya-obj/src/obj.rs
line 280 at r1 (raw file):
Previously, tamird (Tamir Duberstein) wrote…
here and everywhere: I think this can be
name
rather than&*name
.
Done.
aya-obj/src/obj.rs
line 341 at r1 (raw file):
Previously, tamird (Tamir Duberstein) wrote…
s/_/name/?
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dave-tucker)
aya-obj/src/obj.rs
line 198 at r1 (raw file):
Previously, dave-tucker (Dave Tucker) wrote…
We might want to do some more parsing in future, but it will never be `name, which Aya used as workaround for the lack of support for multiple programs in the same ELF section - something that was added to libbpf 0.2 onwards.
The format is described here:
https://www.kernel.org/doc/html/latest/bpf/libbpf/program_types.html#rawtp
What comes after the first/
differs depending on program type, and we'd need to properly parse this.
Thanks 👍
Clarifying further: aya still doesn't support multiple programs in the same section, right? I think you asked me to try that on a recent PR.
It does, so long as they don't have BTF - which is why the aya integration test with 2 progs in the same section passes but your uprobe C test does not. We're incorrectly building the func_info for programs and I'm working on a fix for that now. |
7741a21
to
60d2fea
Compare
Hey @alessandrod, this pull request changes the Aya Public API and requires your review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @alessandrod and @dave-tucker)
aya-obj/src/obj.rs
line 198 at r1 (raw file):
Previously, dave-tucker (Dave Tucker) wrote…
It does, so long as they don't have BTF - which is why the aya integration test with 2 progs in the same section passes but your uprobe C test does not. We're incorrectly building the func_info for programs and I'm working on a fix for that now.
Ah, very helpful. Thanks for explaining (again!).
xtask/public-api/aya.txt
line 999 at r3 (raw file):
pub aya::maps::MapError::PinError::name: core::option::Option<alloc::string::String> pub aya::maps::MapError::ProgramNotLoaded pub aya::maps::MapError::SyscallError(crate::sys::SyscallError)
I think this is incorrect; looks like you generated the API using a stable toolchain (we use nightly in CI)
@dave-tucker, this pull request is now in conflict and requires a rebase. |
The name here is never used as we get the program name from the symbol table instead. Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
60d2fea
to
cca9b8f
Compare
@tamird would you mind taking a look at this rebased version? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @alessandrod)
The name here is never used as we get the program name from the symbol table instead.
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)