aboutsummaryrefslogtreecommitdiffstats
path: root/bin/realtime-suggestions
diff options
context:
space:
mode:
Diffstat (limited to 'bin/realtime-suggestions')
-rwxr-xr-xbin/realtime-suggestions23
1 files changed, 14 insertions, 9 deletions
diff --git a/bin/realtime-suggestions b/bin/realtime-suggestions
index c5e7355..9235651 100755
--- a/bin/realtime-suggestions
+++ b/bin/realtime-suggestions
@@ -97,23 +97,28 @@ check_max_user_watches() {
local minimum=524288
local proc_file="/proc/sys/fs/inotify/max_user_watches"
if [ "$(cat "$proc_file")" -lt $minimum ]; then
- echo "$change Consider increasing 'fs.inotify.max_user_watches>$minimum' - the maximum amount of files inotify can watch $sysctl_ref"
+ echo "$change Consider increasing 'fs.inotify.max_user_watches>$minimum' (default) - the maximum amount of files inotify can watch $sysctl_ref."
fi
}
check_cpu_governor() {
+ local governor_dir="/sys/devices/system/cpu/cpufreq/"
local cpupower_ref="(see \`man cpupower\` for reference)"
local governor=""
local policy_no=""
local cpu_no=""
- for governor_file in /sys/devices/system/cpu/cpufreq/policy*/scaling_governor; do
- governor="$(cat "$governor_file")"
- policy_no="$(echo "$governor_file"| cut -d'/' -f7)"
- cpu_no="${policy_no//policy}"
- if [[ "$governor" != "performance" ]]; then
- echo "$change CPU $cpu_no has governor $governor set. Set it to 'performance' $cpupower_ref."
- fi
- done
+ if [ -d "${governor_dir}" ]; then
+ for governor_file in /sys/devices/system/cpu/cpufreq/policy*/scaling_governor; do
+ governor="$(cat "$governor_file")"
+ policy_no="$(echo "$governor_file"| cut -d'/' -f7)"
+ cpu_no="${policy_no//policy}"
+ if [[ "$governor" != "performance" ]]; then
+ echo "$change CPU $cpu_no has governor $governor set. Set it to 'performance' $cpupower_ref."
+ fi
+ done
+ else
+ echo "$warning Unable to detect any CPU governor on your machine. ${governor_dir} does not exist!"
+ fi
}
check_config_high_res_timers() {