在Linux系统中,提供了proc文件系统显示系统的软硬件信息。如果想了解系统中CPU的提供商和相关配置信息,则可以通过/proc/cpuinfo文件得到。本文章针对该文件进行简单的总结。

基于不同指令集(ISA)的CPU产生的/proc/cpuinfo文件不一样,基于X86指令集CPU的/proc/cpuinfo文件包含如下内容:

# cat /proc/cpuinfo
processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Xeon(R) CPU E5- @ .40GHz
stepping :
cpu MHz : 2400.000
cache size : KB
physical id :
siblings :
core id :
cpu cores :
apicid :
initial apicid :
fpu : yes
fpu_exception : yes
cpuid level :
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave avx hypervisor lahf_lm arat epb xsaveopt pln pts dts
bogomips : 4800.00
clflush size :
cache_alignment :
address sizes : bits physical, 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支持的功能,CUP信息中flags各项含义

fpu: Onboard (x87) Floating Point Unit

vme: Virtual Mode Extension

de: Debugging Extensions

pse: Page Size Extensions

tsc: Time Stamp Counter: support for RDTSC and WRTSC instructions

msr: Model-Specific Registers

pae: Physical Address Extensions: ability to access 64GB of memory; only 4GB can be accessed at a time though

mce: Machine Check Architecture

cx8: CMPXCHG8 instruction

apic: Onboard Advanced Programmable Interrupt Controller

sep: Sysenter/Sysexit Instructions; SYSENTER is used for jumps to kernel memory during system calls, and SYSEXIT is used for jumps: back to the user code

mtrr: Memory Type Range Registers

pge: Page Global Enable

mca: Machine Check Architecture

cmov: CMOV instruction

pat: Page Attribute Table

pse36: 36-bit Page Size Extensions: allows to map 4 MB pages into the first 64GB RAM, used with PSE.

pn: Processor Serial-Number; only available on Pentium 3

clflush: CLFLUSH instruction

dtes: Debug Trace Store

acpi: ACPI via MSR

mmx: MultiMedia Extension

fxsr: FXSAVE and FXSTOR instructions

sse: Streaming SIMD Extensions. Single instruction multiple data. Lets you do a bunch of the same operation on different pieces of input: in a single clock tick.

sse2: Streaming SIMD Extensions-2. More of the same.

selfsnoop: CPU self snoop

acc: Automatic Clock Control

IA64: IA-64 processor Itanium.

ht: HyperThreading. Introduces an imaginary second processor that doesn’t do much but lets you run threads in the same process a  bit quicker.

nx: No Execute bit. Prevents arbitrary code running via buffer overflows.

pni: Prescott New Instructions aka. SSE3

vmx: Intel Vanderpool hardware virtualization technology

svm: AMD “Pacifica” hardware virtualization technology

lm: “Long Mode,” which means the chip supports the AMD64 instruction set

tm: “Thermal Monitor” Thermal throttling with IDLE instructions. Usually hardware controlled in response to CPU temperature.

tm2: “Thermal Monitor 2″ Decrease speed by reducing multipler and vcore.

est: “Enhanced SpeedStep”

bogomips

 在系统内核启动时粗略测算的CPU速度(Million Instructions Per Second)

clflush size

 每次刷新缓存的大小单位

cache_alignment

 缓存地址对齐单位

address sizes

 可访问地址空间位数

power management

对能源管理的支持,有以下几个可选支持功能:

  ts:  temperature sensor

  fid:   frequency id control

  vid:  voltage id control

  ttp:  thermal trip

  tm:

  stc:

  100mhzsteps:

  hwpstate:

根据以上内容,我们则可以很方便的知道当前系统关于CPU、CPU的核数、CPU是否启用超线程等信息。

例1:查询系统具有多少个逻辑核

# cat /proc/cpuinfo | grep 'processor' | wc -l

说明:processor表示系统中逻辑核编号,wc -l统计行数,由此得到逻辑核个数

