Commit dc32c0b7 authored by Dylan Araps's avatar Dylan Araps

Add option to hide/show hypertheaded cpu cores

parent 1a8734bf
...@@ -724,7 +724,11 @@ getcpu() { ...@@ -724,7 +724,11 @@ getcpu() {
speed="$((speed / 100))" speed="$((speed / 100))"
fi fi
cores="$(grep -c ^processor /proc/cpuinfo)" # Show/hide hyperthreaded cores
case "$cores_ht" in
"on") cores="$(grep -c ^processor /proc/cpuinfo)" ;;
"off") cores="$(grep "^core id" /proc/cpuinfo | sort -u | wc -l)" ;;
esac
# Fix for speeds under 1ghz # Fix for speeds under 1ghz
if [ -z "${speed:1}" ]; then if [ -z "${speed:1}" ]; then
...@@ -738,7 +742,12 @@ getcpu() { ...@@ -738,7 +742,12 @@ getcpu() {
"Mac OS X") "Mac OS X")
cpu="$(sysctl -n machdep.cpu.brand_string)" cpu="$(sysctl -n machdep.cpu.brand_string)"
cores="$(sysctl -n hw.ncpu)"
# Show/hide hyperthreaded cores
case "$cores_ht" in
"on") cores="$(sysctl -n hw.logicalcpu_max)" ;;
"off") cores="$(sysctl -n hw.physicalcpu_max)" ;;
esac
;; ;;
"iPhone OS") "iPhone OS")
......
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