内核崩溃后获取Linux内核调试信息 [英] Getting Linux kernel debug information after a kernel crash

查看:267
本文介绍了内核崩溃后获取Linux内核调试信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

发生内核崩溃后是否有办法获取内核先前的调试信息。

Is there a way to get kernel previous debug information after kernel crash occurs.

我正在尝试开发一个内核模块,该模块基本上捕获内核网络内部IP层中的IP数据包。堆栈,进行一些修改后,我必须将相同的数据包发送回NIC进行传输。

I am trying to develop a kernel module which basically captures IP packets in the IP layer inside the kernel network stack and after some modification I have to send the same packet back to the NIC for transmission.

在所有这些过程中,我都使用 printk()编写调试信息。 。但是,如果出现任何问题并且发生内核故障,我们必须重新启动系统。有没有办法获取我以前的调试信息,因为重启后调试信息不​​存在,因为我尝试通过 dmesg 命令获取它?

During all these processes I'm writing debug information with the help of printk(). But if any thing goes wrong and a kernel failure occurs, we have to restart the system. Is there a way to get my previous debug information, because after rebooting the debug information is not present as I try to get it by dmesg command?

推荐答案

实际上, / var / log / dmesg 文件包含当前的启动打印消息日志。 /var/log/kern.log 文件包含您以前在 Ubuntu 。在其他Linux版本中,它将包含在Fedora等文件的 / var / log / messages 文件中。

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..

这篇关于内核崩溃后获取Linux内核调试信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