Skip to content

debuginfo: Find vmlinux at other locations #166

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

Merged
merged 1 commit into from
Jun 12, 2025

Conversation

Asphaltt
Copy link
Contributor

@Asphaltt Asphaltt commented Jun 5, 2025

On some distributions (e.g., Ubuntu), vmlinux may not reside in the modules directory. Search common locations for vmlinux, as referenced in: https://github.com/anakryiko/retsnoop/blob/389e2c9ddfc686ee048b063ce0c17b94b55398d2/src/retsnoop.c#L59-L67

Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Jun 5, 2025
@brenns10
Copy link
Member

brenns10 commented Jun 5, 2025

Hi @Asphaltt, I'm actually gearing up to completely revamp this section of drgn-tools. Since drgn 0.0.31, drgn's Module API does a really great job of finding debug info -- and especially, allowing the user to customize the process. So in my development branch, we're dropping most of the code that searches the "standard directories" for debuginfo, and just relying on drgn to do that. We'll provide some extra logic for some things that may be a bit more specific to Oracle Linux, but lookups in the standard paths will use drgn's standard logic, and thus should work well on any distro without modification.

I'm also really curious, are there any specific helpers or tools you're using out of drgn-tools? I didn't know anybody outside Oracle was using it, and if there are rough edges I can help smooth out (including the debuginfo, which I'll do my best to get the changes out quickly), I would be glad to help.

@brenns10
Copy link
Member

brenns10 commented Jun 5, 2025

That said, the changes here look very reasonable, so I wouldn't have any problem including them before those changes I mentioned land.

@Asphaltt
Copy link
Contributor Author

Asphaltt commented Jun 5, 2025

Thanks for these great drgn tools — honestly, they're the best alternatives to crash I've seen. Otherwise, I have to build some of these myself.

I'm actually gearing up to completely revamp this section of drgn-tools.

That’s great to hear. I'm looking forward to seeing the improvements!

Are there any specific helpers or tools you're using out of drgn-tools?

Not yet. When I first explored these tools on Ubuntu, I ran into an issue:

$ sudo corelens /proc/kcore -M sys
warning: Running corelens against a live system.
         Data may be inconsistent, or corelens may crash.
error: could not find debuginfo (tried DWARF)

I had to fix that first before I could start using them properly.

And with that, here’s the PR.

Copy link

Thank you for signing the OCA.

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Jun 6, 2025
Copy link
Member

@brenns10 brenns10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With pre-commit fixes, this looks good to me.

On some distributions (e.g., Ubuntu), vmlinux may not reside in the modules directory.
Search common locations for vmlinux, as referenced in:
https://github.com/anakryiko/retsnoop/blob/389e2c9ddfc686ee048b063ce0c17b94b55398d2/src/retsnoop.c#L59-L67

Signed-off-by: Leon Hwang <[email protected]>
@Asphaltt Asphaltt force-pushed the fix/debuginfo/vmlinux branch from 9f31800 to c68f1e1 Compare June 7, 2025 04:58
@brenns10 brenns10 merged commit 42c936e into oracle-samples:main Jun 12, 2025
4 checks passed
@brenns10
Copy link
Member

Thank you! If you'd like, I can mention you on the PR for the broader changes to debuginfo loading, so you can have a look yourself.

@Asphaltt
Copy link
Contributor Author

If you'd like, I can mention you on the PR for the broader changes to debuginfo loading, so you can have a look yourself.

Seems cool. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants