
[<XXXXXXXX>]
當核心模組導致 oops 時,如何在呼叫追蹤中顯示位址?我一直在尋找一些內核配置選項,但運氣不佳。
我的 dmesg 輸出
...
[26246.257523] Call Trace:
[26246.257530] do_one_initcall+0x59/0x240
[26246.257540] do_init_module+0x5c/0x230
[26246.257545] load_module+0x2725/0x29e0
[26246.257556] ? __do_sys_finit_module+0xbb/0x120
[26246.257560] __do_sys_finit_module+0xbb/0x120
[26246.257567] do_syscall_64+0x4e/0x150
[26246.257573] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[26246.257577] RIP: 0033:0x7f3680ff5f8d
...
其他一些帶有地址的 dmesg 輸出
...
Call Trace:
[<c010102d>] ? _stext+0x2d/0x170
[<c01708e4>] ? __vunmap+0xa4/0xf0
[<c0170981>] ? vfree+0x21/0x30
[<c014b698>] ? load_module+0x19b8/0x1a40
[<c035e965>] ? __mutex_unlock_slowpath+0xd5/0x140
[<c0140da6>] ? trace_hardirqs_on_caller+0x106/0x150
[<c014b7aa>] ? sys_init_module+0x8a/0x1b0
[<c0140da6>] ? trace_hardirqs_on_caller+0x106/0x150
[<c0240a08>] ? trace_hardirqs_on_thunk+0xc/0x10
[<c0103407>] ? sysenter_do_call+0x12/0x43
...
編輯:適用於核心版本 4.19。根據這個頁面https://www.kernel.org/doc/html/v4.19/admin-guide/bug-hunting.html,我認為它應該在調試內核中可見,但是 DEBUG_KERNEL、DEBUG_INFO、KALLSYMS 和 KALLSYMS_ALL 對我來說都已打開。
edit2:如果我查看 dumpstack.c 中的程式碼,我開始認為它是在較舊的核心中列印的,而在較新的核心中不再列印