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

read/elf: Make it easier to parse ELF notes from /sys/kernel/notes #511

Closed
mstange opened this issue Feb 10, 2023 · 2 comments · Fixed by #533
Closed

read/elf: Make it easier to parse ELF notes from /sys/kernel/notes #511

mstange opened this issue Feb 10, 2023 · 2 comments · Fixed by #533

Comments

@mstange
Copy link
Contributor

mstange commented Feb 10, 2023

Here's some code which reads the kernel's ELF build ID by parsing /sys/kernel/notes: https://github.com/mstange/samply/blob/1d71084e3054a9d2b6bd9a399cfcd659f937f613/samply/src/linux_shared/kernel_symbols.rs#L34-L38

I had to copy the NoteIterator code into this file because IIRC there was no public API to construct it.

Edit: fixed link

@philipc
Copy link
Contributor

philipc commented Mar 31, 2023

I assume you meant to link to https://github.com/mstange/samply/blob/1d71084e3054a9d2b6bd9a399cfcd659f937f613/samply/src/linux_shared/kernel_symbols.rs.

Is adding a public API to construct it enough to close this issue?

@mstange
Copy link
Contributor Author

mstange commented Apr 4, 2023

Hah, yes, you found the right link. Yes, adding a public API for NoteIterator would be enough to close this issue.

And maybe a doc comment which says whether to pass 4 or 8 to the align argument when using it with /sys/kernel/notes - I didn't actually check how that works.

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 a pull request may close this issue.

2 participants