Linux Command dmesg - 检查和控制内核的环形缓冲区

dmesg(diagnostic message)

dmesg命令被用于检查和控制内核的环形缓冲区。kernel会将开机信息存储在ring buffer中。您若是开机时来不及查看信息,可利用dmesg来查看。开机信息保存在/var/log/dmesg文件里。

参数

-c:显示信息后,清除ring buffer中的内容;
-s<缓冲区大小>:预设置为8196,刚好等于ring buffer的大小;
-n:设置记录信息的层级。

例子
:dmesg | head
[    0.000000] Linux version 4.15.0-88-generic (buildd@lgw01-amd64-036) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #88-Ubuntu SMP Tue Feb 11 20:11:34 UTC 2020 (Ubuntu 4.15.0-88.88-generic 4.15.18)
[    0.000000] Command line: 
[    0.000000] KERNEL supported cpus:
[    0.000000]   Intel GenuineIntel
[    0.000000]   AMD AuthenticAMD
[    0.000000]   Centaur CentaurHauls
[    0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x008: 'MPX bounds registers'

查看IO支持的调度:

:dmesg | grep -i scheduler
[    0.571636] io scheduler noop registered
[    0.571637] io scheduler deadline registered
[    0.571654] io scheduler cfq registered (default)
发布了231 篇原创文章 · 获赞 13 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/LU_ZHAO/article/details/105038777