Current Linux Kernel debugging techniques

后端 未结 5 1640
遇见更好的自我
遇见更好的自我 2021-02-02 11:34

A linux machine freezes few hours after booting and running software (including custom drivers). I\'m looking a method to debug such problem. Recently, there has been significan

5条回答
  •  醉梦人生
    2021-02-02 12:20

    How I debug this kind of bug, was to run my OS inside the VirtualBox, and compile the kernel with kgdb builtin. Then I setup a serial console on the VirtualBox so that I can gdb to the kernel inside the VirtualBox's OS via the serial console. Anytime the OS hang, just like magic sysrq key, I can enter ctrl-c on the gdb to stop and understand the kernel at that point in time.

    Normally kernel stack tracing is just too difficult to pinpoint the culprit process, so the best way I think is still generic "top" command, just looking at the application logs to see what are the cause of hanging - this will need a reboot to see the log of course.

提交回复
热议问题