aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2015-03-20 02:50:44 +0100
committerDavid Runge <dave@sleepmap.de>2015-03-20 02:50:44 +0100
commitf9ac22c285ee42586375cd46b1072734856c6a0b (patch)
tree45ec64921f8ca863433405a9b7c7ed162d595914 /scripts
downloaduenv-f9ac22c285ee42586375cd46b1072734856c6a0b.tar.gz
uenv-f9ac22c285ee42586375cd46b1072734856c6a0b.tar.bz2
uenv-f9ac22c285ee42586375cd46b1072734856c6a0b.tar.xz
uenv-f9ac22c285ee42586375cd46b1072734856c6a0b.zip
cpupower-rt: Adding cpupower-rt script, configuration and service file. Meant to be used with linux-rt and setting the special boot parameter: systemd.setenv=REALTIME=true.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/cpupower-rt32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/cpupower-rt b/scripts/cpupower-rt
new file mode 100755
index 0000000..d775d68
--- /dev/null
+++ b/scripts/cpupower-rt
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+. /etc/default/cpupower-rt
+
+declare -i fail=0
+
+# parse frequency options
+declare -a params=()
+params+=(${governor:+-g $governor})
+params+=(${min_freq:+-d $min_freq})
+params+=(${max_freq:+-u $max_freq})
+params+=(${freq:+-f $freq})
+
+# apply frequency options
+if ((${#params[@]} > 0)); then
+ cpupower frequency-set "${params[@]}" >/dev/null || fail=1
+fi
+
+# parse cpu options
+declare -a params=()
+params+=(${mc_scheduler:+-m $mc_scheduler})
+params+=(${smp_scheduler:+-s $smp_scheduler})
+params+=(${perf_bias:+-b $perf_bias})
+
+# apply cpu options
+if ((${#params[@]} > 0)); then
+ cpupower set "${params[@]}" >/dev/null || fail=1
+fi
+
+exit $fail
+
+# vim:set ts=2 sw=2 ft=sh et: