blob: 08f68e502001a974547eadd2e92c736fa3c8153a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#!/bin/bash
#
# Script to display and set (checked) the governors for the both CPU Cores (f.e. from the Core2Duo)
# (c) Alexander Sulfrian 2007
# Licence: GPL v3
#
if [ -z "$1" ]
then
activ_governor_cpu0=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`
activ_governor_cpu1=`cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor`
echo "active governors"
echo "CPU 0: ${activ_governor_cpu0}"
echo "CPU 1: ${activ_governor_cpu1}"
exit 1
fi
governor_avalible=`sed 's/ \(.\)/\n\1/g;s/ $//g' /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | grep "^${1}\$"`
if [ -z "$governor_avalible" ]
then
avalible_governors=`sed 's/ \(.\)/|\1/g;s/ $//g' /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors`
echo "Usage:"
echo "$0 [${avalible_governors}]"
exit 2
fi
echo "$1" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "$1" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
activ_governor_cpu0=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`
activ_governor_cpu1=`cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor`
echo "active governors"
echo "CPU 0: ${activ_governor_cpu0}"
echo "CPU 1: ${activ_governor_cpu1}"
exit 0
|