在Linux系統中,提供了proc文件系統顯示系統的軟硬件信息。如果想了解系統中CPU的提供商和相關配置信息,則可以通過/proc/cpuinfo文件得到。本文章針對該文件進行簡單的總結。
基於不同指令集(ISA:Instruction Set Architecture)的CPU產生的/proc/cpuinfo文件不一樣,基於X86指令集CPU的/proc/cpuinfo文件包含如下內容:
processor : 0
vendor_id :GenuineIntel
cpu family :6
model :26
model name :Intel(R) Xeon(R) CPU E5520 @ 2.27GHz
stepping :5
cpu MHz :1600.000
cache size : 8192 KB
physical id :0
siblings :8
core id : 0
cpu cores :4
apicid :0
fpu :yes
fpu_exception :yes
cpuid level : 11
wp :yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx rdtscp lm constant_tsc ida nonstop_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr popcnt lahf_lm
bogomips :4522.12
clflush size :64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management :
以上輸出項的含義如下:
processor :系統中邏輯處理核的編號。對於單核處理器,則課認爲是其CPU編號,對於多核處理器則可以是物理核、或者使用超線程技術虛擬的邏輯核
vendor_id :CPU製造商
cpu family :CPU產品系列代號
model :CPU屬於其系列中的哪一代的代號
model name:CPU屬於的名字及其編號、標稱主頻
stepping :CPU屬於製作更新版本
cpu MHz :CPU的實際使用主頻
cache size :CPU二級緩存大小
physical id :單個CPU的標號
siblings :單個CPU邏輯物理核數
core id :當前物理核在其所處CPU中的編號,這個編號不一定連續
cpu cores :該邏輯核所處CPU的物理核數
apicid :用來區分不同邏輯核的編號,系統中每個邏輯核的此編號必然不同,此編號不一定連續
fpu :是否具有浮點運算單元(Floating Point Unit)
fpu_exception :是否支持浮點計算異常
cpuid level :執行cpuid指令前,eax寄存器中的值,根據不同的值cpuid指令會返回不同的內容
wp :表明當前CPU是否在內核態支持對用戶空間的寫保護(Write Protection)
flags :當前CPU支持的功能
bogomips :在系統內核啓動時粗略測算的CPU速度(Million Instructions Per Second)
clflush size :每次刷新緩存的大小單位
cache_alignment :緩存地址對齊單位
address sizes :可訪問地址空間位數