Merged
Conversation
dylandreimerink
requested changes
Nov 1, 2024
8c0466b to
d5a4c9e
Compare
ti-mo
requested changes
Nov 25, 2024
Contributor
ti-mo
left a comment
There was a problem hiding this comment.
Thanks, sorry this took so long. Looks good overall, I've suggested a few changes. Please do any refactoring in a separate commit from the main change (adding the jited fields).
It's to export the raw line infos alongside with prog's jited infos. Signed-off-by: Leon Hwang <[email protected]>
Expose these prog jited info: 1. JITed machine native instructions torvalds/linux@1e2709769086 ("bpf: Add BPF_OBJ_GET_INFO_BY_FD") 2. JITed line info torvalds/linux@c454a46b5efd ("bpf: Add bpf_line_info support") 3. JITed image lengths torvalds/linux@815581c11cc2 ("bpf: get JITed image lengths of functions via syscall") Signed-off-by: Leon Hwang <[email protected]>
d5a4c9e to
a34ec46
Compare
f35b146 to
882863e
Compare
Since the original field is called jited_ksyms, reflect that in the Go API as well. Signed-off-by: Timo Beckers <[email protected]>
This was getting hard to follow with the 'name == "proc"' statements sprinkled around. These are actually separate tests, proc only populates type and tag. Remove negative tests from TestProgramInfoProc as newProgramInfoFromProc only sets those two fields. Signed-off-by: Timo Beckers <[email protected]>
dylandreimerink
approved these changes
Dec 4, 2024
882863e to
f417957
Compare
Added tests for: - FuncInfos() - LineInfos() - JitedKsymAddrs() - JitedInsns() - JitedLineInfos() - JitedFuncLens() The existing test for JitedKsymAddrs was removed because it's not strictly necessary to load a CollectionSpec to exercise it. It obscured the fact that it seems like kernels before at least 5.4 need to have a subprog for jited addrs to be returned in prog info. TestProgInfoFuncInfos was removed for a similar reason. It's possible to craft a program using the asm package that meets the criteria for exercising FuncInfos() and LineInfos() in a deterministic way, no need to load a Collection. Signed-off-by: Timo Beckers <[email protected]>
f417957 to
7514cdf
Compare
ti-mo
approved these changes
Dec 4, 2024
Contributor
|
@Asphaltt I added some tests for the new proginfo APIs, please include them next time. I also ended up renaming KsymAddrs to JitedKsymAddrs since that makes it clear that it concerns jited symbols and looks nicer alongside the other methods. This will break your build if you're importing unreleased main into your app. Also moved around some test-related things. |
Contributor
Author
Thank you very much.
Got it. |
This was referenced Jan 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For pwru cilium/pwru#451, I'm going to inspect some inner details of bpf progs with LBR. But it requires the JITed info of bpf prog.
Then, expose more prog jited info: