FreeBSD环境下获取CPU信息
获取CPU速度
在shell下键入以下命令:
sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu'
将会得到大概如下输出:
hw.machine: amd64
hw.model: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
hw.ncpu: 8
hw.machine_arch: amd64
那么,通过以上信息我们得知CPU为Intel Xeon四核,频率为2.4GHz
获取更多CPU信息
为了得到更详细的CPU信息,我们可以用下面的命令:
dmesg | grep -i cpu
或
grep -i cpu /var/run/dmesg.boot
将会得到大概如下输出:
CPU: Intel(R) Xeon(TM) CPU 3.00GHz (3000.12-MHz K8-class CPU)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
cpu0 (BSP): APIC ID: 0
cpu1 (AP/HT): APIC ID: 1
cpu0: <ACPI CPU> on acpi0
p4tcc0: on cpu0
cpu1: <ACPI CPU> on acpi0
p4tcc1: on cpu1
SMP: AP CPU #1 Launched!
在shell下键入以下命令:
sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu'
将会得到大概如下输出:
hw.machine: amd64
hw.model: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
hw.ncpu: 8
hw.machine_arch: amd64
那么,通过以上信息我们得知CPU为Intel Xeon四核,频率为2.4GHz
获取更多CPU信息
为了得到更详细的CPU信息,我们可以用下面的命令:
dmesg | grep -i cpu
或
grep -i cpu /var/run/dmesg.boot
将会得到大概如下输出:
CPU: Intel(R) Xeon(TM) CPU 3.00GHz (3000.12-MHz K8-class CPU)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
cpu0 (BSP): APIC ID: 0
cpu1 (AP/HT): APIC ID: 1
cpu0: <ACPI CPU> on acpi0
p4tcc0: on cpu0
cpu1: <ACPI CPU> on acpi0
p4tcc1: on cpu1
SMP: AP CPU #1 Launched!