例2:查询系统CPU的物理核数

# cat /proc/cpuinfo | grep 'cpu cores' | uniq
cpu cores :

说明:cpu cores表示逻辑核所处cpu的物理核数目,uniq表示去重,由此得到一个cup物理核的数目

例3:查询系统CPU是否启用超线程

DEV:/home/mak_sn> cat /proc/cpuinfo | grep -e 'cpu cores'  -e 'siblings' | sort | uniq
cpu cores :
siblings :

说明:

1.如果cpu cores数量和siblings数量一致,则没有启用超线程,否则超线程被启用。

2.cup cores表示cpu物理核,siblings表示逻辑物理核,grep -e表示多个条件或,选出来的结果先sort排序,然后uniq去重。

例4:查询系统CPU的个数

# cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l

说明:physical id表示单个cpu的标号,排序去重,然后统计行数,得到系统cpu的个数。

查询系统CPU是否支持某项功能,则根以上类似,输出结果进行sort, uniq和grep就可以得到结果。

【/proc/cpuinfo内容举例】

,Intel(R) Xeon(R) X5355
processor  :
vendor_id  : GenuineIntel
cpu famil  :
model     :
model name  : Intel(R) Xeon(R) CPU X5355 @ .66GHz
stepping   :
cpu MHz   : 2666.766
cache size : KB
physical id :
siblings   :
core id   :
cpu cores  :
fpu      : yes
fpu_exception  : yes
cpuid level   :
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 lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm
bogomips : 5338.26
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Xeon(R) CPU X5355 @ .66GHz
stepping :
cpu MHz : 2666.766
cache size : KB
physical id :
siblings :
core id :
cpu cores :
fpu : yes
fpu_exception : yes
cpuid level :
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 lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm
bogomips : 5333.75
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Xeon(R) CPU X5355 @ .66GHz
stepping :
cpu MHz : 2666.766
cache size : KB
physical id :
siblings :
core id :
cpu cores :
fpu : yes
fpu_exception : yes
cpuid level :
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 lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm
bogomips : 5333.67
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Xeon(R) CPU X5355 @ .66GHz
stepping :
cpu MHz : 2666.766
cache size : KB
physical id :
siblings :
core id :
cpu cores :
fpu : yes
fpu_exception : yes
cpuid level :
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 lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm
bogomips : 5333.68
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Xeon(R) CPU X5355 @ .66GHz
stepping :
cpu MHz : 2666.766
cache size : KB
physical id :
siblings :
core id :
cpu cores :
fpu : yes
fpu_exception : yes
cpuid level :
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 lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm
bogomips : 5333.67
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Xeon(R) CPU X5355 @ .66GHz
stepping :
cpu MHz : 2666.766
cache size : KB
physical id :
siblings :
core id :
cpu cores :
fpu : yes
fpu_exception : yes
cpuid level :
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 lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm
bogomips : 5333.68
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Xeon(R) CPU X5355 @ .66GHz
stepping :
cpu MHz : 2666.766
cache size : KB
physical id :
siblings :
core id :
cpu cores :
fpu : yes
fpu_exception : yes
cpuid level :
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 lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm
bogomips : 5333.69
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Xeon(R) CPU X5355 @ .66GHz
stepping :
cpu MHz : 2666.766
cache size : KB
physical id :
siblings :
core id :
cpu cores :
fpu : yes
fpu_exception : yes
cpuid level :
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 lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm
bogomips : 5333.68
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management:
, Intel(R) Core(TM) i7 @ .80GHz
processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Core(TM) i7 CPU @ .80GHz
stepping :
cpu MHz : 2807.024
cache size : KB
fpu : yes
fpu_exception : yes
cpuid level :
wp : yes
flags : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nonstop_tsc aperfmperf pni est ssse3 cx16 sse4_1 sse4_2 popcnt hypervisor lahf_lm ida
bogomips : 5614.04
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Core(TM) i7 CPU @ .80GHz
stepping :
cpu MHz : 2807.024
cache size : KB
fpu : yes
fpu_exception : yes
cpuid level :
wp : yes
flags : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nonstop_tsc aperfmperf pni est ssse3 cx16 sse4_1 sse4_2 popcnt hypervisor lahf_lm ida
bogomips : 5614.04
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Core(TM) i7 CPU @ .80GHz
stepping :
cpu MHz : 2807.024
cache size : KB
fpu : yes
fpu_exception : yes
cpuid level :
wp : yes
flags : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nonstop_tsc aperfmperf pni est ssse3 cx16 sse4_1 sse4_2 popcnt hypervisor lahf_lm ida
bogomips : 5614.04
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Core(TM) i7 CPU @ .80GHz
stepping :
cpu MHz : 2807.024
cache size : KB
fpu : yes
fpu_exception : yes
cpuid level :
wp : yes
flags : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nonstop_tsc aperfmperf pni est ssse3 cx16 sse4_1 sse4_2 popcnt hypervisor lahf_lm ida
bogomips : 5614.04
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Core(TM) i7 CPU @ .80GHz
stepping :
cpu MHz : 2807.024
cache size : KB
fpu : yes
fpu_exception : yes
cpuid level :
wp : yes
flags : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nonstop_tsc aperfmperf pni est ssse3 cx16 sse4_1 sse4_2 popcnt hypervisor lahf_lm ida
bogomips : 5614.04
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Core(TM) i7 CPU @ .80GHz
stepping :
cpu MHz : 2807.024
cache size : KB
fpu : yes
fpu_exception : yes
cpuid level :
wp : yes
flags : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nonstop_tsc aperfmperf pni est ssse3 cx16 sse4_1 sse4_2 popcnt hypervisor lahf_lm ida
bogomips : 5614.04
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Core(TM) i7 CPU @ .80GHz
stepping :
cpu MHz : 2807.024
cache size : KB
fpu : yes
fpu_exception : yes
cpuid level :
wp : yes
flags : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nonstop_tsc aperfmperf pni est ssse3 cx16 sse4_1 sse4_2 popcnt hypervisor lahf_lm ida
bogomips : 5614.04
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management: processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Core(TM) i7 CPU @ .80GHz
stepping :
cpu MHz : 2807.024
cache size : KB
fpu : yes
fpu_exception : yes
cpuid level :
wp : yes
flags : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nonstop_tsc aperfmperf pni est ssse3 cx16 sse4_1 sse4_2 popcnt hypervisor lahf_lm ida
bogomips : 5614.04
clflush size :
cache_alignment :
address sizes : bits physical, bits virtual
power management:

