linux 中查詢 cpu 資料

2013110716:36


# cat /proc/cpuinfo

例如 AWS EC2 Micro Instances 的資料:

processor       : 0      #CPU核心編號,不是指有幾棵CPU
vendor_id       : GenuineIntel
cpu family      : 6
model           : 45
model name      : Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz
stepping        : 7
cpu MHz         : 1795.672
cache size      : 20480 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm up rep_good unfair_spinlock pn
i pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes avx hypervisor lahf_lm
bogomips        : 3591.34
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:



另一個範例 Raspberr PI

Processor       : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 697.95
Features        : swp half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2708
Revision        : 000d
Serial          : 00000000127fd949



雙 CPU 的系統就像這樣
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 62
model name      : Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz

stepping        : 4
cpu MHz         : 2793.298
cache size      : 25600 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu de tsc msr pae cx8 cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm rep_good aperfmperf unfair_spinloc
k pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt aes avx f16c rdrand hypervisor lahf_lm ida arat epb pln pts dts fsgsbase er
ms
bogomips        : 5586.59
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 62
model name      : Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
stepping        : 4
cpu MHz         : 2793.298
cache size      : 25600 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu de tsc msr pae cx8 cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm rep_good aperfmperf unfair_spinloc
k pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt aes avx f16c rdrand hypervisor lahf_lm ida arat epb pln pts dts fsgsbase er
ms
bogomips        : 5586.59
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:



# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
2500000

# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq
1600000



查詢記憶體、記憶體使用狀況

# cat /proc/meminfo


MemTotal:         604676 kB   記憶體總數
MemFree:          167340 kB
Buffers:           82336 kB
Cached:           244292 kB
SwapCached:            0 kB
Active:           176840 kB
Inactive:         166988 kB
Active(anon):      17280 kB
Inactive(anon):      108 kB
Active(file):     159560 kB
Inactive(file):   166880 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                24 kB
Writeback:             0 kB
AnonPages:         17216 kB
Mapped:             6376 kB
Shmem:               188 kB
Slab:              74832 kB
SReclaimable:      26280 kB
SUnreclaim:        48552 kB
KernelStack:         552 kB
PageTables:         2712 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      302336 kB
Committed_AS:      78200 kB
VmallocTotal:   34359738367 kB
VmallocUsed:        5208 kB
VmallocChunk:   34359732976 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:      629760 kB
DirectMap2M:           0 kB