Linux 的/proc/cpuinfo 在 FreeBSD v8.1 上的等效项是什么?我的应用程序读取/proc/cpuinfo 并将信息保存在日志文件中,我该怎么做才能在 FreeBSD 上记录类似的信息?
示例/proc/cpuinfo 如下所示:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU E5420 @ 2.50GHz
stepping : 8
cpu MHz : 2499.015
cache size : 6144 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
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 nx lm constant_tsc pni ds_cpl
bogomips : 5004.54
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU E5420 @ 2.50GHz
stepping : 8
cpu MHz : 2499.015
cache size : 6144 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
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 nx lm constant_tsc pni ds_cpl
bogomips : 5009.45
最佳答案
我不相信有像 Linux 的 /proc/cpuinfo
这样详细的东西。查看 sysctl hw
和 /var/run/dmesg.boot
。大多数信息(如 CPU 速度和指令集)应该位于某处。
这是我看到的(删除了一些无趣的 hw.*
字段):
$ uname -sr
FreeBSD 4.10-RELEASE
$ grep -i cpu /var/run/dmesg.boot
CPU: Pentium III/Pentium III Xeon/Celeron (448.97-MHz 686-class CPU)
$ /sbin/sysctl hw
hw.machine: i386
hw.model: Pentium III/Pentium III Xeon/Celeron
hw.ncpu: 1
hw.byteorder: 1234
hw.physmem: 665989120
hw.usermem: 604614656
hw.pagesize: 4096
hw.floatingpoint: 1
hw.machine_arch: i386
hw.aac.iosize_max: 65536
hw.an.an_dump: off
hw.an.an_cache_mode: dbm
hw.an.an_cache_mcastonly: 0
hw.an.an_cache_iponly: 1
hw.fxp_rnr: 0
hw.fxp_noflow: 0
hw.dc_quick: 1
hw.ste.rxsyncs: 0
hw.instruction_sse: 0
hw.availpages: 162432
(请注意,在 OpenBSD 上,cpu 速度在 hw.cpuspeed
而不是 dmesg 中找到。)
关于linux - 在 FreeBSD v8.1 上/proc/cpuinfo 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4083848/