dmesg(display message或者driver message)是Linux系统中用于显示内核启动信息和运行时状态的命令。在dmesg的输出中,关于CPU的信息通常包括以下几个方面:
以下是一个简化的dmesg输出示例,展示了部分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=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 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] CPU: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (68 95 9 0 0 0)
[ 0.000000] On another node:
[ 0.000000] CPU: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (68 95 9 0 0 0)
...
[ 0.000000] CPU: Physical Processor ID 0
[ 0.000000] CPU: Processor Core ID 0
...
[ 0.000000] CPU: Logical Processor ID 0
[ 0.000000] smpboot: CPU0: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (family: 0x6, model: 0x9e, stepping: 0x9)
[ 0.000000] Performance Events: PEBS fmt3+, Hallmark event, 32-deep LBR, full-width counters, Intel PMU driver.
...
Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz68 95 9 0 0 0可以推断出是6核12线程(每个物理核心有两个逻辑核心)。dmesg的输出可能会因系统和硬件的不同而有所差异。lscpu)来获取更详细的解释。通过分析dmesg中的CPU信息,可以帮助诊断硬件兼容性问题、性能瓶颈以及潜在的系统故障。