summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGE-LOG5
-rw-r--r--pts-core/functions/pts-functions_system.php6
-rw-r--r--pts-core/functions/pts-functions_system_graphics.php75
-rw-r--r--pts-core/functions/pts-functions_system_parsing.php22
4 files changed, 108 insertions, 0 deletions
diff --git a/CHANGE-LOG b/CHANGE-LOG
index 2adbdd3..f1435e7 100644
--- a/CHANGE-LOG
+++ b/CHANGE-LOG
@@ -1,5 +1,10 @@
PHORONIX TEST SUITE CHANGE-LOG
+Phoronix Test Suite (Git)
+
+- pts-core: Add support for reading X.Org module / driver versions using read_xorg_module_version()
+- pts-core: Where applicable, report X.Org DDX driver and version to software information string
+
Phoronix Test Suite 1.4.0
November 3, 2008
diff --git a/pts-core/functions/pts-functions_system.php b/pts-core/functions/pts-functions_system.php
index d12b05f..4249e48 100644
--- a/pts-core/functions/pts-functions_system.php
+++ b/pts-core/functions/pts-functions_system.php
@@ -50,6 +50,12 @@ function pts_sw_string()
array_push($software, "OS: " . operating_system_release());
array_push($software, "Kernel: " . kernel_string() . " (" . kernel_arch() . ")");
array_push($software, "X.Org Server: " . graphics_subsystem_version());
+
+ if(($ddx = xorg_ddx_driver_info()) != "")
+ {
+ array_push($software, "X.Org Driver: " . $ddx);
+ }
+
array_push($software, "OpenGL: " . opengl_version());
array_push($software, "Compiler: " . compiler_version());
array_push($software, "File-System: " . filesystem_type());
diff --git a/pts-core/functions/pts-functions_system_graphics.php b/pts-core/functions/pts-functions_system_graphics.php
index 3399f22..61ee5f6 100644
--- a/pts-core/functions/pts-functions_system_graphics.php
+++ b/pts-core/functions/pts-functions_system_graphics.php
@@ -931,6 +931,81 @@ function opengl_version()
return $info;
}
+function xorg_ddx_driver_info()
+{
+ $ddx_info = "";
+
+ if(IS_ATI_GRAPHICS)
+ {
+ $version = read_xorg_module_version("fglrx_drv.so");
+
+ if(!empty($version))
+ {
+ $ddx_info = "fglrx " . $version;
+ }
+ }
+ else if(IS_MESA_GRAPHICS)
+ {
+ $gpu = graphics_processor_string();
+
+ if(strpos($gpu, "ATI"))
+ {
+ $version = read_xorg_module_version("radeon_drv.so");
+
+ if(!empty($version))
+ {
+ $ddx_info = "xf86-video-radeon " . $version;
+ }
+ else
+ {
+ $version = read_xorg_module_version("radeonhd_drv.so");
+
+ if(!empty($version))
+ {
+ $ddx_info = "xf86-video-radeonhd " . $version;
+ }
+ }
+ }
+ else if(strpos($gpu, "NVIDIA"))
+ {
+ $version = read_xorg_module_version("nv_drv.so");
+
+ if(!empty($version))
+ {
+ $ddx_info = "xf86-video-nv " . $version;
+ }
+ else
+ {
+ $version = read_xorg_module_version("nouveau_drv.so");
+
+ if(!empty($version))
+ {
+ $ddx_info = "xf86-video-nouveau " . $version;
+ }
+ }
+ }
+ else if(strpos($gpu, "Intel"))
+ {
+ $version = read_xorg_module_version("intel_drv.so");
+
+ if(!empty($version))
+ {
+ $ddx_info = "xf86-video-intel " . $version;
+ }
+ }
+ else if(strpos($gpu, "VIA"))
+ {
+ $version = read_xorg_module_version("openchrome_drv.so");
+
+ if(!empty($version))
+ {
+ $ddx_info = "xf86-video-openchrome " . $version;
+ }
+ }
+ }
+
+ return $ddx_info;
+}
function graphics_gpu_usage()
{
// Determine GPU usage
diff --git a/pts-core/functions/pts-functions_system_parsing.php b/pts-core/functions/pts-functions_system_parsing.php
index 7309e0f..a7fd105 100644
--- a/pts-core/functions/pts-functions_system_parsing.php
+++ b/pts-core/functions/pts-functions_system_parsing.php
@@ -617,6 +617,28 @@ function read_hddtemp($disk = null)
return $hdd_temperature;
}
+function read_xorg_module_version($module)
+{
+ $module_version = false;
+ if(is_file("/var/log/Xorg.0.log"))
+ {
+ $xorg_log = @file_get_contents("/var/log/Xorg.0.log");
+
+ if(($module_start = strpos($xorg_log, $module)) > 0)
+ {
+ $xorg_log = substr($xorg_log, $module_start);
+ $temp_version = substr($xorg_log, strpos($xorg_log, "module version =") + 17);
+ $temp_version = substr($temp_version, 0, strpos($temp_version, "\n"));
+
+ if(is_numeric(str_replace(".", "", $temp_version)))
+ {
+ $module_version = $temp_version;
+ }
+ }
+ }
+
+ return $module_version;
+}
function read_osx_system_profiler($data_type, $object, $multiple_objects = false)
{
$info = trim(shell_exec("system_profiler " . $data_type . " 2>&1"));