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 2db27c2..466da47 100644
--- a/CHANGE-LOG
+++ b/CHANGE-LOG
@@ -4,6 +4,7 @@ Phoronix Test Suite (Git)
- pts-core: Support download caches at /run/media/*/*/download-cache/
- pts_Graph: Only render as much room for pts_OverViewGraph as there are for what will be rendered (bar graph values)
+- system_monitor: Add support for handling i915_energy monitor reading in microJoules for each test run
Phoronix Test Suite 4.0 Milestone 3
22 May 2012
diff --git a/pts-core/modules/system_monitor.php b/pts-core/modules/system_monitor.php
index 53bd7ed..b4f9738 100644
--- a/pts-core/modules/system_monitor.php
+++ b/pts-core/modules/system_monitor.php
@@ -39,6 +39,8 @@ class system_monitor extends pts_module_interface
private static $sensor_monitoring_frequency = 2;
+ private static $monitor_i915_energy = false; // special case of monitoring since it's not tapping Phodevi (right now at least)
+
public static function module_environmental_variables()
{
return array('MONITOR', 'PERFORMANCE_PER_WATT');
@@ -92,6 +94,13 @@ class system_monitor extends pts_module_interface
}
}
+ if(in_array('i915_energy', $to_show) && is_readable('/sys/kernel/debug/dri/0/i915_energy'))
+ {
+ // For now the Intel monitoring is a special case separate from the rest
+ // of the unified sensor monitoring since we're not polling it every time but just pre/post test.
+ self::$monitor_i915_energy = true;
+ }
+
if(count(self::$to_monitor) > 0)
{
echo PHP_EOL . 'Sensors To Be Logged:';
@@ -125,6 +134,12 @@ class system_monitor extends pts_module_interface
// Just to pad in some idling into the run process
sleep(self::$sensor_monitoring_frequency);
+
+ if(self::$monitor_i915_energy)
+ {
+ // Just read i915_energy to reset the joule counter
+ file_get_contents('/sys/kernel/debug/dri/0/i915_energy');
+ }
}
public static function __post_test_run_success($test_run_request)
{
@@ -132,7 +147,7 @@ class system_monitor extends pts_module_interface
}
public static function __post_test_run_process(&$result_file_writer)
{
- if(self::$individual_monitoring == false || count(self::$to_monitor) == 0)
+ if((self::$individual_monitoring == false || count(self::$to_monitor) == 0) && self::$monitor_i915_energy == false)
{
return;
}
@@ -206,6 +221,29 @@ class system_monitor extends pts_module_interface
self::$individual_test_run_offsets[phodevi::sensor_identifier($sensor)] = array();
}
+ if(self::$monitor_i915_energy)
+ {
+ $i915_energy = file_get_contents('/sys/kernel/debug/dri/0/i915_energy');
+
+ if(($uj = strpos($i915_energy, ' uJ')))
+ {
+ $uj = substr($i915_energy, 0, $uj);
+ $uj = substr($uj, (strrpos($uj, ' ') + 1));
+
+ if(is_numeric($uj))
+ {
+ $test_result = clone self::$individual_test_run_request;
+ $test_result->test_profile->set_identifier(null);
+ $test_result->test_profile->set_result_proportion('LIB');
+ $test_result->test_profile->set_display_format('BAR_GRAPH');
+ $test_result->test_profile->set_result_scale('micro Joules');
+ $test_result->set_used_arguments_description('i915_energy Monitor');
+ $test_result->set_used_arguments('i915_energy ' . $test_result->get_arguments());
+ $result_file_writer->add_result_from_result_object_with_value_string($test_result, $uj);
+ }
+ }
+ }
+
self::$successful_test_run_request = null;
self::$individual_test_run_request = null;
self::$monitor_test_count++;
<
Copyright © 2013 by Phoronix Media