CPU [IRIX]: Fix CPU speed.... kinda.

This commit is contained in:
Muhammad Herdiansyah 2017-05-22 16:50:24 +07:00
parent 0b77804a65
commit 7f17306080
1 changed files with 9 additions and 4 deletions

View File

@ -983,13 +983,18 @@ get_cpu() {
"IRIX") "IRIX")
# Get CPU name. # Get CPU name.
cpu="$(hinv -c | awk -F':' '/CPU:/ {printf $2}')" cpu="$(hinv -c processor | awk -F':' '/CPU:/ {printf $2}')"
# Get CPU speed. # Get CPU speed.
cpu="$(hinv -c | awk 'NR==1{printf $2}')" cpu="$(hinv -c processor | awk '/MHZ/ {printf $2}')"
# Note: This is an inaccurate way to count CPU speed.
# Most of them use MHZ, I'm yet to see if they have
# anything above 1 GHZ. So this will have to do as a
# place holder.
# Get CPU cores. # Get CPU cores.
cores="$(sysconf NPROC_ONLN)" # Does this even work? cores="$(sysconf NPROC_ONLN)"
;; ;;
esac esac
@ -1069,7 +1074,7 @@ get_cpu_usage() {
"Haiku") cores="$(sysinfo -cpu | grep -c -F 'CPU #')" ;; "Haiku") cores="$(sysinfo -cpu | grep -c -F 'CPU #')" ;;
"iPhone OS") cores="${cpu/*\(}"; cores="${cores/\)*}" ;; "iPhone OS") cores="${cpu/*\(}"; cores="${cores/\)*}" ;;
"AIX") cores="$(lparstat -i | awk -F':' '/Online Virtual CPUs/ {printf $2}')" ;; "AIX") cores="$(lparstat -i | awk -F':' '/Online Virtual CPUs/ {printf $2}')" ;;
"IRIX") cores="$(sysconf NPROC_ONLN)" # Does this even work? "IRIX") cores="$(sysconf NPROC_ONLN)"
esac esac
fi fi