1. 程式人生 > 遊戲 >《拳皇15》角色新影像:人氣女傭兵莉安娜閃耀登場

《拳皇15》角色新影像:人氣女傭兵莉安娜閃耀登場

檢視CPU詳細資訊

在Linux伺服器上檢視CPU詳細資訊:
cat /proc/cpuinfo
輸出結果:

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 62
model name      : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
stepping        : 4
microcode       : 0x428
cpu MHz         : 1200.062
cache size      : 20480 KB
physical id     : 0
siblings        : 16
core id         : 0
cpu cores       : 8
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 dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt
bogomips        : 5200.34
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

上面只截取了一部分資訊,
完整的CPU資訊請參考文末附錄,
這個命令輸出了太多的冗餘資訊不方便檢視,
下面介紹的命令以該Linux輸出的CPU資訊為例,
可以很方便的知道當前系統CPU的特定資訊。

檢視物理CPU的個數

cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
輸出結果:
2
表示Linux伺服器上面實際安裝了2個物理CPU晶片。

檢視物理CPU核心的個數

cat /proc/cpuinfo | grep "cpu cores" | uniq
輸出結果:
cpu cores : 8
表示1個物理CPU裡面有8個物理核心。

檢視所有邏輯CPU的個數

cat /proc/cpuinfo | grep "processor" | wc -l
輸出結果:
32
表示Linux伺服器一共有32個邏輯CPU。

檢視每個物理CPU中邏輯CPU的個數

cat /proc/cpuinfo | grep 'siblings' | uniq
輸出結果:
siblings : 16
表示每個物理CPU中有16個邏輯CPU,
一共有2個物理CPU,
所以總共有32個邏輯CPU,
和第5步中檢視的結果一致。

查詢CPU是否啟用超執行緒

cat /proc/cpuinfo | grep -e "cpu cores" -e "siblings" | sort | uniq
輸出結果:
cpu cores : 8
siblings : 16
看到cpu cores數量是siblings數量一半,說明啟動了超執行緒。
如果cpu cores數量和siblings數量一致,則沒有啟用超執行緒。

輸出項的含義

cpuinfo輸出了詳細的資訊,
可以看到CPU具體型號等各種引數,
下面說明各個輸出項的含義:

輸出項含義
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 可訪問地址空間位數