summaryrefslogtreecommitdiffstats
path: root/pts-core/functions/pts-functions_system_cpu.php
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-04-27 15:36:20 -0400
committerMichael Larabel <michael@phx-laptop.(none)>2008-04-27 15:36:20 -0400
commitf020a8fb9ca162cf850252d2a65f514795e72b58 (patch)
tree55ca7e937bc04de1379a9b977934830eebb9fe1e /pts-core/functions/pts-functions_system_cpu.php
parent8937034a3e66c908de5b22c0bdf7539cea0ebd21 (diff)
downloadphoronix-test-suite-upstream-f020a8fb9ca162cf850252d2a65f514795e72b58.tar.gz
phoronix-test-suite-upstream-f020a8fb9ca162cf850252d2a65f514795e72b58.tar.xz
phoronix-test-suite-upstream-f020a8fb9ca162cf850252d2a65f514795e72b58.zip
Support for monitoring CPU and system temperatures through ACPI, if
LM_Sensors isn't installed or working.
Diffstat (limited to 'pts-core/functions/pts-functions_system_cpu.php')
-rw-r--r--pts-core/functions/pts-functions_system_cpu.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/pts-core/functions/pts-functions_system_cpu.php b/pts-core/functions/pts-functions_system_cpu.php
index 8c547e7..8a5a416 100644
--- a/pts-core/functions/pts-functions_system_cpu.php
+++ b/pts-core/functions/pts-functions_system_cpu.php
@@ -130,6 +130,14 @@ function processor_temperature()
$temp_c = read_linux_sensors("CPU Temp");
if(empty($temp_c))
+ {
+ $temp_c = read_acpi_value("/thermal_zone/THM0/temperature", "temperature"); // if it is THM0 that is for the CPU, in most cases it should be
+
+ if(($end = strpos($temp_c, ' ')) > 0)
+ $temp_c = substr($temp_c, 0, $end);
+ }
+
+ if(empty($temp_c))
$temp_c = -1;
return $temp_c;
@@ -142,5 +150,4 @@ function pts_record_cpu_temperature()
if($temp != -1)
array_push($CPU_TEMPERATURE, $temp);
}
-
?>