diff options
author | Jason Gross <jgross@mit.edu> | 2017-09-15 16:27:58 -0400 |
---|---|---|
committer | Jason Gross <jasongross9@gmail.com> | 2017-09-27 09:06:50 -0400 |
commit | 3eb500b11a3faf768cf96fd6034141eff6ffa83c (patch) | |
tree | d3438d79e0e35a4b39a7829f8adcaf3514775e82 /etc/machine.sh | |
parent | d9cdac885b57f168581c4cbb566aadb45eda7d34 (diff) |
Update etc scripts to include governor
It needs to be in performance, not powersave, to work well on my
machine.
While we're at it, also have the scripts print usage if you pass no
arguments, rather than giving an error message about $1 being unset.
Diffstat (limited to 'etc/machine.sh')
-rwxr-xr-x | etc/machine.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/etc/machine.sh b/etc/machine.sh index 5fcb7289a..69edb149a 100755 --- a/etc/machine.sh +++ b/etc/machine.sh @@ -1,6 +1,15 @@ #!/bin/sh set -eu +online_governors() { + for cpu in "/sys/devices/system/cpu/cpu"[0-9]* ; do + if grep -vq '^1$' "$cpu/online" 2>/dev/null; then + continue + fi + cat "$cpu/cpufreq/scaling_governor" + done +} + printf "$(hostname)" printf - grep -q '[^0-9]' /sys/devices/system/cpu/cpu[0-9]*/topology/thread_siblings_list && printf ht || printf noht @@ -17,5 +26,7 @@ else printf nops fi printf - +printf "$(echo -n "$(online_governors | uniq)" | tr '\n' '_')" +printf - printf "$(gcc -march=native -Q --help=target|grep march | cut -d= -f2 | grep -ow '\S*')" printf '\n' |