[转]linux /proc/cpuinfo 文件分析的更多相关文章

  1. /proc/cpuinfo 文件分析(查看CPU信息)

    /proc/cpuinfo文件分析 根据以下内容,我们则可以很方便的知道当前系统关于CPU.CPU的核数.CPU是否启用超线程等信息. <1>查询系统具有多少个逻辑核:cat /proc/ ...

  2. linux /proc/meminfo 文件分析(转载)

    cat /proc/meminfo    读出的内核信息进行解释,下篇文章会简单对读出该信息的代码进行简单的分析. # cat /proc/meminfo MemTotal:     kB MemFr ...

  3. linux /proc/cpuinfo 文件描写叙述

    processor :系统中逻辑处理核的编号.对于单核处理器.则课觉得是其CPU编号,对于多核处理器则能够是物理核.或者使用超线程技术虚拟的逻辑核 vendor_id :CPU制造商 cpu fami ...

  4. 14、/proc/cpuinfo 文件(查看CPU信息)

    转载http://www.cnblogs.com/itcomputer/p/4888438.html /proc/cpuinfo文件分析 根据以下内容,我们则可以很方便的知道当前系统关于CPU.CPU ...

  5. 关于/proc/cpuinfo文件

    以上输出项的含义如下: processor :系统中逻辑处理核的编号.对于单核处理器,则课认为是其CPU编号,对于多核处理器则可以是物理核.或者使用超线程技术虚拟的逻辑核 vendor_id :CPU ...

  6. /proc/cpuinfo文件解读(超易理解)

    在linux系统中,提供了/proc目录下文件,显示系统的软硬件信息.如果想了解系统中CPU的提供商和相关配置信息,则可以查/proc/cpuinfo.但是此文件输出项较多,不易理解.例如我们想获取, ...

  7. Understanding Linux /proc/cpuinfo

    http://www.richweb.com/cpu_info A hyperthreaded processor has the same number of function units as a ...

  8. 对/proc/cpuinfo文件下的各个参数的说明及实践

    我们通常要检查系统的cpu的相关信息,之前在进行查看cpu的信息的时候,我最长用的方式 是,直接将/etc/cpuinfo下的所有的内容进行显示,然后通过对全部文件的查看,来提取我们需要的信息,虽然查 ...

  9. linux /proc/stat 文件说明

    /proc/stat 文件内容 # cat /proc/stat cpu 1411 1322 3070 1193539 2790 0 268 0 0 0 cpu0 472 658 787 297933 ...

