一、内核中
To print the stack contents and a backtrace to the kernel log, use the
#include <linux/kernel.h>
dump_stack();
二、应用
ref:
linux device driver - How to include C backtrace in a kernel module code? - Stack Overflow
linux内核中打印栈回溯信息 - dump_stack()函数分析_落尘纷扰的博客-CSDN博客_dump stack