How to include C backtrace in a kernel module code?

后端 未结 4 1766
遥遥无期
遥遥无期 2021-02-01 04:13

So I am trying to find out what kernel processes are calling some functions in a block driver. I thought including backtrace() in the C library would make it easy. But I am havi

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-01 04:50

    To print the stack contents and a backtrace to the kernel log, use the dump_stack() function in your kernel module. It's declared in linux/kernel.h in the include folder in the kernel source directory.

提交回复
热议问题