查看设备的CPU信息:/proc/cpuinfo

1.查看命令:

cat /proc/cpuinfo

2.ARM架构芯片

~ # cat /proc/cpuinfo 
processor       : 0
model name      : ARMv7 Processor rev 1 (v7l)
BogoMIPS        : 2793.47
Features        : half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x4
CPU part        : 0xc09
CPU revision    : 1

processor       : 1
model name      : ARMv7 Processor rev 1 (v7l)
BogoMIPS        : 2793.47
Features        : half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x4
CPU part        : 0xc09
CPU revision    : 1

Hardware        : MStar Infinity2 (Flattened Device Tree)
Revision        : 0000
Serial          : 0000000000000000

(1)BogoMIPS:MIPS是millions of instructions per second(百万条指令每秒)的缩写,其代表CPU的运算速度,是cpu性能的重要指标。Bogomips是Linux操作系统中衡量计算机处理器运行速度的的一种尺度,在linux和uClinux启动过程中,是通过calibrate_delay()函数计算出来的。只能用来粗略计算处理器的性能,并不十分精确
(2)processor:处理核的编号,从上面的信息可知该CPU是双核;
(3)model name:CPU的名字,由上可知是个ARMv7内核的CPU;
(4)CPU implementer:ARM 架构 cpu.h;
(5)CPU architecture:基于ARM公司开发的精简指令集架构的指令集架构
(6)CPU part :[ARM_CPU_PART_CORTEX_A53 架构 cputype.h]
(7)CPU revision:CPU的版本
(8)Hardware:硬件版本号;

3、X86架构芯片

root@Storage:~# cat /proc/cpuinfo 
processor       : 0
vendor_id       : HygonGenuine
cpu family      : 24
model           : 0
model name      : Hygon C86 3135  4-core Processor
stepping        : 2
microcode       : 0x900007
cpu MHz         : 3499.648
cache size      : 512 KB
physical id     : 0
siblings        : 8
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca
bugs            : sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 6400.24
TLB size        : 2560 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate eff_freq_ro [13] [14]

········

processor       : 7
vendor_id       : HygonGenuine
cpu family      : 24
model           : 0
model name      : Hygon C86 3135  4-core Processor
stepping        : 2
microcode       : 0x900007
cpu MHz         : 3499.941
cache size      : 512 KB
physical id     : 0
siblings        : 8
core id         : 5
cpu cores       : 4
apicid          : 11
initial apicid  : 11
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca
bugs            : sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 6400.24
TLB size        : 2560 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate eff_freq_ro [13] [14]

4、内容解读

对此款芯片的简单总结:芯片型号是"Hygon C86 3135",拥有4个物理处理核,8个逻辑处理核(使用超线程技术),CPU主频是3499.941MHZ,二级缓存大小是512KB。
(1)processor :系统中逻辑处理核的编号。对于单核处理器,则课认为是其CPU编号,对于多核处理器则可以是物理核、或者使用超线程技术虚拟的逻辑核
(2)vendor_id :CPU制造商
(3)cpu family :CPU产品系列代号
(4)model   :CPU属于其系列中的哪一代的代号
(5)model name:CPU属于的名字及其编号、标称主频
(6)stepping  :CPU属于制作更新版本
(7)cpu MHz  :CPU的实际使用主频
(8)cache size :CPU二级缓存大小
(9)physical id :单个CPU的标号
(10)siblings :单个CPU逻辑物理核数
(11)core id :当前物理核在其所处CPU中的编号,这个编号不一定连续
(12)cpu cores :该逻辑核所处CPU的物理核数
(13)apicid :用来区分不同逻辑核的编号,系统中每个逻辑核的此编号必然不同,此编号不一定连续
(14)fpu :是否具有浮点运算单元(Floating Point Unit)
(15)fpu_exception :是否支持浮点计算异常
(16)cpuid level :执行cpuid指令前,eax寄存器中的值,根据不同的值cpuid指令会返回不同的内容
(17)wp :表明当前CPU是否在内核态支持对用户空间的写保护(Write Protection)
(18)flags :当前CPU支持的功能
(19)bogomips :在系统内核启动时粗略测算的CPU速度(Million Instructions Per Second)
(20)clflush size :每次刷新缓存的大小单位
(21)cache_alignment :缓存地址对齐单位
(22)address sizes :可访问地址空间位数
(23)power management :对能源管理的支持,有以下几个可选支持功能:

5、易混淆的概念

\物理CPU个数(physical id)、逻辑核个数(processor)、单个CPU的物理核数(cpu cores)、单个CPU逻辑物理核数(siblings)。
(1)物理CPU个数:就是设备里存在几个CPU,此设备里就只有一颗“Hygon C86 3135”型号的CPU;
(2)物理核:实实在在物理上的核心,比如这款芯片就只有4个核,这是芯片的物理特性,是不能通过编程改变的;
(3)逻辑核:通过软件上的一些技术,让使用者在逻辑上拥有超过物理核个数的处理核。比如此款芯片只有4和物理核,但是逻辑核却有8个,对应使用此款芯片的人来说就好像这是一款拥有8核心的CPU,实际芯片只有4核。让4个物理核变8个逻辑核,涉及到超线程技术,简单理解就是把一个核当两个核用。
(4)单个CPU的物理核数:每个CPU拥有的物理核个数;
(5)单个CPU逻辑物理核数CPU在逻辑上拥有的处理核个数,逻辑核和物理核有可能相等,也可能不相等;相等:此时没有超线程等技术;不相等:使用超行程等技术,将物理核进行拓展,比如此款芯片就将4个物理核拓展为8个逻辑核;

6、快捷的查询命令

(1)查看CPU型号:cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
(2)查看物理CPU个数:cat /proc/cpuinfo | grep “physical id” | sort | uniq | wc -l
(3)查看每个物理CPU的core数:cat /proc/cpuinfo | grep “cpu cores” | uniq
(4)查看逻辑CPU的个数:cat /proc/cpuinfo | grep “processor” | wc -l

猜你喜欢

转载自blog.csdn.net/weixin_42031299/article/details/121781651
今日推荐