projects / phoronix-test-suite.git / commitdiff
Build Results
 
Summary

Description: Phoronix Test Suite open-source benchmarking development
Last Change: Fri 11/21/14 15:52

Recent Commits
Time
Signed-Off By
Description
Commit Diff
Fri 11/21/14 15:52
Michael Larabel  
phoromatic: Fix salted... 
Fri 11/21/14 10:56
Michael Larabel  
 
Fri 11/21/14 10:52
Michael Larabel  
phoromatic: Allow... 
Fri 11/21/14 10:34
Michael Larabel  
phoromatic: Add... 
Wed 11/19/14 9:58
Michael Larabel  
pts-core: Assume http://... 
Wed 11/19/14 9:53
Michael Larabel  
pts-core: Check for file... 
 
> --git a/CHANGE-LOG b/CHANGE-LOG
index f93a16f
..72a6fb8 100644
--- a/CHANGE-LOG
+++ b/CHANGE-LOG
@@ -8,+8,@@ Phoronix Test Suite (Git)
 - 
pts-coreCheck for null distribution-specific external dependency package names
 
phodeviSupport for reading the VirtualBox version of Beta/RC versions
 
phodeviBetter support detection for Exynos ARM cores
+- phodeviInitial support for reading node power over IPMI
+- phodeviInitial support for reading core temperature over IPMI
 
toggle_screensaverSupport for module disabling the Xfce4 desktop screensaver using xfconf-query

 Phoronix Test Suite 4.0.1
diff 
--git a/pts-core/objects/phodevi/parsers/phodevi_linux_parser.php b/pts-core/objects/phodevi/parsers/phodevi_linux_parser.php
index dd2b06a
..d6129fa 100644
--- a/pts-core/objects/phodevi/parsers/phodevi_linux_parser.php
+++ b/pts-core/objects/phodevi/parsers/phodevi_linux_parser.php
@@ -23,+23,28 @@

 class 
phodevi_linux_parser
 
{
+    public static function 
read_ipmitool_sensor($sensor)
+    {
+        
$value false;
+        
$ipmitool shell_exec('ipmitool sdr list 2>&1');
+
+        
$hit stripos($ipmitool$sensor);
+
+        if(
$hit !== false)
+        {
+            
$trimmed substr($ipmitool, ($hit strlen($sensor)));
+            
$trimmed substr($trimmed0strpos($trimmedPHP_EOL));
+            
$trimmed explode('|'$trimmed);
+
+            if(
count($trimmed) == 3)
+            {
+                
$value explode(' 'trim($trimmed[1]));
+                
$value $value[0];
+            }
+        }
+
+        return 
$value;
+    }
     public static function 
read_sysfs_node($search$type 'NUMERIC'$node_dir_check null$find_position 1)
     {
         static 
$sysfs_file_cache null;
diff --git a/pts-core/objects/phodevi/sensors/cpu_temp.php b/pts-core/objects/phodevi/sensors/cpu_temp.php
index 23009ee
..85e00f1 100644
--- a/pts-core/objects/phodevi/sensors/cpu_temp.php
+++ b/pts-core/objects/phodevi/sensors/cpu_temp.php
@@ -3,+3,@@
 
/*
     Phoronix Test Suite
     URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
-    Copyright (C) 2009 - 2011, Phoronix Media
-    Copyright (C) 2009 - 2011, Michael Larabel
+    Copyright (C) 2009 - 2012, Phoronix Media
+    Copyright (C) 2009 - 2012, Michael Larabel

     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -114,6 +114,16 @@ class cpu_temp implements phodevi_sensor
                     $temp_c = $sensors;
                 }
             }
+
+            if(pts_client::executable_in_path('ipmitool'))
+            {
+                $ipmi = phodevi_linux_parser::read_ipmitool_sensor('Temp 0');
+
+                if($ipmi > 0 && is_numeric($ipmi))
+                {
+                    $temp_c = $ipmi;
+                }
+            }
         }

         return $temp_c;
diff --git a/pts-core/objects/phodevi/sensors/sys_power.php b/pts-core/objects/phodevi/sensors/sys_power.php
index 11d1234..392428d 100644
--- a/pts-core/objects/phodevi/sensors/sys_power.php
+++ b/pts-core/objects/phodevi/sensors/sys_power.php
@@ -3,8 +3,8 @@
 /*
     Phoronix Test Suite
     URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
-    Copyright (C) 2009 - 2011, Phoronix Media
-    Copyright (C) 2009 - 2011, Michael Larabel
+    Copyright (C) 2009 - 2012, Phoronix Media
+    Copyright (C) 2009 - 2012, Michael Larabel

     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -25,6 +25,7 @@ class sys_power implements phodevi_sensor
     private static $battery_sys = false;
     private static $battery_cur = false;
     private static $wattsup_meter = false;
+    private static $ipmitool = false;

     public static function get_type()
     {
@@ -44,7 +45,7 @@ class sys_power implements phodevi_sensor
         {
             $unit = 'microAmps';
         }
-        else if(self::$wattsup_meter)
+        else if(self::$wattsup_meter || self::$ipmitool)
         {
             $unit = 'Watts';
         }
@@ -77,6 +78,17 @@ class sys_power implements phodevi_sensor
                 return true;
             }
         }
+
+        if(pts_client::executable_in_path('ipmitool'))
+        {
+            $ipmi_read = phodevi_linux_parser::read_ipmitool_sensor('Node Power');
+
+            if($ipmi_read > 0 && is_numeric($ipmi_read))
+            {
+                self::$ipmitool = true;
+                return true;
+            }
+        }
     }
     public static function read_sensor()
     {
@@ -92,6 +104,10 @@ class sys_power implements phodevi_sensor
         {
             return self::watts_up_power_meter();
         }
+        else if(self::$ipmitool)
+        {
+            return phodevi_linux_parser::read_ipmitool_sensor('Node Power');
+        }
     }
     private static function watts_up_power_meter()
  
 
Phoronix.com
Linux Driver Forums
Copyright © 2014 by Phoronix Media