Unverified Commit 9b110813 authored by Charlène's avatar Charlène Committed by GitHub

OpenBSD: change cpu count (#1650)

Instead of using hw.ncpu, use hw.ncpuonline and hw.ncpufound, and check SMT status
parent 0bbd6bff
...@@ -2286,7 +2286,17 @@ get_cpu() { ...@@ -2286,7 +2286,17 @@ get_cpu() {
[[ -z "$speed" ]] && speed="$(sysctl -n hw.clockrate)" [[ -z "$speed" ]] && speed="$(sysctl -n hw.clockrate)"
# Get CPU cores. # Get CPU cores.
case $kernel_name in
"OpenBSD"*)
[[ "$(sysctl -n hw.smt)" == "1" ]] && smt="on" || smt="off"
ncpufound="$(sysctl -n hw.ncpufound)"
ncpuonline="$(sysctl -n hw.ncpuonline)"
cores="${ncpuonline}/${ncpufound},\\xc2\\xa0SMT\\xc2\\xa0${smt}"
;;
*)
cores="$(sysctl -n hw.ncpu)" cores="$(sysctl -n hw.ncpu)"
;;
esac
# Get CPU temp. # Get CPU temp.
case $kernel_name in case $kernel_name in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment