How to print the current thread stack trace inside the Linux kernel?

后端 未结 2 469
清歌不尽
清歌不尽 2020-12-29 11:02

I would like to be able to print the stack trace of a thread in the Linux kernel.

In details: I want to add code to specific functions (e.g. swap_writepage()<

2条回答
  •  清酒与你
    2020-12-29 12:03

    Linux kernel has very well known function called dump_stack() here, which prints the content of the stack. Place it in your function in according to see stack info.

提交回复
热议问题