sysctl hw add nphyscpu variable
Stefan Parvu
sparvu at systemdatarecorder.org
Mon Aug 4 11:53:57 UTC 2014
Hi,
Would be possible to have under sysctl interface a new variable which will track the
number of physical CPU sockets a system has ? Would be useful for hardware
and data inventory.
Something like:
hw.machine: amd64
hw.model: Intel(R) Xeon(R) CPU E5-2640 v2 @ 2.00GHz
hw.ncpu: 32
hw.nphyscpu: 2
^^^^^^^^^^^^
This is an example from my system with two 2 physical CPUs installed. No system
virtualization in place, like Xen, etc ...
Or is it possible currently to get easily this information ? I havent found one
except dmesg information.
FreeBSD/SMP: Multiprocessor System Detected: 32 CPUs
FreeBSD/SMP: 2 package(s) x 8 core(s) x 2 SMT threads
cpu0 (BSP): APIC ID: 0
cpu1 (AP): APIC ID: 1
cpu2 (AP): APIC ID: 2
cpu3 (AP): APIC ID: 3
cpu4 (AP): APIC ID: 4
cpu5 (AP): APIC ID: 5
cpu6 (AP): APIC ID: 6
cpu7 (AP): APIC ID: 7
cpu8 (AP): APIC ID: 8
cpu9 (AP): APIC ID: 9
cpu10 (AP): APIC ID: 10
cpu11 (AP): APIC ID: 11
cpu12 (AP): APIC ID: 12
cpu13 (AP): APIC ID: 13
cpu14 (AP): APIC ID: 14
cpu15 (AP): APIC ID: 15
cpu16 (AP): APIC ID: 32
cpu17 (AP): APIC ID: 33
cpu18 (AP): APIC ID: 34
cpu19 (AP): APIC ID: 35
cpu20 (AP): APIC ID: 36
cpu21 (AP): APIC ID: 37
cpu22 (AP): APIC ID: 38
cpu23 (AP): APIC ID: 39
cpu24 (AP): APIC ID: 40
cpu25 (AP): APIC ID: 41
cpu26 (AP): APIC ID: 42
cpu27 (AP): APIC ID: 43
cpu28 (AP): APIC ID: 44
cpu29 (AP): APIC ID: 45
cpu30 (AP): APIC ID: 46
cpu31 (AP): APIC ID: 47
Probable things will get complicated a bit if the system is a guest under Xen or other
hypervisor. But probable there the nphyscpu should be NA ?
--
Stefan Parvu <sparvu at systemdatarecorder.org>
More information about the freebsd-hackers
mailing list