PDA

View Full Version : trondheim-12 patch for gpu usage


uncle_fungus
06-24-2008, 04:28 PM
This also applies to master.

This fixes a typo which causes havoc with monitoring graphs.

diff --git a/pts-core/functions/pts-functions_system_parsing.php b/pts-core/functions/pts-functions_system_parsing.php
index fa0d899..d491491 100644
--- a/pts-core/functions/pts-functions_system_parsing.php
+++ b/pts-core/functions/pts-functions_system_parsing.php
@@ -227,7 +227,7 @@ function read_ati_extension($attribute)
$info = shell_exec("aticonfig --pplib-cmd \"get activity\" 2>&1");
if(($pos = strpos($info, "Activity")) > 0)
{
- $activity_info = substr($info, strpos($info, "Activity:") + 8);
+ $activity_info = substr($info, strpos($info, "Activity:") + 9);
$activity_info = trim(substr($activity_info, 0, strpos($activity_info, "percent\n")));
$ati_info = $activity_info;
}

Michael
06-24-2008, 04:32 PM
Should be in both branches now, thanks.

uncle_fungus
06-24-2008, 06:15 PM
Fixes minumum reported usage to allow 0%, also applies to cpu.usage.

diff --git a/pts-core/modules/system_monitor.php b/pts-core/modules/system_monitor.php
index c6c1037..2c32ea1 100644
--- a/pts-core/modules/system_monitor.php
+++ b/pts-core/modules/system_monitor.php
@@ -320,7 +320,7 @@ class system_monitor extends pts_module_interface

foreach($m_array[$i] as $temp)
{
- if($temp < $low || $low == 0)
+ if($temp < $low || ($low == 0 && $type[$i] <> "Usage"))
$low = $temp;
else if($temp > $high)
$high = $temp;

Michael
06-24-2008, 07:09 PM
In git, thanks.