Show the CPU Frequency on the dashboard if it's not running at full speed (due to powerd)

This commit is contained in:
jim-p 2010-06-30 11:55:39 -04:00
parent 5d8cd81abd
commit 81ab3a736c

View File

@ -130,7 +130,19 @@ $curcfg = $config['system']['firmware'];
$cpumodel = "";
exec("/sbin/sysctl -n hw.model", $cpumodel);
$cpumodel = implode(" ", $cpumodel);
echo (htmlspecialchars($cpumodel)); ?>
echo (htmlspecialchars($cpumodel));
$cpufreqs = "";
exec("/sbin/sysctl -n dev.cpu.0.freq_levels", $cpufreqs);
$cpufreqs = explode(" ", trim($cpufreqs[0]));
$maxfreq = explode("/", $cpufreqs[0]);
$maxfreq = $maxfreq[0];
$curfreq = "";
exec("/sbin/sysctl -n dev.cpu.0.freq", $curfreq);
$curfreq = trim($curfreq[0]);
if ($curfreq != $maxfreq)
echo "<br/>Current: {$curfreq} MHz, Max: {$maxfreq} MHz";
?>
</td>
</tr>
<?php if ($hwcrypto): ?>