Obviously, we can use dump_stack() in Linux Kernel to get the call stack information, but I found the inline function information is lacking in the output of dump_stack().
For example:
The call stack is:
dont_mount include/linux/dcache.h:355 [inline]
vfs_unlink+0x269/0x3b0
do_unlinkat+0x28a/0x4d0
__do_sys_unlink fs/namei.c:3945 [inline]
__se_sys_unlink fs/namei.c:3943 [inline]
__x64_sys_unlink+0x2c/0x30
do_syscall_64+0x39/0x80
entry_SYSCALL_64_after_hwframe+0x44/0xa9
But through dump_stack(), I can only get this:
vfs_unlink+0x269/0x3b0
do_unlinkat+0x28a/0x4d0
__x64_sys_unlink+0x2c/0x30
do_syscall_64+0x39/0x80
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Obviously, inline functions are missing, when I look at the source code of the implementation of dump_stack(), seems the inline functions are not within the kernel_text_address().
Is there any way to get the ** call stack including the inline function calls **?
I tried to use compile option -fno-inline to disable inlining function, but then kernel failed to be compiled. Seems not a good idea.
question from:
https://stackoverflow.com/questions/65946350/how-to-add-inline-function-info-in-dump-stack-of-linux-kernel 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…