summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-06-23 12:54:54 -0400
committerMichael Larabel <michael@phx-laptop.(none)>2008-08-03 11:49:16 -0400
commitf801a437138a23ca63f86576387570bb0d62493a (patch)
tree1d44880f82ed78adb0b0615b137870e26ec0a756
parent5ebd432762a1ad7865858ec8311725b222249634 (diff)
downloadphoronix-test-suite-upstream-f801a437138a23ca63f86576387570bb0d62493a.tar.gz
phoronix-test-suite-upstream-f801a437138a23ca63f86576387570bb0d62493a.tar.xz
phoronix-test-suite-upstream-f801a437138a23ca63f86576387570bb0d62493a.zip
Add module-info option for viewing information on a module
-rw-r--r--PTS-12-CHANGE-LOG1
-rw-r--r--documentation/pts_options.html4
-rwxr-xr-xphoronix-test-suite4
-rw-r--r--pts-core/modules/system_monitor.php14
-rw-r--r--pts-core/objects/pts_module_interface.php5
-rw-r--r--pts-core/pts-run-cmd.php35
6 files changed, 57 insertions, 6 deletions
diff --git a/PTS-12-CHANGE-LOG b/PTS-12-CHANGE-LOG
index 4f5b74a..e2cb10d 100644
--- a/PTS-12-CHANGE-LOG
+++ b/PTS-12-CHANGE-LOG
@@ -1,3 +1,4 @@
- Implement PTS modules support
- Move sensor monitoring support from pts-core to a new module called system_monitor
- Add list-modules option for listing all available/installed modules
+- Add module-info option for viewing information on a module
diff --git a/documentation/pts_options.html b/documentation/pts_options.html
index 9493a4f..f057c46 100644
--- a/documentation/pts_options.html
+++ b/documentation/pts_options.html
@@ -99,6 +99,8 @@ at http://global.phoronix-test-suite.com/.</p>
<p><strong>list-modules</strong></p>
<p>This option will list all modules that are installed / present in the <em>pts-core/modules/<em> directory.
Modules are used for extending the functionality of the Phoronix Test Suite without over-inflating the pts-core.</p>
+<p><strong>module-info &lt;Module Name&gt;</strong></p>
+<p>This option will show detailed information on a PTS module such as the version, developer, and a description of its purpose.</p>
<h2>Miscellaneous Options</h2>
<p><strong>make-download-cache</strong></p>
<p>This option will backup all files that were automatically downloaded by the
@@ -146,8 +148,6 @@ This option can be used when making modifications to the graphing code or its
color/option configuration file and testing the changes.</p>
<p><strong>initial-config</strong></p>
<p>This option will generate a new user configuration (user-config.xml) file.</p>
-<p><strong>sensors</strong></p>
-<p>Show sensors detected by the Phoronix Test Suite and read their current values.</p>
<!-- END OF PTS AREA -->
</div></div><div class="pts_doc_fixed"><div class="pts_doc_bottom"><div style="float: left;"><a href="http://www.phoronix-test-suite.com/">Phoronix-Test-Suite.com</a></div><div style="float: right;">Copyright &copy; 2008 by <a href="http://www.phoronixmedia.com/">Phoronix Media</a>.</div></div></div>
</body>
diff --git a/phoronix-test-suite b/phoronix-test-suite
index c8f6b6a..4e3a35e 100755
--- a/phoronix-test-suite
+++ b/phoronix-test-suite
@@ -129,6 +129,9 @@ case "$1" in
"info" | "suite-info" | "suite-information" | "test-info" | "test-information")
$PHP_BIN pts-core/pts-run-cmd.php INFO $2
;;
+"module-info")
+ $PHP_BIN pts-core/pts-run-cmd.php MODULE_INFO $2
+ ;;
"system-info" | "system-information")
$PHP_BIN pts-core/pts-run-cmd.php SYS_INFO
;;
@@ -196,6 +199,7 @@ Result Viewing Options:
Module Options:
list-modules: List all installed/available PTS modules
+ module-info: Show detailed information on a PTS module
Miscellaneous Options:
make-download-cache: Backup all downloaded test files to ~/.phoronix-test-suite/download-cache/
diff --git a/pts-core/modules/system_monitor.php b/pts-core/modules/system_monitor.php
index 8800f56..8de454a 100644
--- a/pts-core/modules/system_monitor.php
+++ b/pts-core/modules/system_monitor.php
@@ -25,9 +25,21 @@ class system_monitor extends pts_module_interface
{
const module_name = "System Monitor";
const module_version = "1.0.0";
- const module_description = "This module contains the sensor monitoring support for the Phoronix Test Suite.";
+ const module_description = "This module contains the sensor monitoring support.";
const module_author = "Michael Larabel";
+ public static function module_info()
+ {
+ $info = "";
+
+ $info .= "\nMonitoring these sensors are as easy as running your normal Phoronix Test Suite commands but at the beginning of the command add: MONITOR=<selected sensors> (example: MONITOR=cpu.temp,cpu.voltage phoronix-test-suite benchmark universe). Below are all of the sensors supported by this version of the Phoronix Test Suite.\n\n";
+ $info .= "Supported Options:\n";
+ foreach(self::pts_monitor_arguments() as $arg)
+ $info .= " - " . $arg . "\n";
+
+ return $info;
+ }
+
//
// General Functions
//
diff --git a/pts-core/objects/pts_module_interface.php b/pts-core/objects/pts_module_interface.php
index 83f4b21..7d3b096 100644
--- a/pts-core/objects/pts_module_interface.php
+++ b/pts-core/objects/pts_module_interface.php
@@ -28,6 +28,11 @@ class pts_module_interface
const module_description = "A description of the module.";
const module_author = "Module Creator";
+ public static function module_info()
+ {
+
+ }
+
//
// General Functions
//
diff --git a/pts-core/pts-run-cmd.php b/pts-core/pts-run-cmd.php
index 0db8eef..529a226 100644
--- a/pts-core/pts-run-cmd.php
+++ b/pts-core/pts-run-cmd.php
@@ -319,6 +319,35 @@ switch($COMMAND)
echo "\n" . $ARG_1 . " is not recognized.\n";
}
break;
+ case "MODULE_INFO":
+ $ARG_1 = strtolower($ARG_1);
+ if(is_file(MODULE_DIR . $ARG_1 . ".php"))
+ {
+ $module = $ARG_1;
+ include(MODULE_DIR . $module . ".php");
+
+ eval("\$module_name = " . $module . "::module_name;"); // TODO: This can be cleaned up once PHP 5.3.0+ is out there and adopted
+ eval("\$module_version = " . $module . "::module_version;");
+ eval("\$module_author = " . $module . "::module_author;");
+ eval("\$module_description = " . $module . "::module_description;");
+ eval("\$module_information = " . $module . "::module_info();");
+
+ echo pts_string_header("Module: " . $module_name);
+
+ echo "Version: " . $module_version . "\n";
+ echo "Author: " . $module_author . "\n";
+ echo "Description: " . $module_description . "\n";
+
+ if(!empty($module_information))
+ echo $module_information . "\n";
+
+ echo "\n";
+ }
+ else
+ {
+ echo "\n" . $ARG_1 . " is not recognized.\n";
+ }
+ break;
case "SHOW_RESULT":
if(is_file(SAVE_RESULTS_DIR . $ARG_1 . "/composite.xml"))
$URL = SAVE_RESULTS_DIR . $ARG_1 . "/composite.xml";
@@ -517,9 +546,6 @@ switch($COMMAND)
echo $ARG_1 . " is an unrecognized PTS Global ID.\n\n";
}
break;
- case "SENSORS":
- echo "\nThis option was dropped in Phoronix Test Suite 1.2. For more information, view the latest documentation.\n\n";
- break;
case "SENSOR_OPTIONS":
//echo "\nThe Phoronix Test Suite supports monitoring various system hardware sensors through the LM_Sensors and ACPI interfaces. The Phoronix Test Suite will automatically monitor the selected sensors while each test is running and at the end will then provide the low and high thresholds for each sensor as well as the average. In addition, the sensor results are then plotted on line graphs and can be viewed through the PTS Results Viewer.\n";
echo "\nMonitoring these sensors are as easy as running your normal Phoronix Test Suite commands but at the beginning of the command add: MONITOR=<selected sensors> (example: MONITOR=cpu.temp,cpu.voltage phoronix-test-suite benchmark universe). Below are all of the sensors supported by this version of the Phoronix Test Suite.\n\n";
@@ -531,6 +557,9 @@ switch($COMMAND)
case "VERSION":
echo "\nPhoronix Test Suite v" . PTS_VERSION . " (" . PTS_CODENAME . ")\n\n";
break;
+ case "SENSORS":
+ echo "\nThis option was dropped from the Phoronix Test Suite. For more information and the replacement option, view the latest documentation.\n\n";
+ break;
default:
echo "Phoronix Test Suite: Internal Error.\nCommand Not Recognized (" . $COMMAND . ").\n";
}