dmesg
(display message或者driver message)是Linux系统中的一个命令,用于显示内核启动信息以及运行时的内核消息。这些消息通常包括硬件检测、驱动加载、系统事件等信息。dmesg
的输出中包含了许多关键参数,以下是一些常见的参数及其含义:
以下是一个dmesg
输出示例:
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 5.4.0-42-generic (buildd@lgw01-amd64-039) (gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)) #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-42-generic root=UUID=xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx ro quiet splash vt.handoff=7
[ 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: xstate_offset[2]: 576, xstate_sizes[2]: 256
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009ffff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000bffaffff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000bffboooo] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000bfff0000-0x00000000bfffffff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x00000000c0000000-0x00000000dfffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000e0000000-0x00000000ffffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000041fffffff] usable
[ 0.000000] NX (Execute Disable) protection: active
[ 0.000000] SMBIOS 2.8 present.
在这个示例中,我们可以看到以下关键参数:
[ 0.000000]
,表示消息产生的时间。Linux version 5.4.0-42-generic
,表示产生消息的内核版本。Initializing cgroup subsys cpuset
,表示具体的消息描述。通过分析dmesg
输出中的这些关键参数,可以帮助我们诊断和解决Linux系统中的问题。