1. dmesg
dmesg命令,使用方法很简单,就是
dmesg
可以查看本次启动的内核信息。
注意,dmesg中的时间使用的是librt库中定义的CLOCK_MONOTONIC,使用时需要-lrt。
struct timespec abstime;
clock_gettime(CLOCK_MONOTONIC, &abstime);
//(int)abstime.tv_sec
//(int)abstime.tv_nsec / 1000
2. netconsole
将日志发送到远程,适合没有本地日志存储的系统。
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/netconsole.txt?id=HEAD
2.1 服务端启动
n