Summary
Description: Phoronix Test Suite open-source benchmarking development
Last Change: Fri 5/17/13 22:52
Recent Commits
>
--git a/CHANGE-LOG b/CHANGE-LOG
index 5d674eb..2e6f4a3 100644
--- a/CHANGE-LOG
+++ b/CHANGE-LOG
@@ -21,6 +21,7 @@ Phoronix Test Suite 2.2 (Git)
- pts-core: Standardize PTS test comparison hashes
- phodevi: Improve hardware detection for OpenSolaris SPARC systems using DDU information
- phodevi: Improve motherboard detection for Sun SPARC systems
+- phodevi: Start new reporting infrastructure
- tandem_Xml: Add addXmlObjectFromReader() function for improved performance
- tandem_Xml: Add saveXMLFile() function
- pts: Fixes for compress-lzma and compress-pbzip2 test profiles with name change of compressfile
diff --git a/pts-core/library/pts-functions_system.php b/pts-core/library/pts-functions_system.php
index 4b5d227..a4f6f5f 100644
--- a/pts-core/library/pts-functions_system.php
+++ b/pts-core/library/pts-functions_system.php
@@ -23,27 +23,13 @@
require_once(PTS_LIBRARY_PATH . "pts-functions_system_parsing.php");
-// TODO: Further integration with Phodevi
-
function pts_hw_string($return_string = true)
{
- // Returns string of hardware information
- $hw = array();
-
- $hw["Processor"] = phodevi::read_name("cpu");
- $hw["Motherboard"] = phodevi::read_name("motherboard");
- $hw["Chipset"] = phodevi::read_name("chipset");
- $hw["System Memory"] = phodevi::read_name("memory");
- $hw["Disk"] = phodevi::read_name("disk");
- $hw["Graphics"] = phodevi::read_name("gpu");
- $hw["Monitor"] = phodevi::read_name("monitor");
-
- $hw = pts_remove_unsupported_entries($hw);
-
- return pts_process_string_array($return_string, $hw);
+ return phodevi::system_hardware();
}
function pts_sw_string($return_string = true)
{
+ // TODO: port to Phodevi module similar to the pts_hw_string()
// Returns string of software information
$sw = array();
diff --git a/pts-core/objects/phodevi/phodevi.php b/pts-core/objects/phodevi/phodevi.php
index 375655c..d551bf0 100644
--- a/pts-core/objects/phodevi/phodevi.php
+++ b/pts-core/objects/phodevi/phodevi.php
@@ -34,6 +34,22 @@ class phodevi
{
return phodevi::read_property($device, "identifier");
}
+ public static function available_hardware_devices()
+ {
+ return array(
+ "Processor" => "cpu",
+ "Motherboard" => "motherboard",
+ "Chipset" => "chipset",
+ "System Memory" => "memory",
+ "Disk" => "disk",
+ "Graphics" => "gpu",
+ "Monitor" => "monitor"
+ );
+ }
+ public static function system_hardware($return_as_string = true)
+ {
+ return self::system_information_parse(self::available_hardware_devices(), $return_as_string);
+ }
public static function read_sensor($device, $read_sensor)
{
$value = false;
@@ -239,6 +255,39 @@ class phodevi
serialize(new phodevi_cache(self::$smart_cache, $store_dir, $client_version)));
}
}
+ protected static function system_information_parse($component_array, $return_as_string = true)
+ {
+ // Returns string of hardware information
+ $info = array();
+
+ foreach($component_array as $string => $id)
+ {
+ $value = self::read_name($id);
+
+ if($value != -1 && !empty($value))
+ {
+ $info[$string] = $value;
+ }
+ }
+
+ if($return_as_string)
+ {
+ $info_array = $info;
+ $info = "";
+
+ foreach($info_array as $type => $value)
+ {
+ if($info != "")
+ {
+ $info .= ", ";
+ }
+
+ $info .= $type . ": " . $value;
+ }
+ }
+
+ return $info;
+ }
}
Copyright © 2013 by Phoronix Media