summaryrefslogtreecommitdiffstats
path: root/pts-core/functions/pts-functions_system_cpu.php
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-08-03 16:37:44 -0400
committerMichael Larabel <michael@phx-laptop.(none)>2008-08-03 16:37:44 -0400
commit74884acedc6f435ac54b8a598fcdebe746c11bf5 (patch)
tree756bea19b24481d95a858b44c3c25c48c50b13b8 /pts-core/functions/pts-functions_system_cpu.php
parent1d9eb8738a828a489a597cef2fbb93f6f6be9b54 (diff)
downloadphoronix-test-suite-upstream-74884acedc6f435ac54b8a598fcdebe746c11bf5.tar.gz
phoronix-test-suite-upstream-74884acedc6f435ac54b8a598fcdebe746c11bf5.tar.xz
phoronix-test-suite-upstream-74884acedc6f435ac54b8a598fcdebe746c11bf5.zip
pts-core: Eliminate one second sleep time when determining whether a CPU
throttling technology (EIST/CnQ) is enabled or not
Diffstat (limited to 'pts-core/functions/pts-functions_system_cpu.php')
-rw-r--r--pts-core/functions/pts-functions_system_cpu.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/pts-core/functions/pts-functions_system_cpu.php b/pts-core/functions/pts-functions_system_cpu.php
index 060ff5e..7560c2f 100644
--- a/pts-core/functions/pts-functions_system_cpu.php
+++ b/pts-core/functions/pts-functions_system_cpu.php
@@ -175,11 +175,11 @@ function pts_processor_power_savings_enabled()
if(is_file("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq") && is_file("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"))
{
- sleep(1); // try to get it to drop power levels
- $cur = trim(file_get_contents("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq"));
+ // if EIST / CnQ is disabled, the cpufreq folder shoudln't be present, but double check by comparing the min and max frequencies
+ $min = trim(file_get_contents("/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq"));
$max = trim(file_get_contents("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"));
- if($cur < $max) // TODO: improved test, since the CPU could already be maxed from other processes running
+ if($min < $max)
{
$cpu = processor_string();