How to include C backtrace in a kernel module code?

后端 未结 4 1723
遥遥无期
遥遥无期 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:37

    dump_stack() is function can be used to print your stack and thus can be used to backtrack . while using it be carefull that don't put it in repetitive path like loops or packet receive function it can fill your dmesg buffer can cause crash in embedded device (having less memory and cpu).

    This function is declared in linux/kernel.h .

提交回复
热议问题