CPU [IRIX]: Initial support

This commit is contained in:
Muhammad Herdiansyah 2017-05-08 17:38:05 +07:00
parent 54bf42f1b6
commit 00e2006e48

View file

@ -976,6 +976,17 @@ get_cpu() {
"physical") cores="$(lparstat -i | awk -F':' '/Active Physical CPUs/ {printf $2}')" "physical") cores="$(lparstat -i | awk -F':' '/Active Physical CPUs/ {printf $2}')"
esac esac
;; ;;
"IRIX")
# Get CPU name.
cpu="$(hinv -c | awk -F':' '/CPU:/ {printf $2}')"
# Get CPU speed.
cpu="$(hinv -c | awk 'NR==1{printf $2}')"
# Get CPU cores.
cores="$(sysconf NPROC_ONLN)" # Does this even work?
;;
esac esac
if [[ "$speed" ]]; then if [[ "$speed" ]]; then
@ -1054,6 +1065,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?
esac esac
fi fi