Is there a way to get kernel previous debug information after kernel crash occurs.
I am trying to develop a kernel module which basically captures IP packets in the
Actually, the crash information (dmesg) is present in the location /var/crash/. Here we have the folders for every system crash. Folder names like 127.0.0.1-date-time. vmcore-dmesg.txt are present inside the folders. From these file, we have get the dmesg which are executed before the crash.
GNOME Logs is a very useful software for that. You can limit the log messages to the last session and easily read what the last messages before the crash were.
Actually, the /var/log/dmesg file contains the current boot print message log. The /var/log/kern.log file contains your previous boot kernel print message log in Ubuntu. In other Linux flavours it will contain in the /var/log/messages file in Fedora, etc..
Kernel log messages can be viewed in /var/log/dmesg
files even after restart of the system.
There will be so many files with dmesg.X, and those files are previous kernel logs. dmesg
is the latest file.
See difference between dmesg and /var/log/kern.log
You could try to interact with your hung system by entering magic SysRq key sequences via your keyboard or a serial console.
Recent versions of Linux support crash dumps. When successful, these will include a full dump of memory, including kernel log messages and stack traces.