Lines 20-26
Link Here
|
20 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
21 |
|
21 |
|
22 |
__cpu_freq_detail() { |
22 |
__cpu_freq_detail() { |
23 |
cat /proc/cpuinfo |
23 |
cat /compat/linux/proc/cpuinfo |
24 |
} |
24 |
} |
25 |
|
25 |
|
26 |
__cpu_freq() { |
26 |
__cpu_freq() { |
Lines 29-41
Link Here
|
29 |
read hz < /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq |
29 |
read hz < /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq |
30 |
fpdiv $hz "1000000" 1 # 1Ghz |
30 |
fpdiv $hz "1000000" 1 # 1Ghz |
31 |
freq="$_RET" |
31 |
freq="$_RET" |
32 |
elif [ -r "/proc/cpuinfo" ]; then |
32 |
elif [ -r "/compat/linux/proc/cpuinfo" ]; then |
33 |
if egrep -q -s -i -m 1 "^cpu MHz|^clock" /proc/cpuinfo; then |
33 |
if egrep -q -s -i -m 1 "^cpu MHz|^clock" /compat/linux/proc/cpuinfo; then |
34 |
freq=$(egrep -i -m 1 "^cpu MHz|^clock" /proc/cpuinfo | awk -F"[:.]" '{ printf "%01.1f", $2 / 1000 }') |
34 |
freq=$(egrep -i -m 1 "^cpu MHz|^clock" /compat/linux/proc/cpuinfo | awk -F"[:.]" '{ printf "%01.1f", $2 / 1000 }') |
35 |
else |
35 |
else |
36 |
# Must scale frequency by number of processors, if counting bogomips |
36 |
# Must scale frequency by number of processors, if counting bogomips |
37 |
count=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /proc/cpuinfo) |
37 |
count=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /compat/linux/proc/cpuinfo) |
38 |
freq=$(egrep -i -m 1 "^bogomips" /proc/cpuinfo | awk -F"[:.]" '{ print $2 }') |
38 |
freq=$(egrep -i -m 1 "^bogomips" /compat/linux/proc/cpuinfo | awk -F"[:.]" '{ print $2 }') |
39 |
freq=$(printf "%s %s" "$freq" "$count" | awk '{printf "%01.1f\n", $1/$2/1000}') |
39 |
freq=$(printf "%s %s" "$freq" "$count" | awk '{printf "%01.1f\n", $1/$2/1000}') |
40 |
fi |
40 |
fi |
41 |
elif hz=$(sysctl -n hw.cpufrequency 2>/dev/null); then |
41 |
elif hz=$(sysctl -n hw.cpufrequency 2>/dev/null); then |