随机推荐

  1. ANSI C中关于FILE流的一些

    ANSI C只是一个定义,定义了一个借口与标准,具体实现将是不同的. 刚看到I/O的时候就对于Stream非常的迷惑,这是什么玩意.后面才明白,这只是一个抽象出来的概念而已.对于一个Stream,它具 ...

  2. C语言实现简单线程池(转-Newerth)

    有时我们会需要大量线程来处理一些相互独立的任务,为了避免频繁的申请释放线程所带来的开销,我们可以使用线程池.下面是一个C语言实现的简单的线程池. 头文件: 1: #ifndef THREAD_POOL ...

  3. 在笔记本电脑开通无线WIFI

    1.Windows + R启动运行,输入services.msc进入服务 2.在服务中将Security Center服务从自动启动转为禁止启动 3.在服务中将Windows Firewall的启动类 ...

  4. Sporadic IOException: Failed to persist config

    问题 在调用Jenkins API来更新Job的时候报错‘Sporadic IOException: Failed to persist config’. 原因 https://issues.jenk ...

  5. QTreeWidget创建

    QTreeWidget.顾名思义,这个类用来展示树型结构.同前面说的QListWidget类似,这个类需要同另外一个辅助类QTreeWidgetItem一同使用.不过,既然是提供方面的封装类,即便是看 ...

  6. cookie,session,sessionid

    cookie,session,sessionid http协议是无状态的,意思是每次请求的状态不会保存.因此,产生了cookie,session之类保存会话状态的机制.1.什么是cookiecooki ...

  7. 设计模式-UML类图的各符号含义(转)

    UML类图的各符号含义 类图基本符号可拆分为虚线,箭头,实线,空心右三角,实心右三角,空心菱形和实心菱形.由这些基本的图形进行组合构成了类图的基本符号.这里要注意这几个符号的顺序,代表了类与类之间关系 ...

  8. java的读文件操作

    java读取文件内容,可以作如下理解: 首先获得一个文件句柄,File file = new File():file即为文件句柄.两人之间联通电话网络了,就可以开始打电话了. 通过这条线路读取甲方的信 ...

  9. java空指针异常 for循环时,使用了值为null的变量

    错误代码: for(Map<String,Object> videoItemMap:learnVideoList){ String videoStuId=MapUtils.getStrin ...

  10. 在AD转换中的过采样和噪声形成

    1. 直接量化的过采样AD转换 此类系统的模型可以用下图表示. 图中xa(t)是输入信号,e(t)是量化引入的噪声,xd[n]是最终得到的数字信号,包含分量xda和xde. 对于M倍过采样,信号与量化 ...