最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

linux - Crash tool analysis : Debug out of tree modules - Stack Overflow

programmeradmin0浏览0评论

I'm working on a kernel module that extends the functionality of an existing module, such as ufs.ko. When I encounter a crash in my driver, I get a vmcore file, which I load into the crash tool. However, the tool links to the kernel debug info package, which is built from a different source code than the one I am working on. This makes it difficult to debug the issue properly because the source code of the modified module (e.g., ufs.ko) is not the same as the kernel debug info package that crash is linking to. Goal:

What I need to know is whether it’s possible to link the .ko file (the one I’ve modified) with the source code of my changes. Specifically, I want to load the correct version of the kernel module (with my changes) for debugging, so that I can correlate the crash to the exact changes I’ve made in the source code. Example:

For instance, if I modified the ufs.ko module by adding a new function, but when a crash occurs, I can only see the debug info from the generic ufs.ko module in the kernel debug info package. This is not the same as my customized version, which makes it difficult to pinpoint the exact line of code that caused the crash.

crash /usr/lib/debug/lib/modules/5.14.0-427.13.1.el9_4/vmlinux /var/crash/vmcore

crash> mod -s ufs /path/to/custom/ufs.ko

bt
#0  [ffffbb0dcfaabbd0] machine_kexec at ffffffff9a2781a7
#1  [ffffbb0dcfaabb28] __crash_kexec at ffffffff9a3ef4ea
#2  [ffffbb0dcfaabbe8] crash_kexec at ffffffff9a3f0778
...
#8  [ffffbb0dcfaabd70] my_modified_function in ufs.ko at ffffffffc1246162

crash> dis ffffffffc1246162

this doesn't lead me to correct lines in source code. because this is linked with the debuginfo package source code.

How can i setup the source corresponding to custom .ko file

发布评论

评论列表(0)

  1. 暂无评论