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

add module.GetSymbolByAddr / GetDemangleSymbolByAddr #232

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

weixingsun
Copy link

just added the funcs as I cannot find it anywhere else, thanks

add GetSymbolByAddr/GetDemangleSymbolByAddr
bccSymbolByAddr(addr uint64, pid int, demangle int) string
@holmanb
Copy link

holmanb commented Feb 26, 2021

Based on libbpf's source code and the code iovisor/bcc/src/python/bcc/__init__.py, this approach looks correct. Additionally I tested this out (example below) against the latest commit and it appears to work correctly. If we could get this merged in I would say that we can close #273.

An additional wrapper named something like GetKSymbolByAddr() that defaults to pid=-1 would be a nice addition for users grabbing kernel symbols, but I don't have issues with it as is either.

func main() {
        var addr uint64 = 0xffffffffc245a8c0
        m := NewModule(source, []string{})
        defer m.Close()
        fmt.Println("symbol name:", m.GetSymbolByAddr(addr,-1))
}

@maxgio92
Copy link

Hi @weixingsun @holmanb,
I can confirm that this works for me too, for kernel symbols.
I didn't have the chance to make it work for user-defined symbols.

I tested it against the latest version of gobpf (my up-to-date fork).

@holmanb
Copy link

holmanb commented Oct 25, 2023

@maxgio92 bummer that this didn't land. The last commit in this repo is over a year ago, and lots of PRs and Issues filed are completely ignored. This project is dead.

@schu @chantra @iaguis @alban There was an offer to take over maintainership. Alternatively @vietanhduong appears to have a fork that has been landing old PRs, maybe they have interest in maintainership. Do any former contributors care to see this project live on? Handing over control to an active maintainer would be good stewardship. Alternatively, marking the project as no longer maintained would tell users to look towards an actively maintained project rather than wasting effort on an abandoned one.

@maxgio92
Copy link

@holmanb I see.
I agree with you about the fact that for clarity with the community, it might be better either to mark this project as no longer maintained, or the maintainership be taken over as you mentioned.

Maybe also @itaysk could provide some insights.

Thank you all

@itaysk
Copy link
Contributor

itaysk commented Oct 28, 2023

Hi, Although I made a few contributions to this project, I'm not associated with it and definitely not a maintainer here. I am associated with a competing project: https://github.com/aquasecurity/libbpfgo

@iaguis
Copy link
Collaborator

iaguis commented Oct 31, 2023

Hey! As you see, the current maintainers don't have time to work on this project, so I talked with @alban and others in the team and we were converging on the following plan:

What do people think? Would it cover your use cases? If you think that makes sense, a review of iovisor/bcc#4449 would help.

@maxgio92
Copy link

maxgio92 commented Nov 7, 2023

Sorry for the misunderstanding @itaysk.
I definitely agree @iaguis, it would make sense IMHO

@AeroNotix
Copy link

What steps are needed to proceed with the merge?

Are there specific tasks that must be addressed first? It seems there are outstanding questions regarding the absence of tests and concerns about the quality of existing tests compared to other supported platforms in the repository.

@vietanhduong
Copy link

Hi everyone,

I'm starting to build a new project to wrap up Cilium/eBPF in pure Go. It has a similar structure to the gobpf repository. You can take a look at it here: https://github.com/vietanhduong/wbpf.

If you prefer to stick with gobpf, you can choose this one: https://github.com/vietanhduong/go-bpf. I've also updated some features in it.

Feel free to contribute. Thank you, guys!

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

Successfully merging this pull request may close these issues.

8 participants