Compare commits
137 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b1f7f191f | ||
|
|
516b41017a | ||
|
|
0ea2375c87 | ||
|
|
be1a4dec8a | ||
|
|
7aadba1d57 | ||
|
|
7bf6c03113 | ||
|
|
60716494e6 | ||
|
|
51acdc67c7 | ||
|
|
c279b0a3a3 | ||
|
|
bf2e8dcc16 | ||
|
|
791d82ecdf | ||
|
|
ed27e1a36f | ||
|
|
da86cd5046 | ||
|
|
78b7da54ef | ||
|
|
f8f16f3e87 | ||
|
|
6885629cb7 | ||
|
|
024189d25d | ||
|
|
8782fcdaa5 | ||
|
|
5bbf8a8caf | ||
|
|
1d21ea4a53 | ||
|
|
ea890b7b8b | ||
|
|
da2648fec8 | ||
|
|
767e8641e1 | ||
|
|
1658bf1e65 | ||
|
|
5245f152a1 | ||
|
|
3cae6d56a6 | ||
|
|
22e0a1134a | ||
|
|
18f8662c24 | ||
|
|
42b9a5b6fd | ||
|
|
2e57174e46 | ||
|
|
39aef2d526 | ||
|
|
9af4fe7a0e | ||
|
|
894364a09c | ||
|
|
3bbd06d599 | ||
|
|
1907838b35 | ||
|
|
8eda4a5a91 | ||
|
|
712de905a4 | ||
|
|
a1d05a987c | ||
|
|
abbe900f13 | ||
|
|
5a96db3380 | ||
|
|
56ef1a00b6 | ||
|
|
e6f19c8988 | ||
|
|
0d768702e0 | ||
|
|
a45895b0ff | ||
|
|
c1a6dcc851 | ||
|
|
eafc5b7a7f | ||
|
|
1c31a919b6 | ||
|
|
5e02c1202c | ||
|
|
2c9cfa4aa7 | ||
|
|
9b22974ea4 | ||
|
|
bee7eeb30a | ||
|
|
a7a0a85183 | ||
|
|
be6ee9b44e | ||
|
|
98a9f44146 | ||
|
|
9004ab7410 | ||
|
|
43e0657d62 | ||
|
|
639a4739e5 | ||
|
|
5d988fb686 | ||
|
|
602ad4bd8e | ||
|
|
7ea7799327 | ||
|
|
edce918fc2 | ||
|
|
66966c63bd | ||
|
|
4fdbf3e04d | ||
|
|
28689112ef | ||
|
|
bfbd5600bf | ||
|
|
4ba6342b94 | ||
|
|
d72518f471 | ||
|
|
e1340308aa | ||
|
|
e9788b9f35 | ||
|
|
3b65a0329e | ||
|
|
7c02413dc6 | ||
|
|
9a4d519a18 | ||
|
|
218f5cfab0 | ||
|
|
82389c8e6a | ||
|
|
fd26da038a | ||
|
|
0c84dd460c | ||
|
|
05e5b13b17 | ||
|
|
976a1564c2 | ||
|
|
803e11d274 | ||
|
|
4f60331beb | ||
|
|
5219e0a08d | ||
|
|
c166443a11 | ||
|
|
d8d72f6d4e | ||
|
|
4be09f1155 | ||
|
|
c4a82ae8f6 | ||
|
|
a19b10d401 | ||
|
|
5d941004e2 | ||
|
|
c3c47d7829 | ||
|
|
ec013399f0 | ||
|
|
60154761b5 | ||
|
|
afa41dcb8b | ||
|
|
200f25160d | ||
|
|
a21ae0bbc1 | ||
|
|
ffdd31d273 | ||
|
|
460fda86bf | ||
|
|
7607477254 | ||
|
|
1bf2f3239a | ||
|
|
c569da824c | ||
|
|
f3891dc41d | ||
|
|
c5908f1979 | ||
|
|
7b734c9cd9 | ||
|
|
e1d75936de | ||
|
|
7d0b809ea9 | ||
|
|
a71bd2cbf8 | ||
|
|
8941860e9b | ||
|
|
a000c0ef20 | ||
|
|
e4b47aa5a4 | ||
|
|
3b95afe1f0 | ||
|
|
d279629ee4 | ||
|
|
a28727598e | ||
|
|
5f23296e9b | ||
|
|
09e721cfda | ||
|
|
a87b8fbad7 | ||
|
|
2ccaf6eab9 | ||
|
|
5d26bc75ab | ||
|
|
38b813186e | ||
|
|
f66269971b | ||
|
|
b10d6d62bb | ||
|
|
d2f7ef4d59 | ||
|
|
eaac34ce9b | ||
|
|
4f3c6d1046 | ||
|
|
ee17c558b5 | ||
|
|
1adc5604d7 | ||
|
|
c5d6fbe9b7 | ||
|
|
c6170880ed | ||
|
|
bba7a462b7 | ||
|
|
a023c9ffb8 | ||
|
|
98f536a827 | ||
|
|
aec95545da | ||
|
|
e10563d25c | ||
|
|
360b2ea52c | ||
|
|
d7000da52b | ||
|
|
52f97d07fe | ||
|
|
a469cd9b24 | ||
|
|
d3c26130d8 | ||
|
|
b6958aea66 | ||
|
|
cd9f20a553 |
2
AUTHORS
2
AUTHORS
@@ -1,4 +1,4 @@
|
||||
Copyright 2008 - 2016 by Phoronix Media.
|
||||
Copyright 2008 - 2017 by Phoronix Media.
|
||||
|
||||
Lead Architects:
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Phoronix Test Suite 6.8.0
|
||||
# Phoronix Test Suite 7.0.0
|
||||
http://www.phoronix-test-suite.com/
|
||||
|
||||
The **Phoronix Test Suite** is the most comprehensive testing and benchmarking
|
||||
|
||||
@@ -63,7 +63,7 @@ $control_file .= "Section: Utilities\n";
|
||||
$control_file .= "Installed-Size: " . shell_exec("cd /tmp/pts-deb-builder/; du -s | cut -f 1");
|
||||
$control_file .= "Priority: optional\n";
|
||||
$control_file .= "Architecture: all\n";
|
||||
$control_file .= "Depends: php-cli|php5-cli,php5-xml|php-xml\n";
|
||||
$control_file .= "Depends: php-cli|php5-cli,php5-cli|php-xml\n";
|
||||
$control_file .= "Recommends: build-essential, php-gd|php5-gd\n";
|
||||
$control_file .= "Maintainer: Phoronix Media <trondheim-pts@phoronix-test-suite.com>\n";
|
||||
$control_file .= "Description: An Automated, Open-Source Testing Framework\n " . @str_replace("\n", " ", file_get_contents('pts-core/static/short-description.txt')) . "\n";
|
||||
|
||||
@@ -30,7 +30,6 @@ PHORONIX TEST SUITE PUBLIC TODO LIST:
|
||||
|
||||
### POSSIBLE NEW TEST PROFILES ###
|
||||
|
||||
- Python-libmemcached [http://code.google.com/p/python-libmemcached/]
|
||||
- Intel HiBench [https://github.com/intel-hadoop/HiBench]
|
||||
- Hadoop Benchmarks / TeraSort
|
||||
- LATT Latency Tests [git://git.kernel.dk/latt.git]
|
||||
@@ -63,7 +62,6 @@ PHORONIX TEST SUITE PUBLIC TODO LIST:
|
||||
- https://openfoamwiki.net/index.php/Benchmarks_standard_v1
|
||||
- Cassandra 1.2 stress - http://docs.datastax.com/en/cassandra/1.2/cassandra/tools/toolsCStress_t.html
|
||||
- http://gcc.opensuse.org/c++bench-frescobaldi/
|
||||
- http://dacapobench.org/
|
||||
- https://github.com/GoogleCloudPlatform/PerfKitBenchmarker
|
||||
- https://gooseberry.blender.org/gooseberry-production-benchmark-file/
|
||||
- https://github.com/hhvm/oss-performance
|
||||
@@ -75,6 +73,7 @@ PHORONIX TEST SUITE PUBLIC TODO LIST:
|
||||
- http://dacapobench.org/
|
||||
- https://github.com/soumith/convnet-benchmarks
|
||||
- https://github.com/cavazos-lab/FinanceBench
|
||||
- https://svail.github.io/DeepBench/
|
||||
|
||||
### WEB SOCKET / HTML5 USER INTERFACE WORK ###
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH phoronix-test-suite 1 "www.phoronix-test-suite.com" "6.8.0"
|
||||
.TH phoronix-test-suite 1 "www.phoronix-test-suite.com" "7.0.0"
|
||||
.SH NAME
|
||||
phoronix-test-suite \- The Phoronix Test Suite is an extensible open-source platform for performing testing and performance evaluation.
|
||||
.SH SYNOPSIS
|
||||
@@ -10,10 +10,10 @@ The **Phoronix Test Suite** is the most comprehensive testing and benchmarking p
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.SH TEST INSTALLATION
|
||||
.B install [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
.B install [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
This option will install the selected test(s) inside the testing environment directory. The install process from downloading of the test files to the installation is fully automated. The install option needs to be supplied with the test name or suite as an argument. Optionally, a OpenBenchmarking.org ID or the name of a saved results file can be supplied as well and the test(s) to install will automatically be extracted from that information. If the test is already installed and was run by the latest version of the installation process, no action will be taken. Multiple arguments can be supplied to install additional tests at the same time.
|
||||
.TP
|
||||
.B install-dependencies [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
.B install-dependencies [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
This option will install the external dependencies needed by the selected test(s) using the distribution's package management system. For example, some tests depend upon GCC for compiling code. If GCC is not detected on the system, the Phoronix Test Suite will attempt to install GCC using the distribution's package management system. If you are running this command as a local user, you may be prompted for the root password while the process is running. For unsupported distributions, the dependency names will be displayed along with common names for the package. The install-dependencies option needs to be supplied with the test name or suite as an argument. When using the install option, the external dependencies are automatically checked.
|
||||
.TP
|
||||
.B make-download-cache
|
||||
@@ -26,13 +26,13 @@ This option will permanently remove a installed test by the Phoronix Test Suite.
|
||||
.B auto-compare
|
||||
This option will autonomously determine the most relevant test(s) to run for any selected sub-system(s). The tests to run are determined via OpenBenchmarking.org integration with the global results pool. Related test results from OpenBenchmarking.org are also merged to provide a straight-forward and effective means of carrying out a system comparison. If wishing to find comparable results for any particular test profile(s), simply pass the test profile names as additional arguments to this command.
|
||||
.TP
|
||||
.B benchmark [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
.B benchmark [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
This option will install the selected test(s) (if needed) and will proceed to run the test(s). This option is equivalent to running phoronix-test-suite with the install option followed by the run option. Multiple arguments can be supplied to run additional tests at the same time and save the results into one file.
|
||||
.TP
|
||||
.B finish-run [Test Result]
|
||||
This option can be used if a test run had not properly finished running all tests within a saved results file. Using this option when specifying a saved results file where all tests had not completed will attempt to finish testing on the remaining tests where there are missing results.
|
||||
.TP
|
||||
.B run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
.B run [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
This option will run the selected test(s).
|
||||
.TP
|
||||
.B run-random-tests
|
||||
@@ -41,29 +41,29 @@ This option will query OpenBenchmarking.org to run random benchmarks and result
|
||||
.B run-tests-in-suite
|
||||
This option can be used if you wish to run all of the tests found in a supplied suite, but you wish to re-configure each of the test options rather than using the defaults supplied by the suite.
|
||||
.TP
|
||||
.B stress-run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
.B stress-run [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
This option will run the passed tests/suites in the multi-process stress-testing mode. The stress-run mode will not produce a result file but is rather intended for running multiple test profiles concurrently to stress / burn-in the system. The number of tests to run concurrently can be toggled via the PTS_CONCURRENT_TEST_RUNS environment variable and by default is set to a value of 2.
|
||||
.TP
|
||||
.SH BATCH TESTING
|
||||
.B batch-benchmark [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
.B batch-benchmark [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
This option and its arguments are equivalent to the benchmark option, but the process will be run in the Phoronix Test Suite batch mode.
|
||||
.TP
|
||||
.B batch-install [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
.B batch-install [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
If you wish to run the install process in the Phoronix Test Suite batch mode but do not wish to run any tests at this time. Running the install process in the batch mode will use the default values and not prompt the user of any possible options, to ensure the process is fully automated.
|
||||
.TP
|
||||
.B batch-run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
.B batch-run [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
This option and its arguments are equivalent to the run option, but the process will be run in the Phoronix Test Suite batch mode.
|
||||
.TP
|
||||
.B batch-setup
|
||||
This option is used to configure the batch mode options for the Phoronix Test Suite, which is subsequently written to the user configuration file. Among the options are whether to automatically upload the test results to OpenBenchmarking.org and prompting for the saved file name.
|
||||
.TP
|
||||
.B default-benchmark [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
.B default-benchmark [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
This option will install the selected test(s) (if needed) and will proceed to run the test(s) in the defaults mode. This option is equivalent to running phoronix-test-suite with the install option followed by the default-run option.
|
||||
.TP
|
||||
.B default-run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
.B default-run [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
This option will run the selected test(s). The name of the test or suite must be supplied or the OpenBenchmarking.org ID or saved local file name. Multiple arguments can be supplied to run additional tests at the same time and save the results in a suite-like fashion. Unlike the normal run option, the default-run will not prompt the user to select from the available test options but will instead use the default options as automatically set by pts-core or the test profile. Use batch-run to automatically test all of the available options.
|
||||
.TP
|
||||
.B internal-run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
.B internal-run [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
This option and its arguments pre-set the Phoronix Test Suite batch run mode with sane values for carrying out benchmarks in a semi-automated manner and without uploading any of the result data to the public OpenBenchmarking.org.
|
||||
.TP
|
||||
.SH OPENBENCHMARKING.ORG
|
||||
@@ -101,9 +101,6 @@ This option can be used for uploading a test profile to your account on OpenBenc
|
||||
This option can be used for uploading a test suite to your account on OpenBenchmarking.org. By uploading your test suite to OpenBenchmarking.org, others are then able to browse and access this test suite for easy distribution.
|
||||
.TP
|
||||
.SH SYSTEM
|
||||
.B detailed-system-info
|
||||
Display detailed information about the installed system hardware and software information as detected by the Phoronix Test Suite Phodevi Library.
|
||||
.TP
|
||||
.B diagnostics
|
||||
This option will print information that is useful to developers when debugging problems with the Phoronix Test Suite and/or test profiles and test suites.
|
||||
.TP
|
||||
@@ -120,7 +117,10 @@ Display the installed system hardware and software information as detected by th
|
||||
Display the installed system hardware and software sensors in real-time as detected by the Phoronix Test Suite Phodevi Library.
|
||||
.TP
|
||||
.SH INFORMATION
|
||||
.B info [Test | Suite | OpenBenchmarking.org ID | Test Result]
|
||||
.B estimate-run-time [Test | Suite | OpenBenchmarking ID | Test Result]
|
||||
This option will provide estimates for test run-time / length.
|
||||
.TP
|
||||
.B info [Test | Suite | OpenBenchmarking ID | Test Result]
|
||||
This option will show details about the supplied test, suite, virtual suite, or result file.
|
||||
.TP
|
||||
.B list-available-suites
|
||||
@@ -160,19 +160,22 @@ This option will list various details about installed tests and their usage.
|
||||
This option will list all available test profiles that are available from the enabled OpenBenchmarking.org repositories but are NOT SUPPORTED on the given hardware/software platform. This is mainly a debugging option for those looking for test profiles to potentially port to new platforms, etc.
|
||||
.TP
|
||||
.SH ASSET CREATION
|
||||
.B debug-benchmark [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
.B debug-benchmark [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
This option is intended for use by test profile writers and is identical to the <em>run</em> option but will yield more information during the run process that can be used to debug issues with a test profile or to verify the test profile is functioning correctly.
|
||||
.TP
|
||||
.B debug-install [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
.B debug-install [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
This option is intended for use by test profile writers and is identical to the install option but will yield more information during the run process that can be used to debug issues with a test profile installer or to verify the test profile is functioning correctly.
|
||||
.TP
|
||||
.B debug-test-download-links [Test | Suite | OpenBenchmarking.org ID | Test Result]
|
||||
.B debug-result-parser [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
This option is intended for use by test profile writers and is used for debugging a result parser. No test execution is done, but there must already be PTS-generated .log files present within the test's installation directory.
|
||||
.TP
|
||||
.B debug-test-download-links [Test | Suite | OpenBenchmarking ID | Test Result]
|
||||
This option will check all download links within the specified test profile(s) to ensure there are no broken URLs.
|
||||
.TP
|
||||
.B download-test-files [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
.B download-test-files [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
This will download the selected test file(s) to the Phoronix Test Suite download cache but will not install the tests.
|
||||
.TP
|
||||
.B force-install [Test | Suite | OpenBenchmarking.org ID | Test Result] ...
|
||||
.B force-install [Test | Suite | OpenBenchmarking ID | Test Result] ...
|
||||
This option will force the installation (or re-installation) of a test or suite. The arguments and process is similar to the install option but even if the test is installed, the entire installation process will automatically be executed. This option is generally used when debugging a test installation problem.
|
||||
.TP
|
||||
.B result-file-to-suite [Test Result]
|
||||
@@ -233,6 +236,9 @@ This option will read a saved test results file and output the system hardware a
|
||||
.B show-result [Test Result]
|
||||
Open up the test results in the Phoronix Test Suite Result Viewer or on OpenBenchmarking.org.
|
||||
.TP
|
||||
.B winners-and-losers [Test Result]
|
||||
This option is used if you wish to analyze a result file to see which runs produced the most wins/losses of those result identifiers in the saved file.
|
||||
.TP
|
||||
.SH RESULT ANALYTICS
|
||||
.B analyze-all-runs [Test Result]
|
||||
This option will generate a candlestick graph showing the distribution of results from all trial runs. The candlestick graph is similar to the Japanese candlestick charts used by the financial industry, except instead of representing stock data it is numerical result data from all trial runs.\n\nThe tip of the upper-wick represents the highest value of the test runs with the tip of the lower-wick representing the lowest value of all test runs. The upper-edge of the candle body represents the first or last run value and the lower-edge represents the first or last run value. Lastly, if the last run value is less than the first run value, the candle body is the same color as the graph background, otherwise the last run value is greater.
|
||||
@@ -270,7 +276,7 @@ This option will display the Phoronix Test Suite client version.
|
||||
.TP
|
||||
.SH WEB / GUI SUPPORT
|
||||
.B gui
|
||||
Launch the Phoronix Test Suite HTML5 web user-interface in the local GUI mode (no remote web support) and attempt to auto-launch the web-browser.
|
||||
Launch the Phoronix Test Suite HTML5 web user-interface in the local GUI mode (no remote web support) and attempt to auto-launch the web-browser. THIS FEATURE IS CURRENTLY EXPERIMENTAL AND NO LONGER ACTIVE DEVELOPMENT. See Phoronix Test Suite Phoromatic as an alternative web UI approach.
|
||||
.TP
|
||||
.B start-remote-gui-server
|
||||
Start the GUI web server and WebSocket server processes for remote (or local) access via the web-browser. The settings can be configured via the Phoronix Test Suite's XML configuration file.
|
||||
@@ -308,5 +314,5 @@ http://www.phoronix.com/
|
||||
.br
|
||||
http://www.phoronix.com/forums/
|
||||
.SH AUTHORS
|
||||
Copyright 2008 - 2016 by Phoronix Media, Michael Larabel.
|
||||
Copyright 2008 - 2017 by Phoronix Media, Michael Larabel.
|
||||
.TP
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -8,7 +8,7 @@
|
||||
<p>Among the distributions where the Phoronix Test Suite has been officially tested include Ubuntu, Fedora, Mandriva / Mageia, Gentoo, PCLinuxOS, Arch Linux, Pardus, OpenSuSE, Optware, webOS, Zenwalk, CentOS, Red Hat Enterprise Linux, Oracle Linux, Scientific Linux, Debian, Mint, MEPIS, Alpine Linux, Void Linux, Intel Clear Linux, and Amazon Linux EC2.</p>
|
||||
<p>Among the tested BSD distributions are FreeBSD, PC-BSD, NetBSD, OpenBSD, Debian GNU/kFreeBSD, and DragonflyBSD. Tested Solaris distributions include OpenSolaris, Solaris Express 11, Oracle Solaris 11, OpenIndiana, Illumos, and Nexenta.</p>
|
||||
<h1>Dependencies</h1>
|
||||
<p>The only required dependency for the Phoronix Test Suite is PHP 5.3 or newer. On Linux distributions, the needed package is commonly called <em>php5-cli</em> or <em>php-cli</em> or <em>php</em>. It is important to note that only PHP for the command-line is needed and not a web server (Apache) or other packages commonly associated with PHP and its usage by web-sites. The PHP5 version required is PHP 5.3+ and can also be found at <a href="http://www.php.net/">www.php.net</a>.</p>
|
||||
<p>The only required dependency for the Phoronix Test Suite is PHP 5.3 or newer. On Linux distributions, the needed package is commonly called <em>php5-cli</em> or <em>php-cli</em> or <em>php7</em> or <em>php</em>. It is important to note that only PHP for the command-line is needed and not a web server (Apache) or other packages commonly associated with PHP and its usage by web-sites. The PHP5 version required is PHP 5.3+ and can also be found at <a href="http://www.php.net/">www.php.net</a>. PHP 7 is fully supported by the Phoronix Test Suite as well as HHVM.</p>
|
||||
|
||||
<p>For installing PHP on Windows, the <a href="https://www.microsoft.com/web/platform/phponwindows.aspx">Microsoft Web Platform Installer</a> provides an automated alternative that will install PHP into the directory expected by Phoronix Test Suite. Users opting to install PHP manually must extract the files to <em>C:\Program Files (x86)\PHP\</em> or a subdirectory.</p>
|
||||
<p>As part of the PHP requirement, the following PHP extensions are required and/or highly recommended in order to take advantage of the Phoronix Test Suite capabilities:</p>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@
|
||||
|
||||
# Phoronix Test Suite
|
||||
# URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
# Copyright (C) 2008 - 2016, Phoronix Media
|
||||
# Copyright (C) 2008 - 2017, Phoronix Media
|
||||
#
|
||||
# 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
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#
|
||||
# Phoronix Test Suite
|
||||
# URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
# Copyright (C) 2008 - 2016, Phoronix Media
|
||||
# Copyright (C) 2008 - 2016, Michael Larabel
|
||||
# Copyright (C) 2008 - 2017, Phoronix Media
|
||||
# Copyright (C) 2008 - 2017, Michael Larabel
|
||||
# phoronix-test-suite: The Phoronix Test Suite is an extensible open-source testing / benchmarking platform
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -92,7 +92,7 @@ if [ "X$PHP_BIN" = "X" ]
|
||||
then
|
||||
cat <<'EOT'
|
||||
|
||||
PHP 5.3 or newer must be installed for the Phoronix Test Suite
|
||||
PHP 5.3 or newer or PHP 7 must be installed for the Phoronix Test Suite
|
||||
The PHP command-line package is commonly called php-cli, php5-cli, or php.
|
||||
For more information visit: http://www.phoronix-test-suite.com/
|
||||
|
||||
@@ -102,7 +102,7 @@ if [ -x /usr/bin/zypper ]
|
||||
then
|
||||
# SUSE / OpenSUSE
|
||||
echo "The command to likely run for your operating system is: "
|
||||
echo "# zypper install php5 php5-zip"
|
||||
echo "# zypper install php7 php7-zip"
|
||||
echo " "
|
||||
elif [ -x /usr/bin/apt-get ]
|
||||
then
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
:: Phoronix Test Suite
|
||||
:: URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
:: Copyright (C) 2008 - 2016, Phoronix Media
|
||||
:: Copyright (C) 2008 - 2016, Michael Larabel
|
||||
:: Copyright (C) 2008 - 2017, Phoronix Media
|
||||
:: Copyright (C) 2008 - 2017, Michael Larabel
|
||||
:: phoronix-test-suite: The Phoronix Test Suite is an extensible open-source testing / benchmarking platform
|
||||
::
|
||||
:: This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2015 - 2016, Phoronix Media
|
||||
Copyright (C) 2015 - 2016, Michael Larabel
|
||||
Copyright (C) 2015 - 2017, Phoronix Media
|
||||
Copyright (C) 2015 - 2017, 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
|
||||
@@ -101,6 +101,19 @@ class debug_render_test implements pts_option_interface
|
||||
$dump_size += strlen($html_dump);
|
||||
file_put_contents(PATH_TO_EXPORTED_PHOROMATIC_DATA . $REQUESTED . '.html', $html_dump . '</body></html>');
|
||||
}
|
||||
|
||||
if(getenv('DEBUG_RENDER_TEST_LOCAL_TOO') != false)
|
||||
{
|
||||
echo PHP_EOL . 'LOCAL RENDER TEST TIME' . PHP_EOL;
|
||||
$extra_graph_attributes = null;
|
||||
foreach(pts_client::saved_test_results() as $saved_result)
|
||||
{
|
||||
$save_to_dir = pts_client::setup_test_result_directory($saved_result);
|
||||
$generated_graphs = pts_client::generate_result_file_graphs($saved_result, $save_to_dir, $extra_graph_attributes);
|
||||
echo $saved_result . ': ' . count($generated_graphs) . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
echo PHP_EOL . 'RENDER TEST TOOK: ' . (time() - $start) . PHP_EOL . PHP_EOL;
|
||||
echo PHP_EOL . 'PEAK MEMORY USAGE: ' . round(memory_get_peak_usage(true) / 1048576, 3) . ' MB';
|
||||
echo PHP_EOL . 'PEAK MEMORY USAGE (emalloc): ' . round(memory_get_peak_usage() / 1048576, 3) . ' MB';
|
||||
|
||||
48
pts-core/commands/debug_result_parser.php
Normal file
48
pts-core/commands/debug_result_parser.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2017, Phoronix Media
|
||||
Copyright (C) 2017, 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
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class debug_result_parser implements pts_option_interface
|
||||
{
|
||||
const doc_section = 'Asset Creation';
|
||||
const doc_description = 'This option is intended for use by test profile writers and is used for debugging a result parser. No test execution is done, but there must already be PTS-generated .log files present within the test\'s installation directory.';
|
||||
|
||||
public static function argument_checks()
|
||||
{
|
||||
return array(
|
||||
new pts_argument_check('VARIABLE_LENGTH', array('pts_types', 'identifier_to_object'), null)
|
||||
);
|
||||
}
|
||||
public static function run($r)
|
||||
{
|
||||
// Make sure you're debugging the latest test script...
|
||||
//pts_test_installer::standard_install($r);
|
||||
// For debugging, usually running just once is sufficient, unless FORCE_TIMES_TO_RUN is preset
|
||||
pts_client::pts_set_environment_variable('FORCE_TIMES_TO_RUN', 1);
|
||||
// Run the test(s) in debug mode
|
||||
pts_client::set_debug_mode(true);
|
||||
$test_run_manager = new pts_test_run_manager();
|
||||
$test_run_manager->DEBUG_no_test_execution_just_result_parse = true;
|
||||
$test_run_manager->standard_run($r);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,57 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2011 - 2015, Phoronix Media
|
||||
Copyright (C) 2011 - 2015, 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
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class detailed_system_info implements pts_option_interface
|
||||
{
|
||||
const doc_section = 'System';
|
||||
const doc_description = 'Display detailed information about the installed system hardware and software information as detected by the Phoronix Test Suite Phodevi Library.';
|
||||
|
||||
public static function run($r)
|
||||
{
|
||||
pts_client::$display->generic_heading('System Information');
|
||||
echo 'Hardware:' . PHP_EOL . phodevi::system_hardware(true) . PHP_EOL . PHP_EOL;
|
||||
echo 'Software:' . PHP_EOL . phodevi::system_software(true) . PHP_EOL . PHP_EOL;
|
||||
|
||||
//
|
||||
// Processor Information
|
||||
//
|
||||
|
||||
$cpu_flags = phodevi_cpu::get_cpu_flags();
|
||||
echo PHP_EOL . 'PROCESSOR:' . PHP_EOL . PHP_EOL;
|
||||
echo 'Core Count: ' . phodevi_cpu::cpuinfo_core_count() . PHP_EOL;
|
||||
echo 'Thread Count: ' . phodevi_cpu::cpuinfo_thread_count() . PHP_EOL;
|
||||
echo 'Cache Size: ' . phodevi_cpu::cpuinfo_cache_size() . ' KB' . PHP_EOL;
|
||||
|
||||
echo 'Instruction Set Extensions: ' . phodevi_cpu::instruction_set_extensions() . PHP_EOL;
|
||||
echo 'AES Encryption: ' . ($cpu_flags & phodevi_cpu::get_cpu_feature_constant('aes') ? 'YES' : 'NO') . PHP_EOL;
|
||||
echo 'Energy Performance Bias: ' . ($cpu_flags & phodevi_cpu::get_cpu_feature_constant('epb') ? 'YES' : 'NO') . PHP_EOL;
|
||||
echo 'Virtualization: ' . (phodevi_cpu::virtualization_technology() ? phodevi_cpu::virtualization_technology() : 'NO') . PHP_EOL;
|
||||
|
||||
// Other info
|
||||
foreach(pts_arrays::to_array(pts_test_run_manager::pull_test_notes(true)) as $test_note_head => $test_note)
|
||||
{
|
||||
echo ucwords(str_replace('-', ' ', $test_note_head)) . ': ' . $test_note . PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
63
pts-core/commands/estimate_run_time.php
Normal file
63
pts-core/commands/estimate_run_time.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2017, Phoronix Media
|
||||
Copyright (C) 2017, 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
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class estimate_run_time implements pts_option_interface
|
||||
{
|
||||
const doc_section = 'Information';
|
||||
const doc_description = 'This option will provide estimates for test run-time / length.';
|
||||
|
||||
public static function argument_checks()
|
||||
{
|
||||
return array(
|
||||
new pts_argument_check(0, array('pts_types', 'identifier_to_object'))
|
||||
);
|
||||
}
|
||||
public static function run($args)
|
||||
{
|
||||
echo PHP_EOL;
|
||||
|
||||
if($args[0] == 'pts/all' || empty($args))
|
||||
{
|
||||
$args = pts_openbenchmarking::available_tests(false);
|
||||
}
|
||||
|
||||
$tests = array();
|
||||
$total_time = 0;
|
||||
$test_count = 0;
|
||||
foreach($args as $arg)
|
||||
{
|
||||
foreach(pts_types::identifiers_to_test_profile_objects($arg) as $t)
|
||||
{
|
||||
$tests[] = array($t->get_identifier(), pts_strings::format_time($t->get_estimated_run_time()));
|
||||
$total_time += $t->get_estimated_run_time();
|
||||
$test_count++;
|
||||
}
|
||||
}
|
||||
if($test_count > 1 && $total_time > 0)
|
||||
{
|
||||
echo pts_user_io::display_text_table($tests);
|
||||
echo PHP_EOL . PHP_EOL . 'TOTAL TIME ESTIMATE: ' . pts_strings::format_time($total_time) . PHP_EOL . PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -23,7 +23,7 @@
|
||||
class gui implements pts_option_interface
|
||||
{
|
||||
const doc_section = 'Web / GUI Support';
|
||||
const doc_description = 'Launch the Phoronix Test Suite HTML5 web user-interface in the local GUI mode (no remote web support) and attempt to auto-launch the web-browser.';
|
||||
const doc_description = 'Launch the Phoronix Test Suite HTML5 web user-interface in the local GUI mode (no remote web support) and attempt to auto-launch the web-browser. THIS FEATURE IS CURRENTLY EXPERIMENTAL AND NO LONGER ACTIVE DEVELOPMENT. See Phoronix Test Suite Phoromatic as an alternative web UI approach.';
|
||||
|
||||
public static function command_aliases()
|
||||
{
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2010 - 2015, Phoronix Media
|
||||
Copyright (C) 2010 - 2015, Michael Larabel
|
||||
Copyright (C) 2010 - 2017, Phoronix Media
|
||||
Copyright (C) 2010 - 2017, 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
|
||||
@@ -27,7 +27,7 @@ class help implements pts_option_interface
|
||||
|
||||
public static function run($r)
|
||||
{
|
||||
echo PHP_EOL . pts_core::program_title(true) . PHP_EOL . PHP_EOL;
|
||||
echo PHP_EOL . pts_client::cli_colored_text(pts_core::program_title(true), 'green', true) . PHP_EOL . PHP_EOL;
|
||||
echo pts_documentation::basic_description() . PHP_EOL . PHP_EOL . 'View the included PDF / HTML documentation or visit http://www.phoronix-test-suite.com/ for full details.' . PHP_EOL;
|
||||
$options = pts_documentation::client_commands_array();
|
||||
|
||||
@@ -38,13 +38,15 @@ class help implements pts_option_interface
|
||||
continue;
|
||||
}
|
||||
|
||||
echo PHP_EOL . strtoupper($section) . PHP_EOL . PHP_EOL;
|
||||
echo PHP_EOL . pts_client::cli_just_bold(strtoupper($section)) . PHP_EOL . PHP_EOL;
|
||||
|
||||
sort($contents);
|
||||
$tabled = array();
|
||||
foreach($contents as &$option)
|
||||
{
|
||||
echo ' ' . trim($option[0] . ' ' . implode(' ', $option[1])) . PHP_EOL;
|
||||
$tabled[] = array($option[0], pts_client::cli_colored_text(implode(' ', $option[1]), 'gray'));
|
||||
}
|
||||
echo pts_user_io::display_text_table($tabled, ' ') . PHP_EOL;
|
||||
}
|
||||
echo PHP_EOL;
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, 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
|
||||
@@ -47,13 +47,13 @@ class info implements pts_option_interface
|
||||
if($o instanceof pts_test_suite)
|
||||
{
|
||||
pts_client::$display->generic_heading($o->get_title());
|
||||
echo 'Run Identifier: ' . $o->get_identifier() . PHP_EOL;
|
||||
echo 'Suite Version: ' . $o->get_version() . PHP_EOL;
|
||||
echo 'Maintainer: ' . $o->get_maintainer() . PHP_EOL;
|
||||
echo 'Suite Type: ' . $o->get_suite_type() . PHP_EOL;
|
||||
echo 'Unique Tests: ' . $o->get_unique_test_count() . PHP_EOL;
|
||||
echo 'Suite Description: ' . $o->get_description() . PHP_EOL;
|
||||
echo PHP_EOL . 'Contained Tests: ' . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Run Identifier: ') . $o->get_identifier() . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Suite Version: ') . $o->get_version() . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Maintainer: ') . $o->get_maintainer() . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Suite Type: ') . $o->get_suite_type() . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Unique Tests: ') . $o->get_unique_test_count() . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Suite Description: ') . $o->get_description() . PHP_EOL;
|
||||
echo PHP_EOL . pts_client::cli_just_bold('Contained Tests: ') . PHP_EOL;
|
||||
$test_table = array();
|
||||
foreach($o->get_contained_test_result_objects() as $result_obj)
|
||||
{
|
||||
@@ -72,32 +72,32 @@ class info implements pts_option_interface
|
||||
}
|
||||
|
||||
pts_client::$display->generic_heading($test_title);
|
||||
echo 'Run Identifier: ' . $o->get_identifier() . PHP_EOL;
|
||||
echo 'Profile Version: ' . $o->get_test_profile_version() . PHP_EOL;
|
||||
echo 'Maintainer: ' . $o->get_maintainer() . PHP_EOL;
|
||||
echo 'Test Type: ' . $o->get_test_hardware_type() . PHP_EOL;
|
||||
echo 'Software Type: ' . $o->get_test_software_type() . PHP_EOL;
|
||||
echo 'License Type: ' . $o->get_license() . PHP_EOL;
|
||||
echo 'Test Status: ' . $o->get_status() . PHP_EOL;
|
||||
echo 'Project Web-Site: ' . $o->get_project_url() . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Run Identifier: ') . $o->get_identifier() . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Profile Version: ') . $o->get_test_profile_version() . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Maintainer: ') . $o->get_maintainer() . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Test Type: ') . $o->get_test_hardware_type() . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Software Type: ') . $o->get_test_software_type() . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('License Type: ') . $o->get_license() . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Test Status: ') . $o->get_status() . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Project Web-Site: ') . $o->get_project_url() . PHP_EOL;
|
||||
if($o->get_estimated_run_time() > 1)
|
||||
{
|
||||
echo 'Estimated Run-Time: ' . $o->get_estimated_run_time() . ' Seconds' . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Estimated Run-Time: ') . $o->get_estimated_run_time() . ' Seconds' . PHP_EOL;
|
||||
}
|
||||
|
||||
$download_size = $o->get_download_size();
|
||||
if(!empty($download_size))
|
||||
{
|
||||
echo 'Download Size: ' . $download_size . ' MB' . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Download Size: ') . $download_size . ' MB' . PHP_EOL;
|
||||
}
|
||||
|
||||
$environment_size = $o->get_environment_size();
|
||||
if(!empty($environment_size))
|
||||
{
|
||||
echo 'Environment Size: ' . $environment_size . ' MB' . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Environment Size: ') . $environment_size . ' MB' . PHP_EOL;
|
||||
}
|
||||
|
||||
echo PHP_EOL . 'Description: ' . $o->get_description() . PHP_EOL;
|
||||
echo PHP_EOL . pts_client::cli_just_bold('Description: ') . $o->get_description() . PHP_EOL;
|
||||
|
||||
if($o->test_installation != false)
|
||||
{
|
||||
@@ -109,37 +109,37 @@ class info implements pts_option_interface
|
||||
$latest_time = $o->test_installation->get_latest_run_time();
|
||||
$latest_time = !empty($latest_time) ? pts_strings::format_time($latest_time, 'SECONDS') : 'N/A';
|
||||
|
||||
echo PHP_EOL . 'Test Installed: Yes' . PHP_EOL;
|
||||
echo 'Last Run: ' . $last_run . PHP_EOL;
|
||||
echo PHP_EOL . pts_client::cli_just_bold('Test Installed: ') . 'Yes' . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Last Run: ') . $last_run . PHP_EOL;
|
||||
|
||||
if($last_run != 'Never')
|
||||
{
|
||||
if($o->test_installation->get_run_count() > 1)
|
||||
{
|
||||
echo 'Average Run-Time: ' . $avg_time . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Average Run-Time: ') . $avg_time . PHP_EOL;
|
||||
}
|
||||
|
||||
echo 'Latest Run-Time: ' . $latest_time . PHP_EOL;
|
||||
echo 'Times Run: ' . $o->test_installation->get_run_count() . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Latest Run-Time: ') . $latest_time . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Times Run: ') . $o->test_installation->get_run_count() . PHP_EOL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo PHP_EOL . 'Test Installed: No' . PHP_EOL;
|
||||
echo PHP_EOL . pts_client::cli_just_bold('Test Installed: ') . 'No' . PHP_EOL;
|
||||
}
|
||||
|
||||
$dependencies = $o->get_external_dependencies();
|
||||
if(!empty($dependencies) && !empty($dependencies[0]))
|
||||
{
|
||||
echo PHP_EOL . 'Software Dependencies:' . PHP_EOL;
|
||||
echo PHP_EOL . pts_client::cli_just_bold('Software Dependencies:') . PHP_EOL;
|
||||
echo pts_user_io::display_text_list($o->get_dependency_names());
|
||||
}
|
||||
echo PHP_EOL;
|
||||
}
|
||||
else if($o instanceof pts_result_file)
|
||||
{
|
||||
echo 'Title: ' . $o->get_title() . PHP_EOL . 'Identifier: ' . $o->get_identifier() . PHP_EOL;
|
||||
echo PHP_EOL . 'Test Result Identifiers:' . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Title: ') . $o->get_title() . PHP_EOL . pts_client::cli_just_bold('Identifier: ') . $o->get_identifier() . PHP_EOL;
|
||||
echo PHP_EOL . pts_client::cli_just_bold('Test Result Identifiers:') . PHP_EOL;
|
||||
echo pts_user_io::display_text_list($o->get_system_identifiers());
|
||||
|
||||
$test_titles = array();
|
||||
@@ -153,7 +153,7 @@ class info implements pts_option_interface
|
||||
|
||||
if(count($test_titles) > 0)
|
||||
{
|
||||
echo PHP_EOL . 'Contained Tests:' . PHP_EOL;
|
||||
echo PHP_EOL . pts_client::cli_just_bold('Contained Tests:') . PHP_EOL;
|
||||
echo pts_user_io::display_text_list(array_unique($test_titles));
|
||||
}
|
||||
echo PHP_EOL;
|
||||
@@ -161,7 +161,7 @@ class info implements pts_option_interface
|
||||
else if($o instanceof pts_virtual_test_suite)
|
||||
{
|
||||
pts_client::$display->generic_heading($o->get_title());
|
||||
echo 'Virtual Suite Description: ' . $o->get_description() . PHP_EOL . PHP_EOL;
|
||||
echo pts_client::cli_just_bold('Virtual Suite Description: ') . $o->get_description() . PHP_EOL . PHP_EOL;
|
||||
|
||||
foreach($o->get_contained_test_profiles() as $test_profile)
|
||||
{
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2012, Phoronix Media
|
||||
Copyright (C) 2008 - 2012, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, 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
|
||||
@@ -32,7 +32,8 @@ class list_test_usage implements pts_option_interface
|
||||
|
||||
if(count($installed_tests) > 0)
|
||||
{
|
||||
echo sprintf('%-18ls %-8ls %-13ls %-11ls %-13ls %-10ls', 'TEST', 'VERSION', 'INSTALL DATE', 'LAST RUN', 'AVG RUN-TIME', 'TIMES RUN') . PHP_EOL;
|
||||
echo sprintf('%-32ls %-12ls %-11ls %-8ls %-6ls', 'TEST', 'INSTALL', 'LAST RUN', 'AVERAGE', 'TIMES') . PHP_EOL;
|
||||
echo sprintf('%-32ls %-12ls %-11ls %-8ls %-6ls', '', 'DATE', 'DATE', 'RUNTIME', 'RUN') . PHP_EOL;
|
||||
foreach($installed_tests as $identifier)
|
||||
{
|
||||
$test_profile = new pts_test_profile($identifier);
|
||||
@@ -45,7 +46,7 @@ class list_test_usage implements pts_option_interface
|
||||
$last_run = $test_profile->test_installation->get_last_run_date();
|
||||
$last_run = $last_run == '0000-00-00' ? 'NEVER' : $last_run;
|
||||
|
||||
echo sprintf('%-18ls - %-8ls %-13ls %-11ls %-13ls %-10ls', $identifier, $test_profile->test_installation->get_installed_version(), $test_profile->test_installation->get_install_date(), $last_run, $avg_time, $test_profile->test_installation->get_run_count()) . PHP_EOL;
|
||||
echo sprintf('%-32ls %-12ls %-11ls %-8ls %-6ls', $identifier, $test_profile->test_installation->get_install_date(), $last_run, $avg_time, $test_profile->test_installation->get_run_count()) . PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2012, Phoronix Media
|
||||
Copyright (C) 2008 - 2012, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, 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
|
||||
@@ -44,7 +44,15 @@ class show_result implements pts_option_interface
|
||||
pts_client::generate_result_file_graphs($r[0], PTS_SAVE_RESULTS_PATH . $r[0] . '/');
|
||||
}
|
||||
|
||||
pts_client::display_web_page($URL . '/index.html', null, false, true);
|
||||
if(pts_client::read_env('DISPLAY') == false)
|
||||
{
|
||||
$rf = new pts_result_file($r[0]);
|
||||
echo pts_result_file_output::result_file_to_text($rf, pts_client::terminal_width());
|
||||
}
|
||||
else
|
||||
{
|
||||
pts_client::display_web_page($URL . '/index.html', null, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2015 - 2016, Phoronix Media
|
||||
Copyright (C) 2015 - 2016, Michael Larabel
|
||||
Copyright (C) 2015 - 2017, Phoronix Media
|
||||
Copyright (C) 2015 - 2017, 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
|
||||
@@ -45,7 +45,7 @@ class stress_run implements pts_option_interface
|
||||
|
||||
$tests_to_run_concurrently = 2;
|
||||
|
||||
echo PHP_EOL . 'STRESS-RUN ENVIRONMENT VARIABLES:' . PHP_EOL;
|
||||
echo PHP_EOL . pts_client::cli_just_bold('STRESS-RUN ENVIRONMENT VARIABLES:') . PHP_EOL;
|
||||
|
||||
if(($j = getenv('PTS_CONCURRENT_TEST_RUNS')) && is_numeric($j) && $j > 1)
|
||||
{
|
||||
@@ -54,7 +54,7 @@ class stress_run implements pts_option_interface
|
||||
}
|
||||
else
|
||||
{
|
||||
echo PHP_EOL . 'PTS_CONCURRENT_TEST_RUNS: Set the PTS_CONCURRENT_TEST_RUNS environment variable to specify how many tests should be run concurrently during the stress-run process. If not specified, defaults to 2.' . PHP_EOL . PHP_EOL;
|
||||
echo PHP_EOL . pts_client::cli_just_bold('PTS_CONCURRENT_TEST_RUNS:') . ' Set the PTS_CONCURRENT_TEST_RUNS environment variable to specify how many tests should be run concurrently during the stress-run process. If not specified, defaults to 2.' . PHP_EOL . PHP_EOL;
|
||||
}
|
||||
|
||||
// Run the actual tests
|
||||
@@ -70,7 +70,7 @@ class stress_run implements pts_option_interface
|
||||
}
|
||||
else
|
||||
{
|
||||
echo PHP_EOL . 'TOTAL_LOOP_TIME: Set the TOTAL_LOOP_TIME environment variable if wishing to specify (in minutes) how long to run the stress-run process.' . PHP_EOL . PHP_EOL;
|
||||
echo PHP_EOL . pts_client::cli_just_bold('TOTAL_LOOP_TIME:') . ' Set the TOTAL_LOOP_TIME environment variable if wishing to specify (in minutes) how long to run the stress-run process.' . PHP_EOL . PHP_EOL;
|
||||
$total_loop_time = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2011, Phoronix Media
|
||||
Copyright (C) 2008 - 2011, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, 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
|
||||
@@ -28,8 +28,7 @@ class system_info implements pts_option_interface
|
||||
public static function run($r)
|
||||
{
|
||||
pts_client::$display->generic_heading('System Information');
|
||||
echo 'Hardware:' . PHP_EOL . phodevi::system_hardware(true) . PHP_EOL . PHP_EOL;
|
||||
echo 'Software:' . PHP_EOL . phodevi::system_software(true) . PHP_EOL . PHP_EOL;
|
||||
echo phodevi::system_centralized_view();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2016, Phoronix Media
|
||||
Copyright (C) 2009 - 2016, Michael Larabel
|
||||
Copyright (C) 2009 - 2017, Phoronix Media
|
||||
Copyright (C) 2009 - 2017, 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
|
||||
@@ -27,7 +27,8 @@ class system_sensors implements pts_option_interface
|
||||
|
||||
public static function run($r)
|
||||
{
|
||||
pts_client::$display->generic_heading('Supported Sensors');
|
||||
pts_client::$display->generic_heading('Supported Sensors For This System');
|
||||
$tabled = array();
|
||||
foreach(phodevi::supported_sensors() as $sensor)
|
||||
{
|
||||
$supported_devices = call_user_func(array($sensor[2], 'get_supported_devices'));
|
||||
@@ -39,30 +40,26 @@ class system_sensors implements pts_option_interface
|
||||
|
||||
foreach($supported_devices as $device)
|
||||
{
|
||||
self::print_sensor($sensor, $device);
|
||||
if($sensor[0] === 'cgroup')
|
||||
{
|
||||
// echo '- ' . phodevi::sensor_name($sensor) . PHP_EOL;
|
||||
}
|
||||
else
|
||||
{
|
||||
$sensor_object = new $sensor[2](0, $device);
|
||||
$tabled[] = array(pts_client::cli_just_bold(phodevi::sensor_object_name($sensor_object) . ': '), phodevi::read_sensor($sensor_object), pts_client::cli_colored_text(phodevi::read_sensor_object_unit($sensor_object), 'gray'));
|
||||
}
|
||||
}
|
||||
}
|
||||
echo pts_user_io::display_text_table($tabled) . PHP_EOL;
|
||||
|
||||
pts_client::$display->generic_heading('Unsupported Sensors');
|
||||
pts_client::$display->generic_heading('Unsupported Sensors For This System');
|
||||
foreach(phodevi::unsupported_sensors() as $sensor)
|
||||
{
|
||||
echo '- ' . phodevi::sensor_name($sensor) . PHP_EOL;
|
||||
}
|
||||
echo PHP_EOL;
|
||||
}
|
||||
|
||||
private static function print_sensor($sensor, $device)
|
||||
{
|
||||
if($sensor[0] === 'cgroup')
|
||||
{
|
||||
echo '- ' . phodevi::sensor_name($sensor) . PHP_EOL;
|
||||
}
|
||||
else
|
||||
{
|
||||
$sensor_object = new $sensor[2](0, $device);
|
||||
echo '- ' . phodevi::sensor_object_name($sensor_object) . ': ' . phodevi::read_sensor($sensor_object) . ' ' . phodevi::read_sensor_object_unit($sensor_object) . PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
106
pts-core/commands/winners_and_losers.php
Normal file
106
pts-core/commands/winners_and_losers.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2017, Phoronix Media
|
||||
Copyright (C) 2017, 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
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class winners_and_losers implements pts_option_interface
|
||||
{
|
||||
const doc_section = 'Result Management';
|
||||
const doc_description = 'This option is used if you wish to analyze a result file to see which runs produced the most wins/losses of those result identifiers in the saved file.';
|
||||
|
||||
public static function argument_checks()
|
||||
{
|
||||
return array(
|
||||
new pts_argument_check(0, array('pts_types', 'is_result_file'), null)
|
||||
);
|
||||
}
|
||||
public static function run($args)
|
||||
{
|
||||
$result_file = new pts_result_file($args[0]);
|
||||
$result_file_identifiers = $result_file->get_system_identifiers();
|
||||
|
||||
if(count($result_file_identifiers) < 2)
|
||||
{
|
||||
echo PHP_EOL . 'There are not multiple test runs in this result file.' . PHP_EOL;
|
||||
return false;
|
||||
}
|
||||
|
||||
echo pts_client::cli_colored_text($result_file->get_title(), 'gray', true) . PHP_EOL;
|
||||
echo pts_client::cli_colored_text('RESULT COUNT: ', 'cyan', true) . $result_file->get_test_count() . PHP_EOL . PHP_EOL;
|
||||
$winners = array();
|
||||
$losers = array();
|
||||
$tests_counted = 0;
|
||||
|
||||
foreach($result_file->get_result_objects() as $result)
|
||||
{
|
||||
if($result->test_result_buffer->get_count() < 2)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$tests_counted++;
|
||||
$winner = $result->get_result_first();
|
||||
$loser = $result->get_result_last();
|
||||
|
||||
if(!isset($winners[$winner]))
|
||||
{
|
||||
$winners[$winner] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$winners[$winner]++;
|
||||
}
|
||||
|
||||
if(!isset($losers[$loser]))
|
||||
{
|
||||
$losers[$loser] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$losers[$loser]++;
|
||||
}
|
||||
}
|
||||
|
||||
arsort($winners);
|
||||
arsort($losers);
|
||||
|
||||
echo pts_client::cli_colored_text('WINS:', 'green', true) . PHP_EOL;
|
||||
$table = array();
|
||||
foreach($winners as $identifier => $count)
|
||||
{
|
||||
$table[] = array($identifier . ': ', $count, ' [' . pts_math::set_precision($count / $tests_counted * 100, 1) . '%]');
|
||||
}
|
||||
echo pts_user_io::display_text_table($table) . PHP_EOL;
|
||||
echo PHP_EOL . pts_client::cli_colored_text('LOSSES: ', 'red', true) . PHP_EOL;
|
||||
$table = array();
|
||||
foreach($losers as $identifier => $count)
|
||||
{
|
||||
$table[] = array($identifier . ': ', $count, ' [' . pts_math::set_precision($count / $tests_counted * 100, 1) . '%]');
|
||||
}
|
||||
echo pts_user_io::display_text_table($table) . PHP_EOL;
|
||||
echo PHP_EOL;
|
||||
}
|
||||
public static function invalid_command($passed_args = null)
|
||||
{
|
||||
pts_tests::recently_saved_results();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -5,7 +5,7 @@
|
||||
echo "Please enter your root password below:" 1>&2
|
||||
|
||||
if [ -x /usr/bin/zypper ]; then
|
||||
su root -c "zypper install -l -y --force-resolution $*"
|
||||
su root -c "zypper install -l -y -n --force-resolution $*"
|
||||
else
|
||||
su root -c "yast -i $*"
|
||||
fi
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
<Name>Arch Linux</Name>
|
||||
<PackageManager>pacman</PackageManager>
|
||||
</Information>
|
||||
<Package>
|
||||
<GenericName>common-dependencies</GenericName>
|
||||
<PackageName>mesa-demos</PackageName>
|
||||
<FileCheck>glxinfo</FileCheck>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>gtk-development</GenericName>
|
||||
<PackageName>gtk2</PackageName>
|
||||
@@ -73,7 +78,7 @@
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>fortran-compiler</GenericName>
|
||||
<PackageName>gcc-fortran-multilib</PackageName>
|
||||
<PackageName>gcc-fortran</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>glew</GenericName>
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>python</GenericName>
|
||||
<PackageName>python3</PackageName>
|
||||
<PackageName>python3 python</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>yasm</GenericName>
|
||||
@@ -147,5 +147,13 @@
|
||||
<GenericName>httpd</GenericName>
|
||||
<PackageName>apache</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>python-sklearn</GenericName>
|
||||
<PackageName>py27-scikit-learn</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>python-scipy</GenericName>
|
||||
<PackageName>py27-scipy</PackageName>
|
||||
</Package>
|
||||
</ExternalDependencies>
|
||||
</PhoronixTestSuite>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<GenericName>xorg-development</GenericName>
|
||||
<Title>X.Org Development Files and Libraries</Title>
|
||||
<PossibleNames>xserver-xorg-development, xorg-devel</PossibleNames>
|
||||
<FileCheck>xorg/xf86.h</FileCheck>
|
||||
<FileCheck>xorg/xf86.h OR X11/Xlib.h</FileCheck>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>cairo-development</GenericName>
|
||||
@@ -269,7 +269,7 @@
|
||||
<GenericName>blas-development</GenericName>
|
||||
<Title>Basic Linear Algebra Sub-Routine Library</Title>
|
||||
<PossibleNames>libblas-dev, libblas-devel, blas-devel, blas</PossibleNames>
|
||||
<FileCheck>libblas.so</FileCheck>
|
||||
<FileCheck>libblas.so OR openblas_config.h</FileCheck>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>lapack-development</GenericName>
|
||||
@@ -287,7 +287,7 @@
|
||||
<GenericName>openmpi-development</GenericName>
|
||||
<Title>OpenMPI</Title>
|
||||
<PossibleNames>libopenmpi-dev, openmpi-bin</PossibleNames>
|
||||
<FileCheck>openmpi/lib/libmpi.so, mpirun.openmpi</FileCheck>
|
||||
<FileCheck>openmpi/lib/libmpi.so OR mpirun OR mpirun.openmpi</FileCheck>
|
||||
</Package>
|
||||
|
||||
<Package>
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>lapack-development</GenericName>
|
||||
<PackageName>lapack-devel</PackageName>
|
||||
<PackageName>lapack-devel lapacke-devel</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>cmake</GenericName>
|
||||
@@ -204,7 +204,7 @@
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>atlas-development</GenericName>
|
||||
<PackageName>libatlas3-devel</PackageName>
|
||||
<PackageName>blas-devel</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>openmpi-development</GenericName>
|
||||
@@ -250,6 +250,10 @@
|
||||
<GenericName>tinyxml</GenericName>
|
||||
<PackageName>tinyxml-devel</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>opencl</GenericName>
|
||||
<PackageName>opencl-headers</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>attr</GenericName>
|
||||
<PackageName>attr</PackageName>
|
||||
@@ -280,7 +284,7 @@
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>python-sklearn</GenericName>
|
||||
<PackageName>scikit-learn</PackageName>
|
||||
<PackageName>python-scikit-learn</PackageName>
|
||||
</Package>
|
||||
</ExternalDependencies>
|
||||
</PhoronixTestSuite>
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
</Information>
|
||||
<Package>
|
||||
<GenericName>common-dependencies</GenericName>
|
||||
<PackageName>mesa-utils unzip</PackageName>
|
||||
<FileCheck>glxinfo, unzip</FileCheck>
|
||||
<PackageName>mesa-utils unzip apt-file</PackageName>
|
||||
<FileCheck>glxinfo, unzip, apt-file</FileCheck>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>32bit-compatibility</GenericName>
|
||||
@@ -209,7 +209,7 @@
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>lapack-development</GenericName>
|
||||
<PackageName>liblapack-dev</PackageName>
|
||||
<PackageName>liblapack-dev liblapacke-dev</PackageName>
|
||||
</Package>
|
||||
<Package>
|
||||
<GenericName>atlas-development</GenericName>
|
||||
|
||||
@@ -242,6 +242,7 @@ class phoromatic extends pts_module_interface
|
||||
}
|
||||
}
|
||||
|
||||
// Randomize the thread work a little bit to ensure not hitting the systems at the same time
|
||||
sleep(rand(60, 90));
|
||||
}
|
||||
}
|
||||
@@ -304,7 +305,7 @@ class phoromatic extends pts_module_interface
|
||||
if(self::$limit_network_communication)
|
||||
{
|
||||
static $last_comm_time = 0;
|
||||
if(time() > ($last_comm_time + 1740 + rand(0, 360)))
|
||||
if(time() > ($last_comm_time + 800 + rand(0, 180)))
|
||||
{
|
||||
// It's been at least half hour since last update, so report in state...
|
||||
$last_comm_time = time();
|
||||
|
||||
84
pts-core/modules/report_test_run_times.php
Normal file
84
pts-core/modules/report_test_run_times.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2017, Phoronix Media
|
||||
Copyright (C) 2017, 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
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class report_test_run_times extends pts_module_interface
|
||||
{
|
||||
const module_name = 'Report Test Run Time Graphs';
|
||||
const module_version = '1.0.0';
|
||||
const module_description = 'Setting the RUN_TIMES_ARE_A_BENCHMARK=1 environment variable will automatically create additional graphs for each test run plotting the run-time needed for each test being executed.';
|
||||
const module_author = 'Michael Larabel';
|
||||
|
||||
private static $successful_test_run_request = null;
|
||||
private static $result_identifier;
|
||||
|
||||
public static function module_environmental_variables()
|
||||
{
|
||||
return array('RUN_TIMES_ARE_A_BENCHMARK');
|
||||
}
|
||||
public static function module_info()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
public static function __run_manager_setup(&$test_run_manager)
|
||||
{
|
||||
if(getenv('RUN_TIMES_ARE_A_BENCHMARK') != false)
|
||||
{
|
||||
echo PHP_EOL . 'The Phoronix Test Suite will generate graphs of test run-times.' . PHP_EOL;
|
||||
}
|
||||
else
|
||||
{
|
||||
return pts_module::MODULE_UNLOAD; // This module doesn't have anything else to do
|
||||
}
|
||||
|
||||
$test_run_manager->force_results_save();
|
||||
}
|
||||
public static function __pre_run_process(&$test_run_manager)
|
||||
{
|
||||
self::$result_identifier = $test_run_manager->get_results_identifier();
|
||||
}
|
||||
public static function __post_test_run($test_run_request)
|
||||
{
|
||||
self::$successful_test_run_request = clone $test_run_request;
|
||||
}
|
||||
public static function __post_test_run_process(&$result_file)
|
||||
{
|
||||
if(self::$successful_test_run_request && !empty(self::$successful_test_run_request->test_run_times))
|
||||
{
|
||||
$result = round(array_sum(self::$successful_test_run_request->test_run_times) / count(self::$successful_test_run_request->test_run_times), 2);
|
||||
if($result > 0)
|
||||
{
|
||||
// This copy isn't needed but it's shorter and from port from system_monitor where there can be multiple items tracked
|
||||
$test_result = clone self::$successful_test_run_request;
|
||||
$test_result->test_profile->set_identifier(null);
|
||||
$test_result->set_used_arguments_description('Test Run Time' . ($test_result->get_arguments_description() != null ? ' - ' . $test_result->get_arguments_description() : null ));
|
||||
$test_result->set_used_arguments('test run time ' . $test_result->get_arguments());
|
||||
$test_result->test_profile->set_result_scale('Seconds');
|
||||
$test_result->test_profile->set_result_proportion('LIB');
|
||||
$test_result->test_result_buffer = new pts_test_result_buffer();
|
||||
$test_result->test_result_buffer->add_test_result(self::$result_identifier, $result, implode(':', self::$successful_test_run_request->test_run_times));
|
||||
$result_file->add_result($test_result);
|
||||
}
|
||||
}
|
||||
self::$successful_test_run_request = null;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2016, Phoronix Media
|
||||
Copyright (C) 2009 - 2016, Michael Larabel
|
||||
Copyright (C) 2009 - 2017, Phoronix Media
|
||||
Copyright (C) 2009 - 2017, Michael Larabel
|
||||
pts_concise_display_mode.php: The batch / concise display mode
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -128,7 +128,7 @@ class pts_concise_display_mode implements pts_display_mode_interface
|
||||
public function test_install_start($identifier)
|
||||
{
|
||||
$this->test_install_pos++;
|
||||
echo $this->tab . pts_client::cli_colored_text($identifier, 'cyan') . ':' . PHP_EOL;
|
||||
echo $this->tab . pts_client::cli_colored_text($identifier, 'cyan', true) . ':' . PHP_EOL;
|
||||
echo $this->tab . $this->tab . 'Test Installation ' . $this->test_install_pos . ' of ' . $this->test_install_count . PHP_EOL;
|
||||
}
|
||||
public function test_install_downloads($test_install_request)
|
||||
@@ -220,7 +220,7 @@ class pts_concise_display_mode implements pts_display_mode_interface
|
||||
|
||||
$terminal_width = pts_client::terminal_width() > 1 ? pts_client::terminal_width() : $terminal_width;
|
||||
$text_width = $terminal_width - (strlen($this->tab) * 3);
|
||||
echo PHP_EOL . $this->tab . $this->tab . pts_client::cli_colored_text(wordwrap('[NOTICE] ' . $message, $text_width, PHP_EOL . $this->tab . $this->tab), 'gray') . PHP_EOL;
|
||||
echo PHP_EOL . $this->tab . $this->tab . pts_client::cli_colored_text(wordwrap('[NOTICE] ' . $message, $text_width, PHP_EOL . $this->tab . $this->tab), 'gray', true) . PHP_EOL;
|
||||
}
|
||||
public function test_install_progress_start($process)
|
||||
{
|
||||
@@ -275,7 +275,7 @@ class pts_concise_display_mode implements pts_display_mode_interface
|
||||
}
|
||||
public function test_install_error($error_string)
|
||||
{
|
||||
echo $this->tab . $this->tab . $this->tab . pts_client::cli_colored_text($error_string, 'red') . PHP_EOL;
|
||||
echo $this->tab . $this->tab . $this->tab . pts_client::cli_colored_text($error_string, 'red', true) . PHP_EOL;
|
||||
}
|
||||
public function test_install_prompt($prompt_string)
|
||||
{
|
||||
@@ -301,7 +301,7 @@ class pts_concise_display_mode implements pts_display_mode_interface
|
||||
$test_title_string .= ' [' . pts_client::swap_variables($test_description, array('pts_client', 'environmental_variables')) . ']';
|
||||
}
|
||||
|
||||
echo PHP_EOL . PHP_EOL . pts_client::cli_colored_text($test_title_string, 'cyan') . PHP_EOL;
|
||||
echo PHP_EOL . PHP_EOL . pts_client::cli_colored_text($test_title_string, 'cyan', true) . PHP_EOL;
|
||||
echo $this->tab . 'Test ' . $test_run_manager->get_test_run_position() . ' of ' . $test_run_manager->get_test_run_count_reported() . PHP_EOL;
|
||||
|
||||
$this->trial_run_count_current = 0;
|
||||
@@ -324,11 +324,11 @@ class pts_concise_display_mode implements pts_display_mode_interface
|
||||
if((time() % 86400) + $remaining_length > 86400)
|
||||
{
|
||||
// If test run is past current calendar date
|
||||
$est_end_time = date(' (H:i T M j)', time() + $remaining_length);
|
||||
$est_end_time = date(' [H:i T M j]', time() + $remaining_length);
|
||||
}
|
||||
else
|
||||
{
|
||||
$est_end_time = date(' (H:i T)', time() + $remaining_length);
|
||||
$est_end_time = date(' [H:i T]', time() + $remaining_length);
|
||||
}
|
||||
|
||||
array_push($display_table, array($this->tab . 'Estimated Time To Completion:', pts_strings::format_time($remaining_length, 'SECONDS', true, 60) . $est_end_time));
|
||||
@@ -344,10 +344,16 @@ class pts_concise_display_mode implements pts_display_mode_interface
|
||||
{
|
||||
$this->trial_run_count_current++;
|
||||
echo PHP_EOL . $this->tab . $this->tab . 'Started Run ' . $this->trial_run_count_current . ' @ ' . date('H:i:s');
|
||||
|
||||
if($this->expected_trial_run_count > 1 && $this->trial_run_count_current > $this->expected_trial_run_count)
|
||||
{
|
||||
// add a mark since the results are in overtime, deviation likely too high and run count increased
|
||||
echo ' *';
|
||||
}
|
||||
}
|
||||
public function test_run_instance_error($error_string)
|
||||
{
|
||||
echo PHP_EOL . $this->tab . $this->tab . pts_client::cli_colored_text($error_string, 'red');
|
||||
echo PHP_EOL . $this->tab . $this->tab . pts_client::cli_colored_text($error_string, 'red', true);
|
||||
}
|
||||
public function test_run_instance_output(&$to_output)
|
||||
{
|
||||
@@ -360,15 +366,7 @@ class pts_concise_display_mode implements pts_display_mode_interface
|
||||
}
|
||||
public function test_run_instance_complete(&$result)
|
||||
{
|
||||
if($this->expected_trial_run_count > 1 && $this->trial_run_count_current >= $this->expected_trial_run_count)
|
||||
{
|
||||
$values = $result->active->results;
|
||||
|
||||
if(count($values) > 1)
|
||||
{
|
||||
echo ($this->trial_run_count_current < 10 ? ' ' : null) . ' [Std. Dev: ' . pts_math::set_precision(pts_math::percent_standard_deviation($values), 2) . '%]';
|
||||
}
|
||||
}
|
||||
return; // if anything to append to string of "Started Run"
|
||||
}
|
||||
public function test_run_end(&$test_result)
|
||||
{
|
||||
@@ -394,28 +392,64 @@ class pts_concise_display_mode implements pts_display_mode_interface
|
||||
else if(in_array($test_result->test_profile->get_display_format(), array('FILLED_LINE_GRAPH', 'LINE_GRAPH')))
|
||||
{
|
||||
$values = explode(',', $test_result->active->get_result());
|
||||
$end_print = null;
|
||||
$end_print = PHP_EOL . $this->tab . ($test_result->get_arguments_description() ? $test_result->get_arguments_description() : 'Test Results') . ':' . PHP_EOL;
|
||||
|
||||
if($test_result->test_profile->get_result_proportion() == 'LIB')
|
||||
{
|
||||
$minimum_color = 'green';
|
||||
$maximum_color = 'red';
|
||||
}
|
||||
else if($test_result->test_profile->get_result_proportion() == 'HIB')
|
||||
{
|
||||
$minimum_color = 'red';
|
||||
$maximum_color = 'green';
|
||||
}
|
||||
|
||||
if(count($values) > 1)
|
||||
{
|
||||
$avg = pts_math::set_precision(array_sum($values) / count($values), 2);
|
||||
$min = pts_math::set_precision(min($values), 2);
|
||||
$max = pts_math::set_precision(max($values), 2);
|
||||
$end_print .= $this->tab . $this->tab . 'Average: ' . $avg . ' (' . $test_result->test_profile->get_result_scale() . ')' . PHP_EOL;
|
||||
$end_print .= $this->tab . $this->tab . 'Minimum: ' . $min . ' (' . $test_result->test_profile->get_result_scale() . ')' . PHP_EOL;
|
||||
$end_print .= $this->tab . $this->tab . 'Maximum: ' . $max . ' (' . $test_result->test_profile->get_result_scale() . ')' . PHP_EOL;
|
||||
$end_print .= $this->tab . 'Average: ' . pts_client::cli_colored_text($avg, 'blue', true) . ' ' . $test_result->test_profile->get_result_scale() . PHP_EOL;
|
||||
$end_print .= $this->tab . 'Minimum: ' . pts_client::cli_colored_text($min, $minimum_color, true) . ' ' . $test_result->test_profile->get_result_scale() . PHP_EOL;
|
||||
$end_print .= $this->tab . 'Maximum: ' . pts_client::cli_colored_text($max, $maximum_color, true) . ' ' . $test_result->test_profile->get_result_scale() . PHP_EOL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$end_print = PHP_EOL . $this->tab . 'Test Results:' . PHP_EOL;
|
||||
|
||||
$end_print = PHP_EOL . $this->tab . ($test_result->get_arguments_description() ? $test_result->get_arguments_description() : 'Test Results') . ':' . PHP_EOL;
|
||||
$result_count = 0;
|
||||
if($test_result->test_profile->get_result_proportion() == 'LIB')
|
||||
{
|
||||
$best_result = $test_result->active->get_min_value();
|
||||
$worst_result = $test_result->active->get_max_value();
|
||||
}
|
||||
else if($test_result->test_profile->get_result_proportion() == 'HIB')
|
||||
{
|
||||
$best_result = $test_result->active->get_max_value();
|
||||
$worst_result = $test_result->active->get_min_value();
|
||||
}
|
||||
foreach($test_result->active->results as $result)
|
||||
{
|
||||
$end_print .= $this->tab . $this->tab . $result . PHP_EOL;
|
||||
$text_color = null;
|
||||
|
||||
if(count($test_result->active->results) > 1)
|
||||
{
|
||||
if($result == $best_result)
|
||||
{
|
||||
$text_color = 'green';
|
||||
}
|
||||
else if($result == $worst_result)
|
||||
{
|
||||
$text_color = 'red';
|
||||
}
|
||||
}
|
||||
|
||||
$end_print .= $this->tab . $this->tab . pts_client::cli_colored_text($result, $text_color, true) . PHP_EOL;
|
||||
$result_count++;
|
||||
}
|
||||
|
||||
$end_print .= PHP_EOL . $this->tab . pts_strings::result_quantifier_to_string($test_result->test_profile->get_result_quantifier()) . ': ' . pts_client::cli_colored_text($test_result->active->get_result() . ' ' . $test_result->test_profile->get_result_scale(), 'green');
|
||||
$end_print .= PHP_EOL . $this->tab . pts_strings::result_quantifier_to_string($test_result->test_profile->get_result_quantifier()) . ': ' . pts_client::cli_colored_text($test_result->active->get_result() . ' ' . $test_result->test_profile->get_result_scale(), 'blue', true);
|
||||
|
||||
if($test_result->active->get_min_result())
|
||||
{
|
||||
@@ -425,6 +459,10 @@ class pts_concise_display_mode implements pts_display_mode_interface
|
||||
{
|
||||
$end_print .= PHP_EOL . $this->tab . 'Maximum: ' . $test_result->active->get_max_result();
|
||||
}
|
||||
if($result_count > 2)
|
||||
{
|
||||
$end_print .= PHP_EOL . $this->tab . 'Deviation: ' . pts_math::set_precision(pts_math::percent_standard_deviation($test_result->active->results), 2) . '%';
|
||||
}
|
||||
|
||||
if($test_result->active->get_result() == 0)
|
||||
{
|
||||
@@ -438,7 +476,7 @@ class pts_concise_display_mode implements pts_display_mode_interface
|
||||
}
|
||||
public function test_run_error($error_string)
|
||||
{
|
||||
echo $this->tab . $this->tab . pts_client::cli_colored_text($error_string, 'red') . PHP_EOL;
|
||||
echo $this->tab . $this->tab . pts_client::cli_colored_text($error_string, 'red', true) . PHP_EOL;
|
||||
}
|
||||
public function generic_prompt($prompt_string)
|
||||
{
|
||||
@@ -460,7 +498,7 @@ class pts_concise_display_mode implements pts_display_mode_interface
|
||||
foreach(pts_strings::trim_explode(PHP_EOL, $string) as $line_count => $line_string)
|
||||
{
|
||||
// ($line_count > 0 ? $this->tab : null) .
|
||||
echo pts_client::cli_colored_text($line_string, 'green') . PHP_EOL;
|
||||
echo pts_client::cli_colored_text($line_string, 'green', true) . PHP_EOL;
|
||||
}
|
||||
|
||||
if($ending_line_break)
|
||||
@@ -507,7 +545,7 @@ class pts_concise_display_mode implements pts_display_mode_interface
|
||||
$error_msg .= ':' . $line;
|
||||
}
|
||||
|
||||
echo pts_client::cli_colored_text($error_msg, 'red') . PHP_EOL;
|
||||
echo pts_client::cli_colored_text($error_msg, 'red', true) . PHP_EOL;
|
||||
}
|
||||
public function get_tab()
|
||||
{
|
||||
|
||||
@@ -41,22 +41,18 @@ class pts_short_display_mode extends pts_concise_display_mode
|
||||
protected function print_test_identifier_prefix($test)
|
||||
{
|
||||
$ti = $test->test_profile->get_identifier();
|
||||
return $ti . str_repeat(' ', ($this->longest_test_identifier_length - strlen($ti))) . ': ';
|
||||
return pts_client::cli_just_bold($ti) . str_repeat(' ', ($this->longest_test_identifier_length - strlen($ti))) . ': ';
|
||||
}
|
||||
public function test_run_start(&$test_run_manager, &$test_result)
|
||||
{
|
||||
echo $this->print_test_identifier_prefix($test_result);
|
||||
|
||||
$after_print = pts_client::cli_colored_text('Test Started', 'green', true);
|
||||
if(($test_description = $test_result->get_arguments_description()) != false)
|
||||
{
|
||||
echo pts_client::swap_variables($test_description, array('pts_client', 'environmental_variables'));
|
||||
$after_print .= ' - ' . pts_client::swap_variables($test_description, array('pts_client', 'environmental_variables'));
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Test Starting';
|
||||
}
|
||||
|
||||
echo PHP_EOL;
|
||||
echo $after_print .= PHP_EOL;
|
||||
|
||||
$this->trial_run_count_current = 0;
|
||||
$this->expected_trial_run_count = $test_result->test_profile->get_times_to_run();
|
||||
@@ -113,10 +109,11 @@ class pts_short_display_mode extends pts_concise_display_mode
|
||||
}
|
||||
else
|
||||
{
|
||||
$end_print = pts_strings::result_quantifier_to_string($test_result->test_profile->get_result_quantifier()) . ': ' . $test_result->active->get_result() . ' ' . $test_result->test_profile->get_result_scale();
|
||||
$end_print = pts_client::cli_just_bold(pts_strings::result_quantifier_to_string($test_result->test_profile->get_result_quantifier()) . ': ') . $test_result->active->get_result() . ' ' . $test_result->test_profile->get_result_scale();
|
||||
}
|
||||
|
||||
echo $this->print_test_identifier_prefix($test_result) . $end_print;
|
||||
echo $this->print_test_identifier_prefix($test_result) . $end_print . PHP_EOL;
|
||||
echo $this->print_test_identifier_prefix($test_result) . pts_client::cli_colored_text('Test Ended', 'red', true) . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2012, Phoronix Media
|
||||
Copyright (C) 2009 - 2012, Michael Larabel
|
||||
Copyright (C) 2009 - 2017, Phoronix Media
|
||||
Copyright (C) 2009 - 2017, 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
|
||||
@@ -52,7 +52,7 @@ class pts_argument_check
|
||||
}
|
||||
else if($this->get_function_check() == array('pts_types', 'identifier_to_object'))
|
||||
{
|
||||
$type = 'Test | Suite | OpenBenchmarking.org ID | Test Result';
|
||||
$type = 'Test | Suite | OpenBenchmarking ID | Test Result';
|
||||
}
|
||||
else if($this->get_function_check() == array('pts_types', 'is_test_or_suite'))
|
||||
{
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, 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
|
||||
@@ -42,6 +42,31 @@ class pts_client
|
||||
chmod($lock_file, 0644);
|
||||
return self::$lock_pointers[$lock_file] != false && flock(self::$lock_pointers[$lock_file], LOCK_EX | LOCK_NB);
|
||||
}
|
||||
public static function is_locked($lock_file)
|
||||
{
|
||||
$fp = fopen($lock_file, 'w');
|
||||
$is_locked = $fp && !flock($fp, LOCK_EX | LOCK_NB);
|
||||
$fp && fclose($fp);
|
||||
|
||||
return $is_locked;
|
||||
}
|
||||
public static function release_lock($lock_file)
|
||||
{
|
||||
// Remove lock
|
||||
if(isset(self::$lock_pointers[$lock_file]) == false)
|
||||
{
|
||||
pts_file_io::unlink($lock_file);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(is_resource(self::$lock_pointers[$lock_file]))
|
||||
{
|
||||
fclose(self::$lock_pointers[$lock_file]);
|
||||
}
|
||||
|
||||
pts_file_io::unlink($lock_file);
|
||||
unset(self::$lock_pointers[$lock_file]);
|
||||
}
|
||||
public static function init()
|
||||
{
|
||||
pts_core::init();
|
||||
@@ -282,20 +307,21 @@ class pts_client
|
||||
{
|
||||
return (function_exists('posix_isatty') && posix_isatty(STDOUT)) || (PTS_IS_CLIENT && getenv('LS_COLORS'));
|
||||
}
|
||||
public static function cli_colored_text($str, $color)
|
||||
public static function cli_colored_text($str, $color, $bold = false)
|
||||
{
|
||||
if(!self::supports_colored_text_output())
|
||||
if(!self::supports_colored_text_output() || empty($color))
|
||||
{
|
||||
return $str;
|
||||
}
|
||||
|
||||
$attribute = ($bold ? '1' : '0');
|
||||
$colors = array(
|
||||
'black' => '0;30',
|
||||
'gray' => '1;30',
|
||||
'blue' => '0;34',
|
||||
'green' => '0;32',
|
||||
'red' => '0;31',
|
||||
'cyan' => '0;36',
|
||||
'black' => $attribute . ';30',
|
||||
'gray' => '1;30', // gray not bold doesn't look good in all consoles
|
||||
'blue' => $attribute . ';34',
|
||||
'green' => $attribute . ';32',
|
||||
'red' => $attribute . ';31',
|
||||
'cyan' => $attribute . ';36',
|
||||
);
|
||||
|
||||
if(!isset($colors[$color]))
|
||||
@@ -305,6 +331,15 @@ class pts_client
|
||||
|
||||
return "\033[" . $colors[$color] . 'm' . $str . "\033[0m";
|
||||
}
|
||||
public static function cli_just_bold($str)
|
||||
{
|
||||
if(!self::supports_colored_text_output())
|
||||
{
|
||||
return $str;
|
||||
}
|
||||
|
||||
return "\033[1m$str\033[0m";
|
||||
}
|
||||
public static function save_test_result($save_to = null, $save_results = null, $render_graphs = true, $result_identifier = null)
|
||||
{
|
||||
// Saves PTS result file
|
||||
@@ -1109,22 +1144,6 @@ class pts_client
|
||||
{
|
||||
return pts_config::read_bool_config('PhoronixTestSuite/Options/OpenBenchmarking/AnonymousUsageReporting', 0);
|
||||
}
|
||||
public static function release_lock($lock_file)
|
||||
{
|
||||
// Remove lock
|
||||
if(isset(self::$lock_pointers[$lock_file]) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(is_resource(self::$lock_pointers[$lock_file]))
|
||||
{
|
||||
fclose(self::$lock_pointers[$lock_file]);
|
||||
}
|
||||
|
||||
pts_file_io::unlink($lock_file);
|
||||
unset(self::$lock_pointers[$lock_file]);
|
||||
}
|
||||
public static function check_command_for_function($option, $check_function)
|
||||
{
|
||||
$in_option = false;
|
||||
@@ -1239,7 +1258,7 @@ class pts_client
|
||||
trigger_error('Phoronix Test Suite Argument Missing.', E_USER_ERROR);
|
||||
}
|
||||
|
||||
echo PHP_EOL . 'CORRECT SYNTAX:' . PHP_EOL . 'phoronix-test-suite ' . str_replace('_', '-', $command_alias) . ' ' . implode(' ', $argument_checks) . PHP_EOL . PHP_EOL;
|
||||
echo PHP_EOL . pts_client::cli_just_bold('CORRECT SYNTAX:') . PHP_EOL . 'phoronix-test-suite ' . str_replace('_', '-', $command_alias) . ' ' . implode(' ', $argument_checks) . PHP_EOL . PHP_EOL;
|
||||
|
||||
if(method_exists($command, 'invalid_command'))
|
||||
{
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2010 - 2016, Phoronix Media
|
||||
Copyright (C) 2010 - 2016, Michael Larabel
|
||||
Copyright (C) 2010 - 2017, Phoronix Media
|
||||
Copyright (C) 2010 - 2017, 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
|
||||
@@ -423,7 +423,7 @@ class pts_external_dependencies
|
||||
if(substr($file[$i], -2) == '.h' || substr($file[$i], -4) == '.hpp')
|
||||
{
|
||||
// May just be a relative header file to look for...
|
||||
$possible_paths = array('/usr/local/include/', '/usr/target/include/', '/usr/include/');
|
||||
$possible_paths = array('/usr/local/include/', '/usr/target/include/', '/usr/include/', '/usr/include/x86_64-linux-gnu/');
|
||||
foreach($possible_paths as $path)
|
||||
{
|
||||
if(is_file($path . $file[$i]) || is_link($path . $file[$i]))
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, 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
|
||||
@@ -22,18 +22,19 @@
|
||||
|
||||
class pts_installed_test
|
||||
{
|
||||
private $xml_parser;
|
||||
private $xml;
|
||||
private $footnote_override = null;
|
||||
|
||||
public function __construct(&$test_profile)
|
||||
{
|
||||
$install_path = $test_profile->get_install_dir();
|
||||
$read_xml = is_file($install_path . 'pts-install.xml') ? $install_path . 'pts-install.xml' : null;
|
||||
$this->xml_parser = new nye_XmlReader($read_xml);
|
||||
$xml_options = LIBXML_COMPACT | LIBXML_PARSEHUGE;
|
||||
$this->xml = simplexml_load_file($read_xml, 'SimpleXMLElement', $xml_options);
|
||||
}
|
||||
public function get_install_date_time()
|
||||
{
|
||||
return $this->xml_parser->getXMLValue('PhoronixTestSuite/TestInstallation/History/InstallTime');
|
||||
return isset($this->xml->TestInstallation->History->InstallTime) ? $this->xml->TestInstallation->History->InstallTime->__toString() : null;
|
||||
}
|
||||
public function get_install_date()
|
||||
{
|
||||
@@ -41,7 +42,7 @@ class pts_installed_test
|
||||
}
|
||||
public function get_last_run_date_time()
|
||||
{
|
||||
return $this->xml_parser->getXMLValue('PhoronixTestSuite/TestInstallation/History/LastRunTime');
|
||||
return isset($this->xml->TestInstallation->History->LastRunTime) ? $this->xml->TestInstallation->History->LastRunTime->__toString() : null;
|
||||
}
|
||||
public function get_last_run_date()
|
||||
{
|
||||
@@ -49,31 +50,31 @@ class pts_installed_test
|
||||
}
|
||||
public function get_installed_version()
|
||||
{
|
||||
return $this->xml_parser->getXMLValue('PhoronixTestSuite/TestInstallation/Environment/Version');
|
||||
return isset($this->xml->TestInstallation->Environment->Version) ? $this->xml->TestInstallation->Environment->Version->__toString() : null;
|
||||
}
|
||||
public function get_average_run_time()
|
||||
{
|
||||
return $this->xml_parser->getXMLValue('PhoronixTestSuite/TestInstallation/History/AverageRunTime');
|
||||
return isset($this->xml->TestInstallation->History->AverageRunTime) ? $this->xml->TestInstallation->History->AverageRunTime->__toString() : null;
|
||||
}
|
||||
public function get_latest_run_time()
|
||||
{
|
||||
return $this->xml_parser->getXMLValue('PhoronixTestSuite/TestInstallation/History/LatestRunTime');
|
||||
return isset($this->xml->TestInstallation->History->LatestRunTime) ? $this->xml->TestInstallation->History->LatestRunTime->__toString() : null;
|
||||
}
|
||||
public function get_latest_install_time()
|
||||
{
|
||||
return $this->xml_parser->getXMLValue('PhoronixTestSuite/TestInstallation/History/InstallTimeLength');
|
||||
return isset($this->xml->TestInstallation->History->InstallTimeLength) ? $this->xml->TestInstallation->History->InstallTimeLength->__toString() : null;
|
||||
}
|
||||
public function get_run_count()
|
||||
{
|
||||
return ($times_run = $this->xml_parser->getXMLValue('PhoronixTestSuite/TestInstallation/History/TimesRun')) != false ? $times_run : 0;
|
||||
return isset($this->xml->TestInstallation->History->TimesRun) ? $this->xml->TestInstallation->History->TimesRun->__toString() : 0;
|
||||
}
|
||||
public function get_compiler_data()
|
||||
{
|
||||
return json_decode($this->xml_parser->getXMLValue('PhoronixTestSuite/TestInstallation/Environment/CompilerData'), true);
|
||||
return isset($this->xml->TestInstallation->Environment->CompilerData) ? json_decode($this->xml->TestInstallation->Environment->CompilerData->__toString(), true) : null;
|
||||
}
|
||||
public function get_install_footnote()
|
||||
{
|
||||
return !empty($this->footnote_override) ? $this->footnote_override : $this->xml_parser->getXMLValue('PhoronixTestSuite/TestInstallation/Environment/InstallFootnote');
|
||||
return !empty($this->footnote_override) ? $this->footnote_override : (isset($this->xml->TestInstallation->Environment->InstallFootnote) ? $this->xml->TestInstallation->Environment->InstallFootnote->__toString() : null);
|
||||
}
|
||||
public function set_install_footnote($f = null)
|
||||
{
|
||||
@@ -81,11 +82,11 @@ class pts_installed_test
|
||||
}
|
||||
public function get_installed_checksum()
|
||||
{
|
||||
return $this->xml_parser->getXMLValue('PhoronixTestSuite/TestInstallation/Environment/CheckSum');
|
||||
return isset($this->xml->TestInstallation->Environment->CheckSum) ? $this->xml->TestInstallation->Environment->CheckSum->__toString() : null;
|
||||
}
|
||||
public function get_installed_system_identifier()
|
||||
{
|
||||
return $this->xml_parser->getXMLValue('PhoronixTestSuite/TestInstallation/Environment/SystemIdentifier');
|
||||
return isset($this->xml->TestInstallation->Environment->SystemIdentifier) ? $this->xml->TestInstallation->Environment->SystemIdentifier->__toString() : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2014 - 2016, Phoronix Media
|
||||
Copyright (C) 2014 - 2016, Michael Larabel
|
||||
Copyright (C) 2014 - 2017, Phoronix Media
|
||||
Copyright (C) 2014 - 2017, Michael Larabel
|
||||
pts_logger.php: A simple log file generator
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -79,6 +79,13 @@ class pts_logger
|
||||
{
|
||||
return $this->log_file;
|
||||
}
|
||||
public function get_clean_log()
|
||||
{
|
||||
$log = $this->get_log();
|
||||
$log = pts_user_io::strip_ansi_escape_sequences($log);
|
||||
|
||||
return $log;
|
||||
}
|
||||
public function get_log()
|
||||
{
|
||||
return file_get_contents($this->get_log_file_location());
|
||||
|
||||
@@ -134,7 +134,17 @@ class pts_openbenchmarking_client
|
||||
$composite_xml_type = 'composite_xml';
|
||||
|
||||
// Compress the result file XML if it's big
|
||||
if(isset($composite_xml[50000]) && function_exists('gzdeflate'))
|
||||
if(isset($composite_xml[40000]) && function_exists('bzcompress'))
|
||||
{
|
||||
$composite_xml_bz = bzcompress($composite_xml);
|
||||
|
||||
if($composite_xml_bz != false)
|
||||
{
|
||||
$composite_xml = $composite_xml_bz;
|
||||
$composite_xml_type = 'composite_xml_bz';
|
||||
}
|
||||
}
|
||||
else if(isset($composite_xml[40000]) && function_exists('gzdeflate'))
|
||||
{
|
||||
$composite_xml_gz = gzdeflate($composite_xml);
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2015 - 2016, Phoronix Media
|
||||
Copyright (C) 2015 - 2016, Michael Larabel
|
||||
Copyright (C) 2015 - 2017, Phoronix Media
|
||||
Copyright (C) 2015 - 2017, 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
|
||||
@@ -132,7 +132,7 @@ class pts_stress_run_manager extends pts_test_run_manager
|
||||
{
|
||||
$table[] = array($component . ': ', $value);
|
||||
}
|
||||
$this->stress_print_and_log('SYSTEM INFORMATION: ' . PHP_EOL . pts_user_io::display_text_table($table, ' ', 1) . PHP_EOL . PHP_EOL);
|
||||
$this->stress_print_and_log('SYSTEM INFORMATION: ' . PHP_EOL . phodevi::system_centralized_view() . PHP_EOL . PHP_EOL);
|
||||
|
||||
// BEGIN THE LOOP
|
||||
while(!empty($possible_tests_to_run))
|
||||
@@ -258,11 +258,11 @@ class pts_stress_run_manager extends pts_test_run_manager
|
||||
{
|
||||
// child
|
||||
$this->stress_child_thread = true;
|
||||
echo 'Starting: ' . $test_to_run->test_profile->get_identifier() . ($test_to_run->get_arguments_description() != null ? ' [' . $test_to_run->get_arguments_description() . ']' : null) . PHP_EOL;
|
||||
//echo PHP_EOL . pts_client::cli_colored_text('Starting: ', 'green', true) . $test_to_run->test_profile->get_identifier() . ($test_to_run->get_arguments_description() != null ? ' [' . $test_to_run->get_arguments_description() . ']' : null) . PHP_EOL;
|
||||
$continue_test_flag = $this->process_test_run_request($test_to_run);
|
||||
echo PHP_EOL . 'Ended: ' . $test_to_run->test_profile->get_identifier() . ($test_to_run->get_arguments_description() != null ? ' [' . $test_to_run->get_arguments_description() . ']' : null) . PHP_EOL;
|
||||
//echo PHP_EOL . pts_client::cli_colored_text('Ended: ', 'red', true) . $test_to_run->test_profile->get_identifier() . ($test_to_run->get_arguments_description() != null ? ' [' . $test_to_run->get_arguments_description() . ']' : null) . PHP_EOL;
|
||||
pts_file_io::unlink($this->thread_collection_dir . getmypid());
|
||||
echo PHP_EOL;
|
||||
//echo PHP_EOL;
|
||||
exit(0);
|
||||
}
|
||||
if($total_loop_time == false)
|
||||
@@ -356,12 +356,12 @@ class pts_stress_run_manager extends pts_test_run_manager
|
||||
}
|
||||
if($this->stress_log_event_call)
|
||||
{
|
||||
call_user_func($this->stress_log_event_call, $this->stress_logger->get_log());
|
||||
call_user_func($this->stress_log_event_call, $this->stress_logger->get_clean_log());
|
||||
}
|
||||
}
|
||||
public function get_stress_log()
|
||||
{
|
||||
return $this->stress_logger->get_log();
|
||||
return $this->stress_logger->get_clean_log();
|
||||
}
|
||||
public function sig_handler($signo)
|
||||
{
|
||||
@@ -380,57 +380,6 @@ class pts_stress_run_manager extends pts_test_run_manager
|
||||
protected function stress_status_report()
|
||||
{
|
||||
return $this->final_stress_report(false);
|
||||
// XXX the below code has been phased out for a unified report called by final_stress_report();
|
||||
|
||||
$report_buffer = PHP_EOL . '###### STRESS RUN CURRENT STATUS ' . date('H:i M j') . ' ####' . PHP_EOL;
|
||||
$report_buffer .= 'ELAPSED TIME: ' . pts_strings::format_time(time() - $this->multi_test_stress_start_time) . PHP_EOL;
|
||||
if($this->loop_until_time > time())
|
||||
{
|
||||
$report_buffer .= 'TIME REMAINING: ' . pts_strings::format_time($this->loop_until_time - time()) . PHP_EOL;
|
||||
}
|
||||
else if($total_loop_time == 'infinite')
|
||||
{
|
||||
$report_buffer .= 'INFINITE TESTING; TESTING UNTIL INTERRUPTED' . PHP_EOL;
|
||||
}
|
||||
else
|
||||
{
|
||||
$report_buffer .= 'WAITING FOR CURRENT TEST RUN QUEUE TO FINISH.' . PHP_EOL;
|
||||
}
|
||||
$report_buffer .= 'NUMBER OF CONCURRENT TESTS PERMITTED: ' . $this->multi_test_stress_run . PHP_EOL . PHP_EOL;
|
||||
$report_buffer .= 'TESTS CURRENTLY ACTIVE: ' . PHP_EOL;
|
||||
|
||||
$table = array();
|
||||
foreach(pts_file_io::glob($this->thread_collection_dir . '*') as $pid_file)
|
||||
{
|
||||
$test = pts_file_io::file_get_contents($pid_file);
|
||||
$table[] = array($test, '[PID: ' . basename($pid_file) . ']');
|
||||
}
|
||||
$report_buffer .= pts_user_io::display_text_table($table, ' - ', 2) . PHP_EOL;
|
||||
|
||||
$report_buffer .= 'TEST SUBSYSTEMS ACTIVE: ' . PHP_EOL;
|
||||
foreach($this->stress_subsystems_active as $type => $count)
|
||||
{
|
||||
$report_buffer .= ' - ' . $type . PHP_EOL;
|
||||
}
|
||||
|
||||
$report_buffer .= 'CURRENT SYSTEM SENSORS: ' . PHP_EOL;
|
||||
$table = array();
|
||||
foreach($this->sensors_to_monitor as &$sensor_object)
|
||||
{
|
||||
// Hacky way to avoid reporting individual CPU core usages each time, save it for summaries
|
||||
if(strpos(phodevi::sensor_object_name($sensor_object), 'CPU Usage (CPU') !== false)
|
||||
continue;
|
||||
|
||||
$sensor_val = phodevi::read_sensor($sensor_object);
|
||||
|
||||
if($sensor_val > 0)
|
||||
{
|
||||
$table[] = array(phodevi::sensor_object_name($sensor_object) . ': ', pts_math::set_precision($sensor_val, 2), phodevi::read_sensor_object_unit($sensor_object));
|
||||
}
|
||||
}
|
||||
$report_buffer .= pts_user_io::display_text_table($table, ' - ', 2) . PHP_EOL;
|
||||
$report_buffer .= '######' . PHP_EOL;
|
||||
return $report_buffer;
|
||||
}
|
||||
protected function final_stress_report($is_final = true)
|
||||
{
|
||||
@@ -444,19 +393,19 @@ class pts_stress_run_manager extends pts_test_run_manager
|
||||
}
|
||||
|
||||
$report_buffer .= strtoupper(date('F j H:i T')) . PHP_EOL;
|
||||
$report_buffer .= 'START TIME: ' . date('F j H:i T', $this->multi_test_stress_start_time) . PHP_EOL;
|
||||
$report_buffer .= 'ELAPSED TIME: ' . pts_strings::format_time(time() - $this->multi_test_stress_start_time) . PHP_EOL;
|
||||
$report_buffer .= pts_client::cli_just_bold('START TIME: ') . date('F j H:i T', $this->multi_test_stress_start_time) . PHP_EOL;
|
||||
$report_buffer .= pts_client::cli_just_bold('ELAPSED TIME: ') . pts_strings::format_time(time() - $this->multi_test_stress_start_time) . PHP_EOL;
|
||||
if($this->loop_until_time > time())
|
||||
{
|
||||
$report_buffer .= 'TIME REMAINING: ' . pts_strings::format_time($this->loop_until_time - time()) . PHP_EOL;
|
||||
$report_buffer .= pts_client::cli_just_bold('TIME REMAINING: ') . pts_strings::format_time($this->loop_until_time - time()) . PHP_EOL;
|
||||
}
|
||||
else
|
||||
{
|
||||
$report_buffer .= 'WAITING FOR CURRENT TEST RUN QUEUE TO FINISH.' . PHP_EOL;
|
||||
}
|
||||
$report_buffer .= 'SYSTEM IP: ' . pts_network::get_local_ip() . PHP_EOL;
|
||||
$report_buffer .= 'HOSTNAME: ' . phodevi::read_property('system', 'hostname') . PHP_EOL;
|
||||
$report_buffer .= '# OF CONCURRENT TESTS: ' . $this->multi_test_stress_run . PHP_EOL . PHP_EOL;
|
||||
$report_buffer .= pts_client::cli_just_bold('SYSTEM IP: ') . pts_network::get_local_ip() . PHP_EOL;
|
||||
$report_buffer .= pts_client::cli_just_bold('HOSTNAME: ') . phodevi::read_property('system', 'hostname') . PHP_EOL;
|
||||
$report_buffer .= pts_client::cli_just_bold('# OF CONCURRENT TESTS: ') . $this->multi_test_stress_run . PHP_EOL . PHP_EOL;
|
||||
|
||||
if(!$is_final)
|
||||
{
|
||||
@@ -471,11 +420,11 @@ class pts_stress_run_manager extends pts_test_run_manager
|
||||
$report_buffer .= pts_user_io::display_text_table($table, ' - ', 2) . PHP_EOL;
|
||||
}
|
||||
|
||||
$report_buffer .= PHP_EOL . 'TESTS IN RUN QUEUE: ' . PHP_EOL . PHP_EOL;
|
||||
$report_buffer .= PHP_EOL . pts_client::cli_just_bold('TESTS IN RUN QUEUE: ') . PHP_EOL . PHP_EOL;
|
||||
$tiq = array();
|
||||
foreach($this->get_tests_to_run() as $i => $test)
|
||||
{
|
||||
$bar = strtoupper($test->test_profile->get_title()) . ' [' . $test->test_profile->get_identifier() . ']';
|
||||
$bar = pts_client::cli_colored_text(strtoupper($test->test_profile->get_title()) . ' [' . $test->test_profile->get_identifier() . ']', 'blue', true);
|
||||
if(!isset($tiq[$bar]))
|
||||
{
|
||||
$tiq[$bar] = array();
|
||||
@@ -485,44 +434,42 @@ class pts_stress_run_manager extends pts_test_run_manager
|
||||
}
|
||||
foreach($tiq as $test => $args)
|
||||
{
|
||||
$report_buffer .= $test . PHP_EOL;
|
||||
$report_buffer .= $test;
|
||||
foreach($args as $arg)
|
||||
{
|
||||
if(!empty($arg))
|
||||
{
|
||||
$report_buffer .= ' ' . $arg . PHP_EOL;
|
||||
$report_buffer .= PHP_EOL . ' ' . $arg;
|
||||
}
|
||||
}
|
||||
$report_buffer .= PHP_EOL;
|
||||
}
|
||||
|
||||
|
||||
$report_buffer .= 'SYSTEM INFORMATION: ' . PHP_EOL;
|
||||
$report_buffer .= PHP_EOL . pts_client::cli_just_bold('SYSTEM INFORMATION: ') . PHP_EOL;
|
||||
$table = array();
|
||||
foreach(phodevi::system_hardware(false) as $component => $value)
|
||||
{
|
||||
$table[] = array($component . ': ', $value);
|
||||
$table[] = array(pts_client::cli_just_bold($component . ': '), $value);
|
||||
}
|
||||
foreach(phodevi::system_software(false) as $component => $value)
|
||||
{
|
||||
$table[] = array($component . ': ', $value);
|
||||
$table[] = array(pts_client::cli_just_bold($component . ': '), $value);
|
||||
}
|
||||
$report_buffer .= pts_user_io::display_text_table($table, ' ', 1) . PHP_EOL . PHP_EOL;
|
||||
|
||||
if(!empty($this->stress_tests_executed))
|
||||
{
|
||||
$table = array(array('TESTS EXECUTED', 'TIMES CALLED'));
|
||||
$table = array(array(pts_client::cli_just_bold('TESTS EXECUTED'), pts_client::cli_just_bold('TIMES CALLED')));
|
||||
ksort($this->stress_tests_executed);
|
||||
|
||||
foreach($this->stress_tests_executed as $test => $times)
|
||||
{
|
||||
$table[] = array($test . ': ', $times);
|
||||
$table[] = array(pts_client::cli_just_bold($test) . ': ', $times);
|
||||
}
|
||||
$report_buffer .= pts_user_io::display_text_table($table, ' - ', 2) . PHP_EOL . PHP_EOL;
|
||||
$report_buffer .= pts_user_io::display_text_table($table, ' ', 2) . PHP_EOL . PHP_EOL;
|
||||
}
|
||||
|
||||
$report_buffer .= 'SENSOR DATA: ' . PHP_EOL;
|
||||
$table = array(array('SENSOR', 'MIN', 'AVG', 'MAX'));
|
||||
$report_buffer .= pts_client::cli_just_bold('SENSOR DATA: ') . PHP_EOL;
|
||||
$table = array(array(pts_client::cli_just_bold('SENSOR'), pts_client::cli_just_bold('MIN'), pts_client::cli_just_bold('AVG'), pts_client::cli_just_bold('MAX')));
|
||||
foreach($this->sensor_data_archived as $sensor_name => &$sensor_data)
|
||||
{
|
||||
if(empty($sensor_data))
|
||||
@@ -532,7 +479,7 @@ class pts_stress_run_manager extends pts_test_run_manager
|
||||
|
||||
if($max_val > 0)
|
||||
{
|
||||
$table[] = array($sensor_name . ': ',
|
||||
$table[] = array(pts_client::cli_just_bold($sensor_name . ': '),
|
||||
pts_math::set_precision(min($sensor_data), 2),
|
||||
pts_math::set_precision(array_sum($sensor_data) / count($sensor_data), 2),
|
||||
pts_math::set_precision($max_val, 2),
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, 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
|
||||
@@ -38,7 +38,6 @@ class pts_test_execution
|
||||
{
|
||||
$test_identifier = $test_run_request->test_profile->get_identifier();
|
||||
$extra_arguments = $test_run_request->get_arguments();
|
||||
$arguments_description = $test_run_request->get_arguments_description();
|
||||
$full_output = pts_config::read_bool_config('PhoronixTestSuite/Options/General/FullOutput', 'FALSE');
|
||||
|
||||
// Do the actual test running process
|
||||
@@ -57,6 +56,7 @@ class pts_test_execution
|
||||
}
|
||||
|
||||
$test_run_request->active = new pts_test_result_buffer_active();
|
||||
$test_run_request->generated_result_buffers = array();
|
||||
$execute_binary = $test_run_request->test_profile->get_test_executable();
|
||||
$times_to_run = $test_run_request->test_profile->get_times_to_run();
|
||||
$ignore_runs = $test_run_request->test_profile->get_runs_to_ignore();
|
||||
@@ -64,6 +64,7 @@ class pts_test_execution
|
||||
$allow_cache_share = $test_run_request->test_profile->allow_cache_share() && $test_run_manager->allow_test_cache_share();
|
||||
$min_length = $test_run_request->test_profile->get_min_length();
|
||||
$max_length = $test_run_request->test_profile->get_max_length();
|
||||
$is_monitoring = false;
|
||||
|
||||
if($test_run_request->test_profile->get_environment_testing_size() > 1 && ceil(disk_free_space($test_directory) / 1048576) < $test_run_request->test_profile->get_environment_testing_size())
|
||||
{
|
||||
@@ -80,14 +81,13 @@ class pts_test_execution
|
||||
// Start
|
||||
$cache_share_pt2so = $test_directory . 'cache-share-' . PTS_INIT_TIME . '.pt2so';
|
||||
$cache_share_present = $allow_cache_share && is_file($cache_share_pt2so);
|
||||
$test_run_request->set_used_arguments_description($arguments_description);
|
||||
pts_module_manager::module_process('__pre_test_run', $test_run_request);
|
||||
|
||||
$time_test_start = time();
|
||||
$time_test_start = microtime(true);
|
||||
pts_client::$display->test_run_start($test_run_manager, $test_run_request);
|
||||
sleep(1);
|
||||
|
||||
if(!$cache_share_present)
|
||||
if(!$cache_share_present && !$test_run_manager->DEBUG_no_test_execution_just_result_parse)
|
||||
{
|
||||
$pre_output = pts_tests::call_test_script($test_run_request->test_profile, 'pre', 'Running Pre-Test Script', $pts_test_arguments, $extra_runtime_variables, true);
|
||||
|
||||
@@ -118,7 +118,7 @@ class pts_test_execution
|
||||
$execute_binary_prepend = $test_run_request->exec_binary_prepend;
|
||||
}
|
||||
|
||||
if(!$cache_share_present && $test_run_request->test_profile->is_root_required())
|
||||
if(!$cache_share_present && !$test_run_manager->DEBUG_no_test_execution_just_result_parse && $test_run_request->test_profile->is_root_required())
|
||||
{
|
||||
if(phodevi::is_root() == false)
|
||||
{
|
||||
@@ -144,11 +144,35 @@ class pts_test_execution
|
||||
$backup_test_log_dir = false;
|
||||
}
|
||||
|
||||
for($i = 0, $abort_testing = false, $time_test_start_actual = time(), $defined_times_to_run = $times_to_run; $i < $times_to_run && $i < 256 && !$abort_testing; $i++)
|
||||
//
|
||||
// THE MAIN TESTING LOOP
|
||||
//
|
||||
|
||||
for($i = 0, $times_result_produced = 0, $abort_testing = false, $time_test_start_actual = microtime(true), $defined_times_to_run = $times_to_run; $i < $times_to_run && $i < 256 && !$abort_testing; $i++)
|
||||
{
|
||||
pts_client::$display->test_run_instance_header($test_run_request);
|
||||
$test_log_file = $test_directory . basename($test_identifier) . '-' . $runtime_identifier . '-' . ($i + 1) . '.log';
|
||||
if($test_run_manager->DEBUG_no_test_execution_just_result_parse)
|
||||
{
|
||||
$find_log_file = pts_file_io::glob($test_directory . basename($test_identifier) . '-*.log');
|
||||
if(!empty($find_log_file))
|
||||
{
|
||||
if(!isset($find_log_file[0]) || empty($find_log_file[0]))
|
||||
{
|
||||
pts_client::test_profile_debug_message('No existing log file found for this test profile. Generate one by using the run/benchmark or debug-run commands.');
|
||||
return false;
|
||||
}
|
||||
|
||||
$test_log_file = $find_log_file[0];
|
||||
pts_client::test_profile_debug_message('Log File: ' . $test_log_file);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$test_log_file = $test_directory . basename($test_identifier) . '-' . $runtime_identifier . '-' . ($i + 1) . '.log';
|
||||
}
|
||||
|
||||
$is_expected_last_run = ($i == ($times_to_run - 1));
|
||||
$produced_monitoring_result = false;
|
||||
$has_result = false;
|
||||
|
||||
$test_extra_runtime_variables = array_merge($extra_runtime_variables, array(
|
||||
'LOG_FILE' => $test_log_file,
|
||||
@@ -163,7 +187,7 @@ class pts_test_execution
|
||||
|
||||
if($cache_share)
|
||||
{
|
||||
$test_result = $cache_share->read_object('test_results_output_' . $i);
|
||||
$test_result_std_output = $cache_share->read_object('test_results_output_' . $i);
|
||||
$test_extra_runtime_variables['LOG_FILE'] = $cache_share->read_object('log_file_location_' . $i);
|
||||
|
||||
if($test_extra_runtime_variables['LOG_FILE'] != null)
|
||||
@@ -177,25 +201,26 @@ class pts_test_execution
|
||||
unset($cache_share);
|
||||
}
|
||||
|
||||
if($restored_from_cache == false)
|
||||
if(!$test_run_manager->DEBUG_no_test_execution_just_result_parse && $restored_from_cache == false)
|
||||
{
|
||||
pts_client::$display->test_run_instance_header($test_run_request);
|
||||
sleep(1);
|
||||
$test_run_command = 'cd ' . $to_execute . ' && ' . $execute_binary_prepend . './' . $execute_binary . ' ' . $pts_test_arguments . ' 2>&1';
|
||||
|
||||
pts_client::test_profile_debug_message('Test Run Command: ' . $test_run_command);
|
||||
|
||||
$is_monitoring = pts_test_result_parser::system_monitor_task_check($test_run_request->test_profile);
|
||||
$test_run_time_start = time();
|
||||
$is_monitoring = pts_test_result_parser::system_monitor_task_check($test_run_request);
|
||||
$test_run_time_start = microtime(true);
|
||||
|
||||
if(phodevi::is_windows() || pts_client::read_env('USE_PHOROSCRIPT_INTERPRETER') != false)
|
||||
{
|
||||
$phoroscript = new pts_phoroscript_interpreter($to_execute . '/' . $execute_binary, $test_extra_runtime_variables, $to_execute);
|
||||
$phoroscript->execute_script($pts_test_arguments);
|
||||
$test_result = null;
|
||||
$test_result_std_output = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
//$test_result = pts_client::shell_exec($test_run_command, $test_extra_runtime_variables);
|
||||
//$test_result_std_output = pts_client::shell_exec($test_run_command, $test_extra_runtime_variables);
|
||||
$descriptorspec = array(0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w'));
|
||||
$test_process = proc_open('exec ' . $execute_binary_prepend . './' . $execute_binary . ' ' . $pts_test_arguments . ' 2>&1', $descriptorspec, $pipes, $to_execute, array_merge($_ENV, pts_client::environmental_variables(), $test_extra_runtime_variables));
|
||||
|
||||
@@ -203,30 +228,39 @@ class pts_test_execution
|
||||
{
|
||||
//echo proc_get_status($test_process)['pid'];
|
||||
pts_module_manager::module_process('__test_running', $test_process);
|
||||
$test_result = stream_get_contents($pipes[1]);
|
||||
$test_result_std_output = stream_get_contents($pipes[1]);
|
||||
fclose($pipes[1]);
|
||||
fclose($pipes[2]);
|
||||
$return_value = proc_close($test_process);
|
||||
}
|
||||
}
|
||||
|
||||
$test_run_time = time() - $test_run_time_start;
|
||||
$monitor_result = $is_monitoring ? pts_test_result_parser::system_monitor_task_post_test($test_run_request->test_profile) : 0;
|
||||
$test_run_time = microtime(true) - $test_run_time_start;
|
||||
$test_run_request->test_run_times[] = $test_run_time;
|
||||
$produced_monitoring_result = $is_monitoring ? pts_test_result_parser::system_monitor_task_post_test($test_run_request) : false;
|
||||
}
|
||||
|
||||
|
||||
if(!isset($test_result[10240]) || pts_client::is_debug_mode() || $full_output)
|
||||
else
|
||||
{
|
||||
pts_client::$display->test_run_instance_output($test_result);
|
||||
if($i == 1) // to only display once
|
||||
{
|
||||
pts_client::$display->test_run_message('Utilizing Data From Shared Cache');
|
||||
}
|
||||
$test_run_time = 0;
|
||||
}
|
||||
|
||||
if(is_file($test_log_file) && trim($test_result) == null && (filesize($test_log_file) < 10240 || pts_client::is_debug_mode() || $full_output))
|
||||
|
||||
if(!isset($test_result_std_output[10240]) || pts_client::is_debug_mode() || $full_output)
|
||||
{
|
||||
pts_client::$display->test_run_instance_output($test_result_std_output);
|
||||
}
|
||||
|
||||
if(is_file($test_log_file) && trim($test_result_std_output) == null && (filesize($test_log_file) < 10240 || pts_client::is_debug_mode() || $full_output))
|
||||
{
|
||||
$test_log_file_contents = file_get_contents($test_log_file);
|
||||
pts_client::$display->test_run_instance_output($test_log_file_contents);
|
||||
unset($test_log_file_contents);
|
||||
}
|
||||
$test_run_request->test_result_standard_output = $test_result;
|
||||
$test_run_request->test_result_standard_output = $test_result_std_output;
|
||||
|
||||
$exit_status_pass = true;
|
||||
if(is_file($test_directory . 'test-exit-status'))
|
||||
@@ -254,20 +288,18 @@ class pts_test_execution
|
||||
|
||||
if(!in_array(($i + 1), $ignore_runs) && $exit_status_pass)
|
||||
{
|
||||
if(isset($monitor_result) && $monitor_result != 0)
|
||||
// if it was monitoring, active result should already be set
|
||||
if(!$produced_monitoring_result) // XXX once single-run-multiple-outputs is supported, this check can be disabled to allow combination of results
|
||||
{
|
||||
$test_run_request->active->active_result = $monitor_result;
|
||||
}
|
||||
else
|
||||
{
|
||||
pts_test_result_parser::parse_result($test_run_request, $test_extra_runtime_variables['LOG_FILE']);
|
||||
$has_result = pts_test_result_parser::parse_result($test_run_request, $test_extra_runtime_variables['LOG_FILE']);
|
||||
}
|
||||
|
||||
pts_client::test_profile_debug_message('Test Result Value: ' . $test_run_request->active->active_result);
|
||||
$has_result = $has_result || $produced_monitoring_result;
|
||||
|
||||
if(!empty($test_run_request->active->active_result))
|
||||
if($has_result)
|
||||
{
|
||||
if($test_run_time < 2 && intval($test_run_request->active->active_result) == $test_run_request->active->active_result && $test_run_request->test_profile->get_estimated_run_time() > 60 && !$restored_from_cache)
|
||||
$times_result_produced++;
|
||||
if($test_run_time < 2 && $test_run_request->test_profile->get_estimated_run_time() > 60 && !$restored_from_cache && !$test_run_manager->DEBUG_no_test_execution_just_result_parse)
|
||||
{
|
||||
// If the test ended in less than two seconds, outputted some int, and normally the test takes much longer, then it's likely some invalid run
|
||||
self::test_run_instance_error($test_run_manager, $test_run_request, 'The test run ended prematurely.');
|
||||
@@ -282,11 +314,6 @@ class pts_test_execution
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO integrate active_result into active buffer
|
||||
$test_run_request->active->add_trial_run_result($test_run_request->active->active_result, $test_run_request->active->active_min_result, $test_run_request->active->active_max_result);
|
||||
}
|
||||
}
|
||||
else if($test_run_request->test_profile->get_display_format() != 'NO_RESULT')
|
||||
{
|
||||
@@ -305,27 +332,29 @@ class pts_test_execution
|
||||
|
||||
if($allow_cache_share && !is_file($cache_share_pt2so))
|
||||
{
|
||||
$cache_share->add_object('test_results_output_' . $i, $test_run_request->active->active_result);
|
||||
$cache_share->add_object('test_results_output_' . $i, $test_result_std_output);
|
||||
$cache_share->add_object('log_file_location_' . $i, $test_extra_runtime_variables['LOG_FILE']);
|
||||
$cache_share->add_object('log_file_' . $i, (is_file($test_log_file) ? file_get_contents($test_log_file) : null));
|
||||
}
|
||||
}
|
||||
|
||||
if($is_expected_last_run && $test_run_request->active->get_trial_run_count() > floor(($i - 2) / 2) && !$cache_share_present && $test_run_manager->do_dynamic_run_count())
|
||||
if($is_expected_last_run && $times_result_produced > floor(($i - 2) / 2) && !$cache_share_present && !$test_run_manager->DEBUG_no_test_execution_just_result_parse && $test_run_manager->do_dynamic_run_count())
|
||||
{
|
||||
// The later check above ensures if the test is failing often the run count won't uselessly be increasing
|
||||
// Should we increase the run count?
|
||||
$increase_run_count = false;
|
||||
|
||||
if($defined_times_to_run == ($i + 1) && $test_run_request->active->get_trial_run_count() > 0 && $test_run_request->active->get_trial_run_count() < $defined_times_to_run && $i < 64)
|
||||
if($defined_times_to_run == ($i + 1) && $times_result_produced > 0 && $times_result_produced < $defined_times_to_run && $i < 64)
|
||||
{
|
||||
// At least one run passed, but at least one run failed to produce a result. Increase count to try to get more successful runs
|
||||
$increase_run_count = $defined_times_to_run - $test_run_request->active->get_trial_run_count();
|
||||
$increase_run_count = $defined_times_to_run - $times_result_produced;
|
||||
}
|
||||
else if($test_run_request->active->get_trial_run_count() >= 2)
|
||||
else if($times_result_produced >= 2)
|
||||
{
|
||||
// Dynamically increase run count if needed for statistical significance or other reasons
|
||||
$increase_run_count = $test_run_manager->increase_run_count_check($test_run_request->active, $defined_times_to_run, $test_run_time);
|
||||
$first_tr = array_slice($test_run_request->generated_result_buffers, 0, 1);
|
||||
$first_tr = array_shift($first_tr);
|
||||
$increase_run_count = $test_run_manager->increase_run_count_check($first_tr->active, $defined_times_to_run, $test_run_time); // XXX maybe check all generated buffers to see if to extend?
|
||||
|
||||
if($increase_run_count === -1)
|
||||
{
|
||||
@@ -348,7 +377,7 @@ class pts_test_execution
|
||||
|
||||
if($times_to_run > 1 && $i < ($times_to_run - 1))
|
||||
{
|
||||
if($cache_share_present == false)
|
||||
if($cache_share_present == false && !$test_run_manager->DEBUG_no_test_execution_just_result_parse)
|
||||
{
|
||||
$interim_output = pts_tests::call_test_script($test_run_request->test_profile, 'interim', 'Running Interim Test Script', $pts_test_arguments, $extra_runtime_variables, true);
|
||||
|
||||
@@ -391,9 +420,9 @@ class pts_test_execution
|
||||
pts_client::$display->test_run_instance_complete($test_run_request);
|
||||
}
|
||||
|
||||
$time_test_end_actual = time();
|
||||
$time_test_end_actual = microtime(true);
|
||||
|
||||
if($cache_share_present == false)
|
||||
if($cache_share_present == false && !$test_run_manager->DEBUG_no_test_execution_just_result_parse)
|
||||
{
|
||||
$post_output = pts_tests::call_test_script($test_run_request->test_profile, 'post', 'Running Post-Test Script', $pts_test_arguments, $extra_runtime_variables, true);
|
||||
|
||||
@@ -422,7 +451,7 @@ class pts_test_execution
|
||||
}
|
||||
|
||||
// End
|
||||
$time_test_end = time();
|
||||
$time_test_end = microtime(true);
|
||||
$time_test_elapsed = $time_test_end - $time_test_start;
|
||||
$time_test_elapsed_actual = $time_test_end_actual - $time_test_start_actual;
|
||||
|
||||
@@ -462,69 +491,75 @@ class pts_test_execution
|
||||
}
|
||||
}
|
||||
|
||||
// Fill in missing test details
|
||||
|
||||
if(empty($arguments_description))
|
||||
// Fill in any missing test details
|
||||
foreach($test_run_request->generated_result_buffers as &$sub_tr)
|
||||
{
|
||||
$arguments_description = $test_run_request->test_profile->get_test_subtitle();
|
||||
}
|
||||
$arguments_description = $sub_tr->get_arguments_description();
|
||||
|
||||
$file_var_checks = array(
|
||||
array('pts-results-scale', 'set_result_scale', null),
|
||||
array('pts-results-proportion', 'set_result_proportion', null),
|
||||
array('pts-results-quantifier', 'set_result_quantifier', null),
|
||||
array('pts-test-version', 'set_version', null),
|
||||
array('pts-test-description', null, 'set_used_arguments_description'),
|
||||
array('pts-footnote', null, null),
|
||||
);
|
||||
|
||||
foreach($file_var_checks as &$file_check)
|
||||
{
|
||||
list($file, $set_function, $result_set_function) = $file_check;
|
||||
|
||||
if(is_file($test_directory . $file))
|
||||
if(empty($arguments_description))
|
||||
{
|
||||
$file_contents = pts_file_io::file_get_contents($test_directory . $file);
|
||||
unlink($test_directory . $file);
|
||||
$arguments_description = $sub_tr->test_profile->get_test_subtitle();
|
||||
}
|
||||
|
||||
if(!empty($file_contents))
|
||||
$file_var_checks = array(
|
||||
array('pts-results-scale', 'set_result_scale', null),
|
||||
array('pts-results-proportion', 'set_result_proportion', null),
|
||||
array('pts-results-quantifier', 'set_result_quantifier', null),
|
||||
array('pts-test-version', 'set_version', null),
|
||||
array('pts-test-description', null, 'set_used_arguments_description'),
|
||||
array('pts-footnote', null, null),
|
||||
);
|
||||
|
||||
foreach($file_var_checks as &$file_check)
|
||||
{
|
||||
list($file, $set_function, $result_set_function) = $file_check;
|
||||
|
||||
if(is_file($test_directory . $file))
|
||||
{
|
||||
if($set_function != null)
|
||||
$file_contents = pts_file_io::file_get_contents($test_directory . $file);
|
||||
unlink($test_directory . $file);
|
||||
|
||||
if(!empty($file_contents))
|
||||
{
|
||||
call_user_func(array($test_run_request->test_profile, $set_function), $file_contents);
|
||||
}
|
||||
else if($result_set_function != null)
|
||||
{
|
||||
if($result_set_function == 'set_used_arguments_description')
|
||||
if($set_function != null)
|
||||
{
|
||||
$arguments_description = $file_contents;
|
||||
call_user_func(array($sub_tr->test_profile, $set_function), $file_contents);
|
||||
}
|
||||
else
|
||||
else if($result_set_function != null)
|
||||
{
|
||||
call_user_func(array($test_run_request, $result_set_function), $file_contents);
|
||||
if($result_set_function == 'set_used_arguments_description')
|
||||
{
|
||||
$arguments_description = $file_contents;
|
||||
}
|
||||
else
|
||||
{
|
||||
call_user_func(array($sub_tr, $result_set_function), $file_contents);
|
||||
}
|
||||
}
|
||||
else if($file == 'pts-footnote')
|
||||
{
|
||||
$sub_tr->test_profile->test_installation->set_install_footnote($file_contents);
|
||||
}
|
||||
}
|
||||
else if($file == 'pts-footnote')
|
||||
{
|
||||
$test_run_request->test_profile->test_installation->set_install_footnote($file_contents);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($arguments_description))
|
||||
{
|
||||
$arguments_description = 'Phoronix Test Suite v' . PTS_VERSION;
|
||||
}
|
||||
|
||||
foreach(pts_client::environmental_variables() as $key => $value)
|
||||
{
|
||||
$arguments_description = str_replace('$' . $key, $value, $arguments_description);
|
||||
|
||||
if(!in_array($key, array('VIDEO_MEMORY', 'NUM_CPU_CORES', 'NUM_CPU_JOBS')))
|
||||
if(empty($arguments_description))
|
||||
{
|
||||
$extra_arguments = str_replace('$' . $key, $value, $extra_arguments);
|
||||
$arguments_description = 'Phoronix Test Suite v' . PTS_VERSION;
|
||||
}
|
||||
|
||||
foreach(pts_client::environmental_variables() as $key => $value)
|
||||
{
|
||||
$arguments_description = str_replace('$' . $key, $value, $arguments_description);
|
||||
|
||||
if(!in_array($key, array('VIDEO_MEMORY', 'NUM_CPU_CORES', 'NUM_CPU_JOBS')))
|
||||
{
|
||||
$extra_arguments = str_replace('$' . $key, $value, $extra_arguments);
|
||||
}
|
||||
}
|
||||
$sub_tr->set_used_arguments_description($arguments_description);
|
||||
$sub_tr->set_used_arguments($extra_arguments);
|
||||
}
|
||||
|
||||
// Any device notes to add to PTS test notes area?
|
||||
@@ -533,33 +568,15 @@ class pts_test_execution
|
||||
pts_test_notes_manager::add_note($note);
|
||||
}
|
||||
|
||||
// As of PTS 4.4, this is removed and superceded effectively by reporting the notes to table
|
||||
// Any special information (such as forced AA/AF levels for graphics) to add to the description string of the result?
|
||||
/*
|
||||
if(($special_string = phodevi::read_special_settings_string($test_type)) != null)
|
||||
{
|
||||
if(strpos($arguments_description, $special_string) === false)
|
||||
{
|
||||
if($arguments_description != null)
|
||||
{
|
||||
$arguments_description .= ' | ';
|
||||
}
|
||||
|
||||
$arguments_description .= $special_string;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Result Calculation
|
||||
$test_run_request->set_used_arguments_description($arguments_description);
|
||||
$test_run_request->set_used_arguments($extra_arguments);
|
||||
pts_test_result_parser::calculate_end_result($test_run_request, $test_run_request->active); // Process results
|
||||
|
||||
pts_client::$display->test_run_end($test_run_request);
|
||||
|
||||
// Ending Tasks
|
||||
pts_client::$display->display_interrupt_message($test_run_request->test_profile->get_post_run_message());
|
||||
$test_successful = self::calculate_end_result_post_processing($test_run_manager, $test_run_request); // Process results
|
||||
|
||||
// End Finalize
|
||||
pts_module_manager::module_process('__post_test_run', $test_run_request);
|
||||
$report_elapsed_time = $cache_share_present == false && $test_run_request->active->get_result() != 0;
|
||||
$report_elapsed_time = $cache_share_present == false && $times_result_produced > 0;
|
||||
pts_tests::update_test_install_xml($test_run_request->test_profile, ($report_elapsed_time ? $time_test_elapsed : 0));
|
||||
pts_storage_object::add_in_file(PTS_CORE_STORAGE, 'total_testing_time', ($time_test_elapsed / 60));
|
||||
|
||||
@@ -571,7 +588,181 @@ class pts_test_execution
|
||||
|
||||
// Remove lock
|
||||
pts_client::release_lock($lock_file);
|
||||
return true;
|
||||
return $test_successful;
|
||||
}
|
||||
protected static function calculate_end_result_post_processing(&$test_run_manager, &$root_tr)
|
||||
{
|
||||
$test_successful = false;
|
||||
|
||||
foreach($root_tr->generated_result_buffers as &$test_result)
|
||||
{
|
||||
$trial_results = $test_result->active->results;
|
||||
$END_RESULT = 0;
|
||||
|
||||
switch($test_result->test_profile->get_display_format())
|
||||
{
|
||||
case 'NO_RESULT':
|
||||
// Nothing to do, there are no results
|
||||
break;
|
||||
case 'LINE_GRAPH':
|
||||
case 'FILLED_LINE_GRAPH':
|
||||
case 'TEST_COUNT_PASS':
|
||||
// Just take the first result
|
||||
$END_RESULT = $trial_results[0];
|
||||
break;
|
||||
case 'IMAGE_COMPARISON':
|
||||
// Capture the image
|
||||
$iqc_image_png = $trial_results[0];
|
||||
|
||||
if(is_file($iqc_image_png))
|
||||
{
|
||||
$img_file_64 = base64_encode(file_get_contents($iqc_image_png, FILE_BINARY));
|
||||
$END_RESULT = $img_file_64;
|
||||
unlink($iqc_image_png);
|
||||
}
|
||||
break;
|
||||
case 'PASS_FAIL':
|
||||
case 'MULTI_PASS_FAIL':
|
||||
// Calculate pass/fail type
|
||||
$END_RESULT = -1;
|
||||
|
||||
if(count($trial_results) == 1)
|
||||
{
|
||||
$END_RESULT = $trial_results[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($trial_results as $result)
|
||||
{
|
||||
if($result == 'FALSE' || $result == '0' || $result == 'FAIL' || $result == 'FAILED')
|
||||
{
|
||||
if($END_RESULT == -1 || $END_RESULT == 'PASS')
|
||||
{
|
||||
$END_RESULT = 'FAIL';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($END_RESULT == -1)
|
||||
{
|
||||
$END_RESULT = 'PASS';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'BAR_GRAPH':
|
||||
default:
|
||||
// Result is of a normal numerical type
|
||||
switch($test_result->test_profile->get_result_quantifier())
|
||||
{
|
||||
case 'MAX':
|
||||
$END_RESULT = max($trial_results);
|
||||
break;
|
||||
case 'MIN':
|
||||
$END_RESULT = min($trial_results);
|
||||
break;
|
||||
case 'AVG':
|
||||
default:
|
||||
// assume AVG (average)
|
||||
$is_float = false;
|
||||
$TOTAL_RESULT = 0;
|
||||
$TOTAL_COUNT = 0;
|
||||
|
||||
foreach($trial_results as $result)
|
||||
{
|
||||
$result = trim($result);
|
||||
|
||||
if(is_numeric($result))
|
||||
{
|
||||
$TOTAL_RESULT += $result;
|
||||
$TOTAL_COUNT++;
|
||||
|
||||
if(!$is_float && strpos($result, '.') !== false)
|
||||
{
|
||||
$is_float = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$END_RESULT = pts_math::set_precision($TOTAL_RESULT / ($TOTAL_COUNT > 0 ? $TOTAL_COUNT : 1), $test_result->get_result_precision());
|
||||
|
||||
if(!$is_float)
|
||||
{
|
||||
$END_RESULT = round($END_RESULT);
|
||||
}
|
||||
|
||||
if(count($min = $test_result->active->min_results) > 0)
|
||||
{
|
||||
$min = round(min($min), 2);
|
||||
|
||||
if($min < $END_RESULT && is_numeric($min) && $min != 0)
|
||||
{
|
||||
$test_result->active->set_min_result($min);
|
||||
}
|
||||
}
|
||||
if(count($max = $test_result->active->max_results) > 0)
|
||||
{
|
||||
$max = round(max($max), 2);
|
||||
|
||||
if($max > $END_RESULT && is_numeric($max) && $max != 0)
|
||||
{
|
||||
$test_result->active->set_max_result($max);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
$test_result->active->set_result($END_RESULT);
|
||||
|
||||
pts_client::$display->test_run_end($test_result);
|
||||
|
||||
// Finalize / result post-processing to generate save
|
||||
if($test_result->test_profile->get_display_format() == 'NO_RESULT')
|
||||
{
|
||||
$test_successful = true;
|
||||
}
|
||||
else if($test_result instanceof pts_test_result && $test_result->active)
|
||||
{
|
||||
$end_result = $test_result->active->get_result();
|
||||
|
||||
// removed count($result) > 0 in the move to pts_test_result
|
||||
if(count($test_result) > 0 && ((is_numeric($end_result) && $end_result > 0) || (!is_numeric($end_result) && isset($end_result[3]))))
|
||||
{
|
||||
pts_module_manager::module_process('__post_test_run_success', $test_result);
|
||||
$test_successful = true;
|
||||
|
||||
if($test_run_manager->get_results_identifier() != null)
|
||||
{
|
||||
$test_result->test_result_buffer = new pts_test_result_buffer();
|
||||
$test_result->test_result_buffer->add_test_result($test_run_manager->get_results_identifier(), $test_result->active->get_result(), $test_result->active->get_values_as_string(), pts_test_run_manager::process_json_report_attributes($test_result), $test_result->active->get_min_result(), $test_result->active->get_max_result());
|
||||
$test_run_manager->result_file->add_result($test_result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($test_run_manager->get_results_identifier() != null && $test_run_manager->get_file_name() != null && pts_config::read_bool_config('PhoronixTestSuite/Options/Testing/SaveTestLogs', 'FALSE'))
|
||||
{
|
||||
static $xml_write_pos = 1;
|
||||
pts_file_io::mkdir(PTS_SAVE_RESULTS_PATH . $test_run_manager->get_file_name() . '/test-logs/' . $xml_write_pos . '/');
|
||||
|
||||
if(is_dir(PTS_SAVE_RESULTS_PATH . $test_run_manager->get_file_name() . '/test-logs/active/' . $test_run_manager->get_results_identifier()))
|
||||
{
|
||||
$test_log_write_dir = PTS_SAVE_RESULTS_PATH . $test_run_manager->get_file_name() . '/test-logs/' . $xml_write_pos . '/' . $test_run_manager->get_results_identifier() . '/';
|
||||
if(is_dir($test_log_write_dir))
|
||||
{
|
||||
pts_file_io::delete($test_log_write_dir, null, true);
|
||||
}
|
||||
rename(PTS_SAVE_RESULTS_PATH . $test_run_manager->get_file_name() . '/test-logs/active/' . $test_run_manager->get_results_identifier() . '/', $test_log_write_dir);
|
||||
}
|
||||
$xml_write_pos++;
|
||||
}
|
||||
pts_file_io::unlink(PTS_SAVE_RESULTS_PATH . $test_run_manager->get_file_name() . '/test-logs/active/');
|
||||
|
||||
return $test_successful;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2010 - 2016, Phoronix Media
|
||||
Copyright (C) 2010 - 2016, Michael Larabel
|
||||
Copyright (C) 2010 - 2017, Phoronix Media
|
||||
Copyright (C) 2010 - 2017, 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
|
||||
@@ -69,40 +69,46 @@ class pts_test_install_request
|
||||
|
||||
if($download_xml_file != null)
|
||||
{
|
||||
$xml_parser = new pts_test_downloads_nye_XmlReader($download_xml_file);
|
||||
$package_url = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/URL');
|
||||
$package_md5 = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/MD5');
|
||||
$package_sha256 = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/SHA256');
|
||||
$package_filename = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/FileName');
|
||||
$package_filesize = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/FileSize');
|
||||
$package_platform = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/PlatformSpecific');
|
||||
$package_architecture = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/ArchitectureSpecific');
|
||||
$xml_options = LIBXML_COMPACT | LIBXML_PARSEHUGE;
|
||||
$xml = simplexml_load_file($download_xml_file, 'SimpleXMLElement', $xml_options);
|
||||
|
||||
foreach(array_keys($package_url) as $i)
|
||||
if($xml->Downloads && $xml->Downloads->Package)
|
||||
{
|
||||
if(!empty($package_platform[$i]) && $do_file_checks)
|
||||
foreach($xml->Downloads->Package as $pkg)
|
||||
{
|
||||
$platforms = pts_strings::comma_explode($package_platform[$i]);
|
||||
|
||||
if(!in_array(phodevi::operating_system(), $platforms) && !(phodevi::is_bsd() && in_array('Linux', $platforms) && (pts_client::executable_in_path('kldstat') && strpos(shell_exec('kldstat -n linux 2>&1'), 'linux.ko') != false)))
|
||||
// Check for platform compatibility
|
||||
$pkg_platforms = isset($pkg->PlatformSpecific) ? $pkg->PlatformSpecific->__toString() : null;
|
||||
if(!empty($pkg_platforms) && $do_file_checks)
|
||||
{
|
||||
// This download does not match the operating system
|
||||
continue;
|
||||
$platforms = pts_strings::comma_explode($pkg_platforms);
|
||||
if(!in_array(phodevi::operating_system(), $platforms) && !(phodevi::is_bsd() && in_array('Linux', $platforms) && (pts_client::executable_in_path('kldstat') && strpos(shell_exec('kldstat -n linux 2>&1'), 'linux.ko') != false)))
|
||||
{
|
||||
// This download does not match the operating system
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($package_architecture[$i]) && $do_file_checks)
|
||||
{
|
||||
$architectures = pts_strings::comma_explode($package_architecture[$i]);
|
||||
|
||||
if(phodevi::cpu_arch_compatible($architectures) == false)
|
||||
// Check for architecture compatibility
|
||||
$pkg_architecture = isset($pkg->ArchitectureSpecific) ? $pkg->ArchitectureSpecific->__toString() : null;
|
||||
if(!empty($pkg_architecture) && $do_file_checks)
|
||||
{
|
||||
// This download does not match the CPU architecture
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$architectures = pts_strings::comma_explode($pkg_architecture);
|
||||
|
||||
$this->test_files[] = new pts_test_file_download($package_url[$i], $package_filename[$i], $package_filesize[$i], $package_md5[$i], $package_sha256[$i], $package_platform[$i], $package_architecture[$i]);
|
||||
if(phodevi::cpu_arch_compatible($architectures) == false)
|
||||
{
|
||||
// This download does not match the CPU architecture
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$pkg_url = isset($pkg->URL) ? $pkg->URL->__toString() : null;
|
||||
$pkg_md5 = isset($pkg->MD5) ? $pkg->MD5->__toString() : null;
|
||||
$pkg_sha256 = isset($pkg->SHA256) ? $pkg->SHA256->__toString() : null;
|
||||
$pkg_filename = isset($pkg->FileName) ? $pkg->FileName->__toString() : null;
|
||||
$pkg_filesize = isset($pkg->FileSize) ? $pkg->FileSize->__toString() : null;
|
||||
$pkg_architecture = isset($pkg->ArchitectureSpecific) ? $pkg->ArchitectureSpecific->__toString() : null;
|
||||
$this->test_files[] = new pts_test_file_download($pkg_url, $pkg_filename, $pkg_filesize, $pkg_md5, $pkg_sha256, $pkg_platforms, $pkg_architecture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2016, Phoronix Media
|
||||
Copyright (C) 2009 - 2016, Michael Larabel
|
||||
Copyright (C) 2009 - 2017, Phoronix Media
|
||||
Copyright (C) 2009 - 2017, 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
|
||||
@@ -56,6 +56,7 @@ class pts_test_run_manager
|
||||
protected static $test_run_process_active = false;
|
||||
protected $batch_mode = false;
|
||||
protected $auto_mode = false;
|
||||
public $DEBUG_no_test_execution_just_result_parse = false;
|
||||
|
||||
public function __construct($batch_mode = false, $auto_mode = false)
|
||||
{
|
||||
@@ -108,7 +109,7 @@ class pts_test_run_manager
|
||||
{
|
||||
static $last_run_count = 128; // just a number that should always cause the first check below to be true
|
||||
static $run_std_devs;
|
||||
$times_already_ran = $active_result_buffer->get_trial_run_count();
|
||||
$times_already_ran = count($active_result_buffer->results);
|
||||
|
||||
if($times_already_ran <= $last_run_count)
|
||||
{
|
||||
@@ -359,11 +360,11 @@ class pts_test_run_manager
|
||||
$hashes = array();
|
||||
foreach($this->result_file->get_result_objects() as $result)
|
||||
{
|
||||
$hashes[] = $result->get_comparison_hash(false, false);
|
||||
$hashes[] = $result->get_comparison_hash(true, false);
|
||||
}
|
||||
foreach($this->tests_to_run as &$run_request)
|
||||
{
|
||||
if($run_request instanceof pts_test_result && in_array($run_request->get_comparison_hash(false, false), $hashes))
|
||||
if($run_request instanceof pts_test_result && in_array($run_request->get_comparison_hash(true, false), $hashes))
|
||||
{
|
||||
$no_repeated_tests = false;
|
||||
break;
|
||||
@@ -630,7 +631,13 @@ class pts_test_run_manager
|
||||
return;
|
||||
}
|
||||
|
||||
pts_test_execution::run_test($this, $test_run_request);
|
||||
if($this->result_file instanceof pts_result_file && $this->result_file->has_matching_test_and_run_identifier($test_run_request, $this->get_results_identifier()))
|
||||
{
|
||||
// There already is a match for this test in this particular result buffer
|
||||
return true;
|
||||
}
|
||||
|
||||
$test_successful = pts_test_execution::run_test($this, $test_run_request);
|
||||
|
||||
if(pts_file_io::unlink(PTS_USER_PATH . 'halt-testing'))
|
||||
{
|
||||
@@ -648,68 +655,6 @@ class pts_test_run_manager
|
||||
return false;
|
||||
}
|
||||
|
||||
$test_successful = false;
|
||||
if($test_run_request->test_profile->get_display_format() == 'NO_RESULT')
|
||||
{
|
||||
$test_successful = true;
|
||||
}
|
||||
else if($test_run_request instanceof pts_test_result && $test_run_request->active)
|
||||
{
|
||||
$end_result = $test_run_request->active->get_result();
|
||||
|
||||
// removed count($result) > 0 in the move to pts_test_result
|
||||
if(count($test_run_request) > 0 && ((is_numeric($end_result) && $end_result > 0) || (!is_numeric($end_result) && isset($end_result[3]))))
|
||||
{
|
||||
pts_module_manager::module_process('__post_test_run_success', $test_run_request);
|
||||
$test_identifier = $this->get_results_identifier();
|
||||
$test_successful = true;
|
||||
|
||||
if(!empty($test_identifier))
|
||||
{
|
||||
$test_run_request->test_result_buffer = new pts_test_result_buffer();
|
||||
$test_run_request->test_result_buffer->add_test_result($this->results_identifier, $test_run_request->active->get_result(), $test_run_request->active->get_values_as_string(), self::process_json_report_attributes($test_run_request), $test_run_request->active->get_min_result(), $test_run_request->active->get_max_result());
|
||||
$this->result_file->add_result($test_run_request);
|
||||
|
||||
if($test_run_request->secondary_linked_results != null && is_array($test_run_request->secondary_linked_results))
|
||||
{
|
||||
foreach($test_run_request->secondary_linked_results as &$run_request_minor)
|
||||
{
|
||||
if(strpos($run_request_minor->get_arguments_description(), $test_run_request->get_arguments_description()) === false)
|
||||
{
|
||||
$run_request_minor->set_used_arguments_description($test_run_request->get_arguments_description() . ' - ' . $run_request_minor->get_arguments_description());
|
||||
$run_request_minor->set_used_arguments($test_run_request->get_arguments() . ' - ' . $run_request_minor->get_arguments_description());
|
||||
}
|
||||
|
||||
$run_request_minor->test_result_buffer = new pts_test_result_buffer();
|
||||
$run_request_minor->test_result_buffer->add_test_result($this->results_identifier, $run_request_minor->active->get_result(), $run_request_minor->active->get_values_as_string(), self::process_json_report_attributes($test_run_request),$run_request_minor->active->get_min_result(), $run_request_minor->active->get_max_result());
|
||||
$this->result_file->add_result($run_request_minor);
|
||||
}
|
||||
}
|
||||
|
||||
if($this->get_results_identifier() != null && $this->get_file_name() != null && pts_config::read_bool_config('PhoronixTestSuite/Options/Testing/SaveTestLogs', 'FALSE'))
|
||||
{
|
||||
static $xml_write_pos = 1;
|
||||
pts_file_io::mkdir(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/test-logs/' . $xml_write_pos . '/');
|
||||
|
||||
if(is_dir(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/test-logs/active/' . $this->get_results_identifier()))
|
||||
{
|
||||
$test_log_write_dir = PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/test-logs/' . $xml_write_pos . '/' . $this->get_results_identifier() . '/';
|
||||
|
||||
if(is_dir($test_log_write_dir))
|
||||
{
|
||||
pts_file_io::delete($test_log_write_dir, null, true);
|
||||
}
|
||||
|
||||
rename(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/test-logs/active/' . $this->get_results_identifier() . '/', $test_log_write_dir);
|
||||
}
|
||||
$xml_write_pos++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pts_file_io::unlink(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/test-logs/active/');
|
||||
}
|
||||
|
||||
if($test_successful == false && $test_run_request->test_profile->get_identifier() != null)
|
||||
{
|
||||
$this->failed_tests_to_run[] = $test_run_request;
|
||||
@@ -721,18 +666,21 @@ class pts_test_run_manager
|
||||
|
||||
return true;
|
||||
}
|
||||
protected static function process_json_report_attributes(&$test_run_request)
|
||||
public static function process_json_report_attributes(&$test_run_request)
|
||||
{
|
||||
// XXX : add to attributes JSON here
|
||||
$json_report_attributes = null;
|
||||
|
||||
if(($t = $test_run_request->test_profile->test_installation->get_compiler_data()))
|
||||
if(is_object($test_run_request->test_profile->test_installation))
|
||||
{
|
||||
$json_report_attributes['compiler-options'] = $t;
|
||||
}
|
||||
if(($t = $test_run_request->test_profile->test_installation->get_install_footnote()))
|
||||
{
|
||||
$json_report_attributes['install-footnote'] = $t;
|
||||
if(($t = $test_run_request->test_profile->test_installation->get_compiler_data()))
|
||||
{
|
||||
$json_report_attributes['compiler-options'] = $t;
|
||||
}
|
||||
if(($t = $test_run_request->test_profile->test_installation->get_install_footnote()))
|
||||
{
|
||||
$json_report_attributes['install-footnote'] = $t;
|
||||
}
|
||||
}
|
||||
if(($t = $test_run_request->active->get_min_result()) != 0)
|
||||
{
|
||||
@@ -1285,8 +1233,7 @@ class pts_test_run_manager
|
||||
if(!$this->auto_mode)
|
||||
{
|
||||
pts_client::$display->generic_heading('System Information');
|
||||
echo 'Hardware:' . PHP_EOL . phodevi::system_hardware(true) . PHP_EOL . PHP_EOL;
|
||||
echo 'Software:' . PHP_EOL . phodevi::system_software(true) . PHP_EOL . PHP_EOL;
|
||||
echo phodevi::system_centralized_view() . PHP_EOL;
|
||||
}
|
||||
|
||||
if(($this->prompt_save_results || $this->force_save_results) && count($this->tests_to_run) > 0) // or check for DO_NOT_SAVE_RESULTS == false
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, 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
|
||||
@@ -193,7 +193,6 @@ class pts_tests
|
||||
$extra_vars = array_merge($extra_vars, $extra_vars_append);
|
||||
}
|
||||
|
||||
// TODO: call_test_script could be better cleaned up to fit more closely with new pts_test_profile functions
|
||||
$result = null;
|
||||
$test_directory = $test_profile->get_install_dir();
|
||||
pts_file_io::mkdir($test_directory, 0777, true);
|
||||
@@ -250,7 +249,6 @@ class pts_tests
|
||||
// Refresh/generate an install XML for pts-install.xml
|
||||
if($test_profile->test_installation == false)
|
||||
{
|
||||
// XXX: Hackish way to avoid problems until this function is better written for clean installations, etc
|
||||
$test_profile->test_installation = new pts_installed_test($test_profile);
|
||||
}
|
||||
$xml_writer = new nye_XmlWriter('file://' . PTS_USER_PATH . 'xsl/' . 'pts-test-installation-viewer.xsl');
|
||||
@@ -378,7 +376,7 @@ class pts_tests
|
||||
$days = floor(($current_time - $m_time) / 86400);
|
||||
$recent_result = sprintf('%-' . $res_length . 'ls [%-ls]', $recent_result, ($days == 0 ? 'Today' : pts_strings::days_ago_format_string($days) . ' old'));
|
||||
}
|
||||
echo PHP_EOL . 'Recently Saved Test Results:' . PHP_EOL;
|
||||
echo PHP_EOL . pts_client::cli_just_bold('Recently Saved Test Results:') . PHP_EOL;
|
||||
echo pts_user_io::display_text_list($recent_results) . PHP_EOL;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2010, Phoronix Media
|
||||
Copyright (C) 2010, 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
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class pts_parse_results_nye_XmlReader extends nye_XmlReader
|
||||
{
|
||||
public function __construct($read_xml)
|
||||
{
|
||||
parent::__construct($read_xml);
|
||||
}
|
||||
public function validate()
|
||||
{
|
||||
return $this->dom->schemaValidate(PTS_OPENBENCHMARKING_PATH . 'schemas/results-parser.xsd');
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2010, Phoronix Media
|
||||
Copyright (C) 2010, 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
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class pts_test_downloads_nye_XmlReader extends nye_XmlReader
|
||||
{
|
||||
public function __construct($read_xml)
|
||||
{
|
||||
parent::__construct($read_xml);
|
||||
}
|
||||
public function validate()
|
||||
{
|
||||
return $this->dom->schemaValidate(PTS_OPENBENCHMARKING_PATH . 'schemas/test-profile-downloads.xsd');
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, Michael Larabel
|
||||
phodevi_cpu.php: The PTS Device Interface object for the CPU / processor
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -52,6 +52,15 @@ class phodevi_cpu extends phodevi_device_interface
|
||||
case 'scaling-governor':
|
||||
$property = new phodevi_device_property('cpu_scaling_governor', phodevi::std_caching);
|
||||
break;
|
||||
case 'microcode-version':
|
||||
$property = new phodevi_device_property('cpu_microcode_version', phodevi::smart_caching);
|
||||
break;
|
||||
case 'cache-size':
|
||||
$property = new phodevi_device_property('cpu_cache_size', phodevi::smart_caching);
|
||||
break;
|
||||
case 'cache-size-string':
|
||||
$property = new phodevi_device_property('cpu_cache_size_string', phodevi::smart_caching);
|
||||
break;
|
||||
}
|
||||
|
||||
return $property;
|
||||
@@ -144,6 +153,26 @@ class phodevi_cpu extends phodevi_device_interface
|
||||
|
||||
return (is_numeric($node_count) && $node_count > 0 ? $node_count : 1);
|
||||
}
|
||||
public static function cpu_cache_size()
|
||||
{
|
||||
$cache_size = 0; // in KB
|
||||
|
||||
if(phodevi::is_linux())
|
||||
{
|
||||
$cache_size = self::cpuinfo_cache_size();
|
||||
}
|
||||
else if(phodevi::is_macosx())
|
||||
{
|
||||
$cache_size = phodevi_osx_parser::read_osx_system_profiler('SPHardwareDataType', 'L3Cache');
|
||||
|
||||
if(strpos($cache_size, ' MB'))
|
||||
{
|
||||
$cache_size = substr($cache_size, 0, strpos($cache_size, ' ')) * 1024;
|
||||
}
|
||||
}
|
||||
|
||||
return $cache_size;
|
||||
}
|
||||
public static function cpu_default_frequency_mhz()
|
||||
{
|
||||
return self::cpu_default_frequency() * 1000;
|
||||
@@ -174,6 +203,21 @@ class phodevi_cpu extends phodevi_device_interface
|
||||
|
||||
return strpos($cpu, ' ') !== false && strpos($cpu, ' ') != strrpos($cpu, ' ') && pts_strings::has_in_istring($cpu, array('Intel', 'VIA', 'AMD', 'ARM', 'SPARC', 'Transmeta')) && stripos($cpu, 'unknown') === false;
|
||||
}
|
||||
public static function cpu_microcode_version()
|
||||
{
|
||||
$ucode_version = null;
|
||||
|
||||
if(is_readable('/sys/devices/system/cpu/cpu0/microcode/version'))
|
||||
{
|
||||
$ucode_version = pts_file_io::file_get_contents('/sys/devices/system/cpu/cpu0/microcode/version');
|
||||
}
|
||||
if(empty($ucode_version) && isset(phodevi::$vfs->cpuinfo))
|
||||
{
|
||||
$ucode_version = self::read_cpuinfo_line('microcode');
|
||||
}
|
||||
|
||||
return $ucode_version;
|
||||
}
|
||||
public static function cpu_default_frequency($cpu_core = 0)
|
||||
{
|
||||
// Find out the processor frequency
|
||||
@@ -585,6 +629,16 @@ class phodevi_cpu extends phodevi_device_interface
|
||||
$cache_size = null;
|
||||
}
|
||||
|
||||
return $cache_size;
|
||||
}
|
||||
public static function cpu_cache_size_string()
|
||||
{
|
||||
$cache_size = phodevi::read_property('cpu', 'cache-size');
|
||||
if($cache_size > 1)
|
||||
{
|
||||
$cache_size .= ' KB';
|
||||
}
|
||||
|
||||
return $cache_size;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, Michael Larabel
|
||||
phodevi_disk.php: The PTS Device Interface object for the system disk(s)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -36,6 +36,9 @@ class phodevi_disk extends phodevi_device_interface
|
||||
case 'mount-options':
|
||||
$property = new phodevi_device_property('proc_mount_options', phodevi::no_caching);
|
||||
break;
|
||||
case 'mount-options-string':
|
||||
$property = new phodevi_device_property('proc_mount_options_string', phodevi::no_caching);
|
||||
break;
|
||||
case 'extra-disk-details':
|
||||
$property = new phodevi_device_property('extra_disk_details', phodevi::no_caching);
|
||||
break;
|
||||
@@ -57,6 +60,12 @@ class phodevi_disk extends phodevi_device_interface
|
||||
public static function proc_mount_options($mount_point = null, $mounts = null)
|
||||
{
|
||||
$mount_options = false;
|
||||
if(phodevi::is_windows())
|
||||
{
|
||||
// TODO support Windows if relevant?
|
||||
// Currently this function hangs Windows client
|
||||
return $mount_options;
|
||||
}
|
||||
|
||||
if($mount_point == null && PTS_IS_CLIENT)
|
||||
{
|
||||
@@ -105,6 +114,17 @@ class phodevi_disk extends phodevi_device_interface
|
||||
|
||||
return $mount_options;
|
||||
}
|
||||
public static function proc_mount_options_string($mount_point = null, $mounts = null)
|
||||
{
|
||||
$mo = phodevi::read_property('disk', 'mount-options');
|
||||
|
||||
if(isset($mo['mount-options']))
|
||||
{
|
||||
return $mo['mount-options'];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
public static function is_genuine($disk)
|
||||
{
|
||||
return strpos($disk, ' ') > 1 && !pts_strings::has_in_istring($disk, array('VBOX', 'QEMU', 'Virtual'));
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, Michael Larabel
|
||||
phodevi_gpu.php: The PTS Device Interface object for the graphics processor
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -858,277 +858,227 @@ class phodevi_gpu extends phodevi_device_interface
|
||||
}
|
||||
else if(phodevi::is_linux()) // More liberally attempt open-source freq detection than phodevi::is_mesa_graphics()
|
||||
{
|
||||
$display_driver = phodevi::read_property('system', 'display-driver');
|
||||
switch($display_driver)
|
||||
if(is_file('/sys/class/drm/card0/device/performance_level'))
|
||||
{
|
||||
case '':
|
||||
case 'nouveau':
|
||||
if(is_file('/sys/class/drm/card0/device/performance_level'))
|
||||
// NOUVEAU
|
||||
/*
|
||||
EXAMPLE OUTPUTS:
|
||||
memory 1000MHz core 500MHz voltage 1300mV fanspeed 100%
|
||||
3: memory 333MHz core 500MHz shader 1250MHz fanspeed 100%
|
||||
c: memory 333MHz core 500MHz shader 1250MHz
|
||||
*/
|
||||
|
||||
$performance_level = pts_file_io::file_get_contents('/sys/class/drm/card0/device/performance_level');
|
||||
$performance_level = explode(' ', $performance_level);
|
||||
|
||||
$core_string = array_search('core', $performance_level);
|
||||
if($core_string !== false && isset($performance_level[($core_string + 1)]))
|
||||
{
|
||||
$core_string = str_ireplace('MHz', null, $performance_level[($core_string + 1)]);
|
||||
if(is_numeric($core_string))
|
||||
{
|
||||
/*
|
||||
EXAMPLE OUTPUTS:
|
||||
memory 1000MHz core 500MHz voltage 1300mV fanspeed 100%
|
||||
3: memory 333MHz core 500MHz shader 1250MHz fanspeed 100%
|
||||
c: memory 333MHz core 500MHz shader 1250MHz
|
||||
*/
|
||||
$core_freq = $core_string;
|
||||
}
|
||||
}
|
||||
$mem_string = array_search('memory', $performance_level);
|
||||
if($mem_string !== false && isset($performance_level[($mem_string + 1)]))
|
||||
{
|
||||
$mem_string = str_ireplace('MHz', null, $performance_level[($mem_string + 1)]);
|
||||
if(is_numeric($mem_string))
|
||||
{
|
||||
$mem_freq = $mem_string;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(is_file('/sys/class/drm/card0/device/pstate'))
|
||||
{
|
||||
// Nouveau
|
||||
// pstate is present with Linux 3.13 as the new performance states on Fermi/Kepler
|
||||
$performance_state = pts_file_io::file_get_contents('/sys/class/drm/card0/device/pstate');
|
||||
$performance_level = substr($performance_state, 0, strpos($performance_state, ' *'));
|
||||
if($performance_level == null)
|
||||
{
|
||||
// Method for Linux 3.17+
|
||||
$performance_level = substr($performance_state, strpos($performance_state, 'AC: ') + 4);
|
||||
if(($t = strpos($performance_level, PHP_EOL)))
|
||||
{
|
||||
$performance_level = substr($performance_level, 0, $t);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Method for Linux ~3.13 through Linux 3.16
|
||||
$performance_level = substr($performance_level, strrpos($performance_level, ': ') + 2);
|
||||
}
|
||||
|
||||
$performance_level = pts_file_io::file_get_contents('/sys/class/drm/card0/device/performance_level');
|
||||
$performance_level = explode(' ', $performance_level);
|
||||
$performance_level = explode(' ', $performance_level);
|
||||
$core_string = array_search('core', $performance_level);
|
||||
if($core_string !== false && isset($performance_level[($core_string + 1)]))
|
||||
{
|
||||
$core_string = str_ireplace('MHz', null, $performance_level[($core_string + 1)]);
|
||||
if(strpos($core_string, '-') !== false)
|
||||
{
|
||||
// to work around a range of values, e.g.
|
||||
// 0a: core 405-1032 MHz memory 1620 MHz AC DC *
|
||||
$core_string = max(explode('-', $core_string));
|
||||
}
|
||||
if(is_numeric($core_string))
|
||||
{
|
||||
$core_freq = $core_string;
|
||||
}
|
||||
}
|
||||
$mem_string = array_search('memory', $performance_level);
|
||||
if($mem_string !== false && isset($performance_level[($mem_string + 1)]))
|
||||
{
|
||||
$mem_string = str_ireplace('MHz', null, $performance_level[($mem_string + 1)]);
|
||||
if(strpos($mem_string, '-') !== false)
|
||||
{
|
||||
// to work around a range of values, e.g.
|
||||
// 0a: core 405-1032 MHz memory 1620 MHz AC DC *
|
||||
$mem_string = max(explode('-', $mem_string));
|
||||
}
|
||||
if(is_numeric($mem_string))
|
||||
{
|
||||
$mem_freq = $mem_string;
|
||||
}
|
||||
}
|
||||
|
||||
$core_string = array_search('core', $performance_level);
|
||||
if($core_string !== false && isset($performance_level[($core_string + 1)]))
|
||||
}
|
||||
|
||||
//
|
||||
// RADEON / AMDGPU Logic
|
||||
//
|
||||
|
||||
if(isset(phodevi::$vfs->radeon_pm_info))
|
||||
{
|
||||
// radeon_pm_info should be present with Linux 2.6.34+ but was changed with Linux 3.11 Radeon DPM
|
||||
if(stripos(phodevi::$vfs->radeon_pm_info, 'default'))
|
||||
{
|
||||
foreach(pts_strings::trim_explode("\n", phodevi::$vfs->radeon_pm_info) as $pm_line)
|
||||
{
|
||||
if($pm_line == null)
|
||||
{
|
||||
$core_string = str_ireplace('MHz', null, $performance_level[($core_string + 1)]);
|
||||
if(is_numeric($core_string))
|
||||
{
|
||||
$core_freq = $core_string;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
list($descriptor, $value) = pts_strings::colon_explode($pm_line);
|
||||
|
||||
$mem_string = array_search('memory', $performance_level);
|
||||
if($mem_string !== false && isset($performance_level[($mem_string + 1)]))
|
||||
switch($descriptor)
|
||||
{
|
||||
$mem_string = str_ireplace('MHz', null, $performance_level[($mem_string + 1)]);
|
||||
if(is_numeric($mem_string))
|
||||
{
|
||||
$mem_freq = $mem_string;
|
||||
}
|
||||
case 'default engine clock':
|
||||
$core_freq = pts_arrays::first_element(explode(' ', $value)) / 1000;
|
||||
break;
|
||||
case 'default memory clock':
|
||||
$mem_freq = pts_arrays::first_element(explode(' ', $value)) / 1000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(is_file('/sys/class/drm/card0/device/pstate'))
|
||||
}
|
||||
if($core_freq == 0 && ($x = stripos(phodevi::$vfs->radeon_pm_info, 'sclk: ')) != false)
|
||||
{
|
||||
$x = substr(phodevi::$vfs->radeon_pm_info, $x + strlen('sclk: '));
|
||||
$x = substr($x, 0, strpos($x, ' '));
|
||||
if(is_numeric($x) && $x > 100)
|
||||
{
|
||||
// pstate is present with Linux 3.13 as the new performance states on Fermi/Kepler
|
||||
$performance_state = pts_file_io::file_get_contents('/sys/class/drm/card0/device/pstate');
|
||||
$performance_level = substr($performance_state, 0, strpos($performance_state, ' *'));
|
||||
if($performance_level == null)
|
||||
if($x > 10000)
|
||||
{
|
||||
// Method for Linux 3.17+
|
||||
$performance_level = substr($performance_state, strpos($performance_state, 'AC: ') + 4);
|
||||
|
||||
if(($t = strpos($performance_level, PHP_EOL)))
|
||||
{
|
||||
$performance_level = substr($performance_level, 0, $t);
|
||||
}
|
||||
$x = $x / 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Method for Linux ~3.13 through Linux 3.16
|
||||
$performance_level = substr($performance_level, strrpos($performance_level, ': ') + 2);
|
||||
}
|
||||
|
||||
$performance_level = explode(' ', $performance_level);
|
||||
|
||||
$core_string = array_search('core', $performance_level);
|
||||
if($core_string !== false && isset($performance_level[($core_string + 1)]))
|
||||
{
|
||||
$core_string = str_ireplace('MHz', null, $performance_level[($core_string + 1)]);
|
||||
|
||||
if(strpos($core_string, '-') !== false)
|
||||
{
|
||||
// to work around a range of values, e.g.
|
||||
// 0a: core 405-1032 MHz memory 1620 MHz AC DC *
|
||||
$core_string = max(explode('-', $core_string));
|
||||
}
|
||||
|
||||
if(is_numeric($core_string))
|
||||
{
|
||||
$core_freq = $core_string;
|
||||
}
|
||||
}
|
||||
|
||||
$mem_string = array_search('memory', $performance_level);
|
||||
if($mem_string !== false && isset($performance_level[($mem_string + 1)]))
|
||||
{
|
||||
$mem_string = str_ireplace('MHz', null, $performance_level[($mem_string + 1)]);
|
||||
|
||||
if(strpos($mem_string, '-') !== false)
|
||||
{
|
||||
// to work around a range of values, e.g.
|
||||
// 0a: core 405-1032 MHz memory 1620 MHz AC DC *
|
||||
$mem_string = max(explode('-', $mem_string));
|
||||
}
|
||||
|
||||
if(is_numeric($mem_string))
|
||||
{
|
||||
$mem_freq = $mem_string;
|
||||
}
|
||||
}
|
||||
|
||||
$core_freq = $x;
|
||||
}
|
||||
if($display_driver != null)
|
||||
if(($x = stripos(phodevi::$vfs->radeon_pm_info, 'mclk: ')) != false)
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 'radeon':
|
||||
if(isset(phodevi::$vfs->radeon_pm_info))
|
||||
{
|
||||
// radeon_pm_info should be present with Linux 2.6.34+ but was changed with Linux 3.11 Radeon DPM
|
||||
if(stripos(phodevi::$vfs->radeon_pm_info, 'default'))
|
||||
$x = substr(phodevi::$vfs->radeon_pm_info, $x + strlen('mclk: '));
|
||||
$x = substr($x, 0, strpos($x, ' '));
|
||||
if(is_numeric($x) && $x > 100)
|
||||
{
|
||||
foreach(pts_strings::trim_explode("\n", phodevi::$vfs->radeon_pm_info) as $pm_line)
|
||||
if($x > 10000)
|
||||
{
|
||||
if($pm_line == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
list($descriptor, $value) = pts_strings::colon_explode($pm_line);
|
||||
|
||||
switch($descriptor)
|
||||
{
|
||||
case 'default engine clock':
|
||||
$core_freq = pts_arrays::first_element(explode(' ', $value)) / 1000;
|
||||
break;
|
||||
case 'default memory clock':
|
||||
$mem_freq = pts_arrays::first_element(explode(' ', $value)) / 1000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($core_freq == 0 && ($x = stripos(phodevi::$vfs->radeon_pm_info, 'sclk: ')) != false)
|
||||
{
|
||||
$x = substr(phodevi::$vfs->radeon_pm_info, $x + strlen('sclk: '));
|
||||
$x = substr($x, 0, strpos($x, ' '));
|
||||
if(is_numeric($x) && $x > 100)
|
||||
{
|
||||
if($x > 10000)
|
||||
{
|
||||
$x = $x / 100;
|
||||
}
|
||||
$core_freq = $x;
|
||||
}
|
||||
|
||||
if(($x = stripos(phodevi::$vfs->radeon_pm_info, 'mclk: ')) != false)
|
||||
{
|
||||
$x = substr(phodevi::$vfs->radeon_pm_info, $x + strlen('mclk: '));
|
||||
$x = substr($x, 0, strpos($x, ' '));
|
||||
if(is_numeric($x) && $x > 100)
|
||||
{
|
||||
if($x > 10000)
|
||||
{
|
||||
$x = $x / 100;
|
||||
}
|
||||
$mem_freq = $x;
|
||||
}
|
||||
$x = $x / 100;
|
||||
}
|
||||
$mem_freq = $x;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($core_freq == null && isset(phodevi::$vfs->dmesg) && strrpos(phodevi::$vfs->dmesg, ' sclk:'))
|
||||
{
|
||||
// Attempt to read the LAST power level reported to dmesg, this is the current way for Radeon DPM on Linux 3.11+
|
||||
$dmesg_parse = phodevi::$vfs->dmesg;
|
||||
if(($x = strrpos($dmesg_parse, ' sclk:')))
|
||||
{
|
||||
$dmesg_parse = substr($dmesg_parse, $x);
|
||||
$dmesg_parse = explode(' ', substr($dmesg_parse, 0, strpos($dmesg_parse, PHP_EOL)));
|
||||
|
||||
if($core_freq == null)
|
||||
$sclk = array_search('sclk:', $dmesg_parse);
|
||||
if($sclk !== false && isset($dmesg_parse[($sclk + 1)]) && is_numeric($dmesg_parse[($sclk + 1)]))
|
||||
{
|
||||
// Attempt to read the LAST power level reported to dmesg, this is the current way for Radeon DPM on Linux 3.11+
|
||||
$dmesg_parse = isset(phodevi::$vfs->dmesg) ? phodevi::$vfs->dmesg : null;
|
||||
if(($x = strrpos($dmesg_parse, ' sclk:')))
|
||||
$sclk = $dmesg_parse[($sclk + 1)];
|
||||
if($sclk > 10000)
|
||||
{
|
||||
$dmesg_parse = substr($dmesg_parse, $x);
|
||||
$dmesg_parse = explode(' ', substr($dmesg_parse, 0, strpos($dmesg_parse, PHP_EOL)));
|
||||
|
||||
$sclk = array_search('sclk:', $dmesg_parse);
|
||||
if($sclk !== false && isset($dmesg_parse[($sclk + 1)]) && is_numeric($dmesg_parse[($sclk + 1)]))
|
||||
{
|
||||
$sclk = $dmesg_parse[($sclk + 1)];
|
||||
if($sclk > 10000)
|
||||
{
|
||||
$sclk = $sclk / 100;
|
||||
}
|
||||
|
||||
$core_freq = $sclk;
|
||||
}
|
||||
$mclk = array_search('mclk:', $dmesg_parse);
|
||||
if($mclk !== false && isset($dmesg_parse[($mclk + 1)]) && is_numeric($dmesg_parse[($mclk + 1)]))
|
||||
{
|
||||
$mclk = $dmesg_parse[($mclk + 1)];
|
||||
if($mclk > 10000)
|
||||
{
|
||||
$mclk = $mclk / 100;
|
||||
}
|
||||
|
||||
$mem_freq = $mclk;
|
||||
}
|
||||
$sclk = $sclk / 100;
|
||||
}
|
||||
$core_freq = $sclk;
|
||||
}
|
||||
|
||||
if($core_freq == null)
|
||||
$mclk = array_search('mclk:', $dmesg_parse);
|
||||
if($mclk !== false && isset($dmesg_parse[($mclk + 1)]) && is_numeric($dmesg_parse[($mclk + 1)]))
|
||||
{
|
||||
// Old ugly way of handling the clock information
|
||||
$log_parse = isset(phodevi::$vfs->xorg_log) ? phodevi::$vfs->xorg_log : null;
|
||||
if(($engine_clock = strpos($log_parse, 'Default Engine Clock: ')))
|
||||
$mclk = $dmesg_parse[($mclk + 1)];
|
||||
if($mclk > 10000)
|
||||
{
|
||||
$core_freq = substr($log_parse, $engine_clock + 22);
|
||||
$core_freq = substr($core_freq, 0, strpos($core_freq, "\n"));
|
||||
$core_freq = is_numeric($core_freq) ? $core_freq / 1000 : 0;
|
||||
|
||||
if($core_freq && ($mem_clock = strpos($log_parse, 'Default Memory Clock: ')))
|
||||
{
|
||||
$mem_freq = substr($log_parse, $mem_clock + 22);
|
||||
$mem_freq = substr($mem_freq, 0, strpos($mem_freq, "\n"));
|
||||
$mem_freq = is_numeric($mem_freq) ? $mem_freq / 1000 : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$core_freq = 0;
|
||||
}
|
||||
$mclk = $mclk / 100;
|
||||
}
|
||||
$mem_freq = $mclk;
|
||||
}
|
||||
if($display_driver != null)
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// INTEL
|
||||
//
|
||||
|
||||
// try to read the maximum dynamic frequency
|
||||
if($core_freq == 0 && is_file('/sys/class/drm/card0/gt_max_freq_mhz'))
|
||||
{
|
||||
$gt_max_freq_mhz = pts_file_io::file_get_contents('/sys/class/drm/card0/gt_max_freq_mhz');
|
||||
if(is_numeric($gt_max_freq_mhz) && $gt_max_freq_mhz > 100)
|
||||
{
|
||||
// Tested on Linux 3.11. Assume the max frequency on any competent GPU is beyond 100MHz
|
||||
$core_freq = $gt_max_freq_mhz;
|
||||
}
|
||||
}
|
||||
if($core_freq == 0 && is_file('/sys/kernel/debug/dri/0/i915_max_freq'))
|
||||
{
|
||||
$i915_max_freq = pts_file_io::file_get_contents('/sys/kernel/debug/dri/0/i915_max_freq');
|
||||
$freq_mhz = substr($i915_max_freq, strpos($i915_max_freq, ': ') + 2);
|
||||
if(is_numeric($freq_mhz))
|
||||
{
|
||||
$core_freq = $freq_mhz;
|
||||
}
|
||||
}
|
||||
// Fallback to base frequency
|
||||
if($core_freq == 0 && isset(phodevi::$vfs->i915_cur_delayinfo))
|
||||
{
|
||||
$i915_cur_delayinfo = phodevi::$vfs->i915_cur_delayinfo;
|
||||
$freq = strpos($i915_cur_delayinfo, 'Max overclocked frequency: ');
|
||||
|
||||
if($freq === false)
|
||||
{
|
||||
$freq = strpos($i915_cur_delayinfo, 'Max non-overclocked (RP0) frequency: ');
|
||||
}
|
||||
if($freq === false)
|
||||
{
|
||||
$freq = strpos($i915_cur_delayinfo, 'Nominal (RP1) frequency: ');
|
||||
}
|
||||
|
||||
if($freq !== false)
|
||||
{
|
||||
$freq_mhz = substr($i915_cur_delayinfo, strpos($i915_cur_delayinfo, ': ', $freq) + 2);
|
||||
$freq_mhz = trim(substr($freq_mhz, 0, strpos($freq_mhz, 'MHz')));
|
||||
if(is_numeric($freq_mhz))
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 'intel':
|
||||
// try to read the maximum dynamic frequency
|
||||
if(is_file('/sys/class/drm/card0/gt_max_freq_mhz'))
|
||||
{
|
||||
$gt_max_freq_mhz = pts_file_io::file_get_contents('/sys/class/drm/card0/gt_max_freq_mhz');
|
||||
|
||||
if(is_numeric($gt_max_freq_mhz) && $gt_max_freq_mhz > 100)
|
||||
{
|
||||
// Tested on Linux 3.11. Assume the max frequency on any competent GPU is beyond 100MHz
|
||||
$core_freq = $gt_max_freq_mhz;
|
||||
}
|
||||
}
|
||||
|
||||
if($core_freq == 0 && is_file('/sys/kernel/debug/dri/0/i915_max_freq'))
|
||||
{
|
||||
$i915_max_freq = pts_file_io::file_get_contents('/sys/kernel/debug/dri/0/i915_max_freq');
|
||||
$freq_mhz = substr($i915_max_freq, strpos($i915_max_freq, ': ') + 2);
|
||||
|
||||
if(is_numeric($freq_mhz))
|
||||
{
|
||||
$core_freq = $freq_mhz;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to base frequency
|
||||
if($core_freq == 0 && isset(phodevi::$vfs->i915_cur_delayinfo))
|
||||
{
|
||||
$i915_cur_delayinfo = phodevi::$vfs->i915_cur_delayinfo;
|
||||
$freq = strpos($i915_cur_delayinfo, 'Max overclocked frequency: ');
|
||||
|
||||
if($freq === false)
|
||||
{
|
||||
$freq = strpos($i915_cur_delayinfo, 'Max non-overclocked (RP0) frequency: ');
|
||||
}
|
||||
|
||||
if($freq === false)
|
||||
{
|
||||
$freq = strpos($i915_cur_delayinfo, 'Nominal (RP1) frequency: ');
|
||||
}
|
||||
|
||||
if($freq !== false)
|
||||
{
|
||||
$freq_mhz = substr($i915_cur_delayinfo, strpos($i915_cur_delayinfo, ': ', $freq) + 2);
|
||||
$freq_mhz = trim(substr($freq_mhz, 0, strpos($freq_mhz, 'MHz')));
|
||||
|
||||
if(is_numeric($freq_mhz))
|
||||
{
|
||||
$core_freq = $freq_mhz;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($display_driver != null)
|
||||
{
|
||||
break;
|
||||
$core_freq = $freq_mhz;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, Michael Larabel
|
||||
phodevi_system.php: The PTS Device Interface object for the system software
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -566,9 +566,9 @@ class phodevi_system extends phodevi_device_interface
|
||||
// GCC
|
||||
// If it's a link, ensure that it's not linking to llvm/clang or something
|
||||
$version = trim(shell_exec('gcc -dumpversion 2>&1'));
|
||||
$v = shell_exec('gcc -v 2>&1');
|
||||
if(pts_strings::is_version($version))
|
||||
{
|
||||
$v = shell_exec('gcc -v 2>&1');
|
||||
|
||||
if(($t = strrpos($v, $version . ' ')) !== false)
|
||||
{
|
||||
@@ -603,6 +603,15 @@ class phodevi_system extends phodevi_device_interface
|
||||
|
||||
$compilers['gcc'] = 'GCC ' . $version;
|
||||
}
|
||||
else if(($t = strpos($v, ' version ')) !== false)
|
||||
{
|
||||
$v = substr($v, ($t + strlen(' version ')));
|
||||
if(($t = strpos($v, ' (')) !== false)
|
||||
{
|
||||
$v = substr($v, 0, $t);
|
||||
$compilers['gcc'] = 'GCC ' . $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1590,9 +1599,16 @@ class phodevi_system extends phodevi_device_interface
|
||||
|
||||
if($renderer && ($s = strpos($renderer, 'Gallium')) !== false)
|
||||
{
|
||||
$renderer = substr($renderer, $s);
|
||||
$renderer = substr($renderer, 0, strpos($renderer, ' ', strpos($renderer, '.')));
|
||||
$info .= ' ' . $renderer . '';
|
||||
$gallium = substr($renderer, $s);
|
||||
$gallium = substr($gallium, 0, strpos($gallium, ' ', strpos($gallium, '.')));
|
||||
$info .= ' ' . $gallium . '';
|
||||
}
|
||||
|
||||
if($renderer && ($s = strpos($renderer, 'LLVM ')) !== false)
|
||||
{
|
||||
$llvm = substr($renderer, $s);
|
||||
$llvm = substr($llvm, 0, strpos($llvm, ')'));
|
||||
$info .= ' (' . $llvm . ')';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2016, Phoronix Media
|
||||
Copyright (C) 2009 - 2016, Michael Larabel
|
||||
Copyright (C) 2009 - 2017, Phoronix Media
|
||||
Copyright (C) 2009 - 2017, Michael Larabel
|
||||
phodevi.php: The object for interacting with the PTS device framework
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -272,6 +272,93 @@ class phodevi extends phodevi_base
|
||||
{
|
||||
return self::system_information_parse(self::available_software_components(), $return_as_string);
|
||||
}
|
||||
public static function system_centralized_view($return_as_string = true)
|
||||
{
|
||||
$core_count = phodevi::is_linux() ? phodevi_cpu::cpuinfo_core_count() : phodevi::read_property('cpu', 'core-count');
|
||||
$thread_count = phodevi_cpu::cpuinfo_thread_count();
|
||||
|
||||
$sys = array(
|
||||
'Processor' => phodevi::read_name('cpu'),
|
||||
array(
|
||||
'Core Count' => $core_count,
|
||||
'Thread Count' => $core_count == $thread_count ? '' : $thread_count, // don't show thread count if it's same as core count
|
||||
'Extensions' => phodevi_cpu::instruction_set_extensions(),
|
||||
// 'Virtualization' => (phodevi_cpu::virtualization_technology() ? phodevi_cpu::virtualization_technology() : ''),
|
||||
'Cache Size' => phodevi::read_property('cpu', 'cache-size-string'),
|
||||
'Microcode'=> phodevi::read_property('cpu', 'microcode-version'),
|
||||
'Scaling Driver'=> phodevi::read_property('cpu', 'scaling-governor'),
|
||||
),
|
||||
'Graphics' => phodevi::read_name('gpu'),
|
||||
array(
|
||||
'OpenGL' => phodevi::read_property('system', 'opengl-driver'),
|
||||
'Vulkan' => phodevi::read_property('system', 'vulkan-driver'),
|
||||
'OpenCL' => phodevi::read_property('system', 'opencl-driver'),
|
||||
'Display Driver' => phodevi::read_property('system', 'display-driver-string'),
|
||||
'Monitor' => phodevi::read_name('monitor'),
|
||||
'Screen' => phodevi::read_property('gpu', 'screen-resolution-string'),
|
||||
),
|
||||
'Motherboard' => phodevi::read_name('motherboard'),
|
||||
array(
|
||||
'Memory' => phodevi::read_name('memory'),
|
||||
'Chipset' => phodevi::read_name('chipset'),
|
||||
'Audio' => phodevi::read_name('audoo'),
|
||||
'Network' => phodevi::read_name('network'),
|
||||
),
|
||||
'Disk' => phodevi::read_name('disk'),
|
||||
array(
|
||||
'File-System' => phodevi::read_property('system', 'filesystem'),
|
||||
'Mount Options' => phodevi::read_property('disk', 'mount-options-string'),
|
||||
'Disk Scheduler' => phodevi::read_property('disk', 'scheduler'),
|
||||
'Disk Details' => phodevi::read_property('disk', 'extra-disk-details'),
|
||||
),
|
||||
'Operating System' => phodevi::read_property('system', 'operating-system'),
|
||||
array(
|
||||
'Kernel' => phodevi::read_property('system', 'kernel-string'),
|
||||
'Desktop' => phodevi::read_property('system', 'desktop-environment'),
|
||||
'Display Server' => phodevi::read_property('system', 'display-server'),
|
||||
'Compiler' => phodevi::read_property('system', 'compiler'),
|
||||
'System Layer' => phodevi::read_property('system', 'system-layer'),
|
||||
)
|
||||
);
|
||||
|
||||
if($return_as_string)
|
||||
{
|
||||
$sys_string = null;
|
||||
$tabled = array();
|
||||
foreach($sys as $key => $in)
|
||||
{
|
||||
$space_in = 2;
|
||||
if(is_array($in))
|
||||
{
|
||||
$tabled = array();
|
||||
foreach($in as $key => $value)
|
||||
{
|
||||
if(!empty($value))
|
||||
{
|
||||
$tabled[] = array(pts_client::cli_just_bold($key) . ':' . str_repeat(' ', (16 - strlen($key))), $value);
|
||||
//$sys_string .= ' ' . strtoupper($key) . ':' . $value . PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(!empty($in))
|
||||
{
|
||||
if(!empty($tabled))
|
||||
{
|
||||
$sys_string .= pts_user_io::display_text_table($tabled, ' ', 0, 17) . PHP_EOL;
|
||||
}
|
||||
$sys_string .= PHP_EOL . ' ' . pts_client::cli_colored_text(strtoupper($key), 'gray', true) . ': ' . str_repeat(' ', (18 - strlen($key))) . pts_client::cli_colored_text($in, 'green', true) . PHP_EOL;
|
||||
}
|
||||
|
||||
}
|
||||
if(!empty($tabled))
|
||||
{
|
||||
$sys_string .= pts_user_io::display_text_table($tabled, ' ', 0, 17) . PHP_EOL;
|
||||
}
|
||||
return $sys_string;
|
||||
}
|
||||
|
||||
return $sys;
|
||||
}
|
||||
public static function system_id_string()
|
||||
{
|
||||
$extra = null;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2016, Phoronix Media
|
||||
Copyright (C) 2009 - 2016, Michael Larabel
|
||||
Copyright (C) 2009 - 2017, Phoronix Media
|
||||
Copyright (C) 2009 - 2017, Michael Larabel
|
||||
phodevi_base.php: The base object for interacting with the Phoronix Device Interface
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2014 - 2016, Phoronix Media
|
||||
Copyright (C) 2014 - 2016, Michael Larabel
|
||||
Copyright (C) 2014 - 2017, Phoronix Media
|
||||
Copyright (C) 2014 - 2017, 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
|
||||
@@ -142,7 +142,8 @@ class phoromatic_server
|
||||
}
|
||||
|
||||
// TODO XXX make this a rootadmin option or something
|
||||
// self::$db->exec('PRAGMA synchronous = OFF');
|
||||
self::$db->exec('PRAGMA journal_mode = WAL');
|
||||
self::$db->exec('PRAGMA synchronous = NORMAL');
|
||||
|
||||
switch(self::read_database_version())
|
||||
{
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2011 - 2016, Phoronix Media
|
||||
Copyright (C) 2011 - 2016, Michael Larabel
|
||||
Copyright (C) 2011 - 2017, Phoronix Media
|
||||
Copyright (C) 2011 - 2017, Michael Larabel
|
||||
pts_Table.php: A charting table object for pts_Graph
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -95,14 +95,19 @@ class pts_ResultFileCompactSystemsTable extends pts_graph_core
|
||||
|
||||
// Header
|
||||
$this->svg_dom->add_element('rect', array('x' => 2, 'y' => 1, 'width' => ($this->i['graph_width'] - 3), 'height' => ($this->i['top_heading_height'] - 1), 'fill' => self::$c['color']['main_headers'], 'stroke' => self::$c['color']['border'], 'stroke-width' => 1));
|
||||
$this->svg_dom->add_text_element($this->graph_title, array('x' => ($this->i['graph_width'] / 2), 'y' => (2 + self::$c['size']['headers']), 'font-size' => self::$c['size']['headers'], 'fill' => self::$c['color']['background'], 'text-anchor' => 'middle'));
|
||||
$this->svg_dom->add_text_element($this->graph_title, array('x' => ($this->i['graph_width'] / 2), 'y' => (2 + self::$c['size']['headers']), 'font-size' => self::$c['size']['headers'], 'fill' => self::$c['color']['background'], 'text-anchor' => 'middle', 'font-weight' => 'bold'));
|
||||
|
||||
$this->svg_dom->add_text_element(self::$c['text']['watermark'], array('x' => 4, 'y' => ($this->i['top_heading_height'] - 3), 'font-size' => 8, 'fill' => self::$c['color']['background'], 'text-anchor' => 'start', 'xlink:show' => 'new', 'xlink:href' => self::$c['text']['watermark_url']));
|
||||
$this->svg_dom->add_text_element($this->i['graph_version'], array('x' => ($this->i['graph_width'] - 4), 'y' => ($this->i['top_heading_height'] - 3), 'font-size' => 8, 'fill' => self::$c['color']['background'], 'text-anchor' => 'end', 'xlink:show' => 'new', 'xlink:href' => 'http://www.phoronix-test-suite.com/'));
|
||||
$this->svg_dom->add_text_element(self::$c['text']['watermark'], array('x' => 4, 'y' => ($this->i['top_heading_height'] - 3), 'font-size' => 8, 'fill' => self::$c['color']['background'], 'text-anchor' => 'start', 'xlink:show' => 'new', 'xlink:href' => self::$c['text']['watermark_url'], 'font-weight' => 'bold'));
|
||||
$this->svg_dom->add_text_element($this->i['graph_version'], array('x' => ($this->i['graph_width'] - 4), 'y' => ($this->i['top_heading_height'] - 3), 'font-size' => 8, 'fill' => self::$c['color']['background'], 'text-anchor' => 'end', 'xlink:show' => 'new', 'xlink:href' => 'http://www.phoronix-test-suite.com/', 'font-weight' => 'bold'));
|
||||
|
||||
// Body
|
||||
$offset = $this->i['top_heading_height'];
|
||||
$dash = false;
|
||||
$g1 = $this->svg_dom->make_g(array('fill' => self::$c['color']['body_light']));
|
||||
$g2 = $this->svg_dom->make_g(array('fill' => 'none', 'stroke-width' => 1, 'stroke' => self::$c['color']['highlight']));
|
||||
$g3 = $this->svg_dom->make_g(array('font-size' => $this->i['identifier_size'], 'fill' => self::$c['color']['text'], 'text-anchor' => 'middle', 'font-weight' => 'bold'));
|
||||
$g4 = $this->svg_dom->make_g(array('font-size' => 7, 'fill' => self::$c['color']['text'], 'text-anchor' => 'end'));
|
||||
$g_line = $this->svg_dom->make_g(array('stroke' => self::$c['color']['notches'], 'stroke-width' => 1));
|
||||
|
||||
foreach($this->components as $type => $component)
|
||||
{
|
||||
@@ -129,24 +134,25 @@ class pts_ResultFileCompactSystemsTable extends pts_graph_core
|
||||
|
||||
if($dash)
|
||||
{
|
||||
$this->svg_dom->add_element('rect', array('x' => 0, 'y' => $offset, 'width' => $this->i['graph_width'], 'height' => ($next_offset - $offset), 'fill' => self::$c['color']['body_light']));
|
||||
$this->svg_dom->add_element('rect', array('x' => 0, 'y' => $offset, 'width' => $this->i['graph_width'], 'height' => ($next_offset - $offset)), $g1);
|
||||
}
|
||||
|
||||
$this->svg_dom->draw_svg_line(0, $offset, $this->i['graph_width'], $offset, self::$c['color']['notches'], 1);
|
||||
$this->svg_dom->add_element('line', array('x1' => 0, 'y1' => $offset, 'x2' => $this->i['graph_width'], 'y2' => $offset), $g_line);
|
||||
|
||||
|
||||
if(isset($component[1]))
|
||||
{
|
||||
$this->svg_dom->add_element('rect', array('x' => 1, 'y' => ($offset + 1), 'width' => ($this->i['graph_width'] - 2), 'height' => ($next_offset - $offset - 1), 'fill' => 'none', 'stroke-width' => 1, 'stroke' => self::$c['color']['highlight']));
|
||||
$this->svg_dom->add_element('rect', array('x' => 1, 'y' => ($offset + 1), 'width' => ($this->i['graph_width'] - 2), 'height' => ($next_offset - $offset - 1)), $g2);
|
||||
}
|
||||
|
||||
$text = $type . (isset($component[1]) && substr($type, -1) != 'y' && substr($type, -1) != 's' ? 's' : null);
|
||||
$this->svg_dom->add_text_element($text, array('x' => ($this->i['graph_width'] - 4), 'y' => ($offset + 9), 'font-size' => 7, 'fill' => self::$c['color']['text'], 'text-anchor' => 'end'));
|
||||
$this->svg_dom->add_text_element($text, array('x' => ($this->i['graph_width'] - 4), 'y' => ($offset + 9)), $g4);
|
||||
$offset += 2;
|
||||
|
||||
foreach($component as $c)
|
||||
{
|
||||
$c = pts_result_file_analyzer::system_value_to_ir_value($c, $type);
|
||||
$this->svg_dom->add_text_element($c, array('x' => ($this->i['graph_width'] / 2), 'y' => ($offset + $component_header_height - 5), 'font-size' => $this->i['identifier_size'], 'fill' => self::$c['color']['text'], 'text-anchor' => 'middle', 'xlink:title' => $type . ': ' . $c, 'font-weight' => 'bold', 'xlink:href' => $c->get_attribute('href')));
|
||||
$this->svg_dom->add_text_element($c, array('x' => ($this->i['graph_width'] / 2), 'y' => ($offset + $component_header_height - 5), 'xlink:title' => $type . ': ' . $c, 'xlink:href' => $c->get_attribute('href')), $g3);
|
||||
$offset += $component_header_height;
|
||||
}
|
||||
|
||||
@@ -162,9 +168,10 @@ class pts_ResultFileCompactSystemsTable extends pts_graph_core
|
||||
if(defined('OPENBENCHMARKING_IDS'))
|
||||
{
|
||||
$back_width = $this->i['graph_width'] - 4;
|
||||
$this->svg_dom->add_text_element(OPENBENCHMARKING_TITLE, array('x' => $back_width, 'y' => ($this->i['graph_height'] - $bottom_footer + 12), 'font-size' => 8, 'fill' => self::$c['color']['background'], 'text-anchor' => 'end', 'font-weight' => 'bold', 'xlink:show' => 'new', 'xlink:href' => 'http://openbenchmarking.org/result/' . OPENBENCHMARKING_IDS));
|
||||
$this->svg_dom->add_text_element('System Logs', array('x' => $back_width, 'y' => ($this->i['graph_height'] - 20), 'font-size' => 8, 'fill' => self::$c['color']['background'], 'text-anchor' => 'end', 'xlink:show' => 'new', 'xlink:href' => 'http://openbenchmarking.org/system/' . OPENBENCHMARKING_IDS));
|
||||
$this->svg_dom->add_text_element('OPC Classification', array('x' => $back_width, 'y' => ($this->i['graph_height'] - 6), 'font-size' => 8, 'fill' => self::$c['color']['background'], 'text-anchor' => 'end', 'xlink:show' => 'new', 'xlink:href' => 'http://openbenchmarking.org/opc/' . OPENBENCHMARKING_IDS));
|
||||
$g_ob = $this->svg_dom->make_g(array('text-anchor' => 'end', 'fill' => self::$c['color']['background'], 'font-size' => 8));
|
||||
$this->svg_dom->add_text_element(OPENBENCHMARKING_TITLE, array('x' => $back_width, 'y' => ($this->i['graph_height'] - $bottom_footer + 12), 'font-weight' => 'bold', 'xlink:show' => 'new', 'xlink:href' => 'http://openbenchmarking.org/result/' . OPENBENCHMARKING_IDS), $g_ob);
|
||||
$this->svg_dom->add_text_element('System Logs', array('x' => $back_width, 'y' => ($this->i['graph_height'] - 20), 'xlink:show' => 'new', 'xlink:href' => 'http://openbenchmarking.org/system/' . OPENBENCHMARKING_IDS), $g_ob);
|
||||
$this->svg_dom->add_text_element('OPC Classification', array('x' => $back_width, 'y' => ($this->i['graph_height'] - 6), 'xlink:show' => 'new', 'xlink:href' => 'http://openbenchmarking.org/opc/' . OPENBENCHMARKING_IDS), $g_ob);
|
||||
}
|
||||
|
||||
if(!empty($this->i['notes']))
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2016, Phoronix Media
|
||||
Copyright (C) 2009 - 2016, Michael Larabel
|
||||
Copyright (C) 2009 - 2017, Phoronix Media
|
||||
Copyright (C) 2009 - 2017, Michael Larabel
|
||||
pts_ResultFileTable.php: The result file table object
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2016, Phoronix Media
|
||||
Copyright (C) 2009 - 2016, Michael Larabel
|
||||
Copyright (C) 2009 - 2017, Phoronix Media
|
||||
Copyright (C) 2009 - 2017, Michael Larabel
|
||||
pts_ResultFileTable.php: The result file table object
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2016, Phoronix Media
|
||||
Copyright (C) 2009 - 2016, Michael Larabel
|
||||
Copyright (C) 2009 - 2017, Phoronix Media
|
||||
Copyright (C) 2009 - 2017, Michael Larabel
|
||||
pts_Table.php: A charting table object for pts_Graph
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -208,7 +208,7 @@ class pts_Table extends pts_graph_core
|
||||
|
||||
// Write the rows
|
||||
$row = 1;
|
||||
$g = $this->svg_dom->make_g(array('font-size' => $this->i['identifier_size'], 'font-weight' => 'bold', 'text-anchor' => 'end', 'fill' => self::$c['color']['text']));
|
||||
$g = $this->svg_dom->make_g(array('font-size' => $this->i['identifier_size'], 'font-weight' => 'bold', 'fill' => self::$c['color']['text'], 'text-anchor' => 'end'));
|
||||
foreach($this->rows as $i => $row_string)
|
||||
{
|
||||
if(($row_string instanceof pts_graph_ir_value) == false)
|
||||
@@ -217,7 +217,7 @@ class pts_Table extends pts_graph_core
|
||||
}
|
||||
|
||||
$v = round($top_identifier_height + $this->i['top_heading_height'] + ($row * $table_line_height) - 4);
|
||||
$r = array('x' => ($this->i['left_start'] - 2), 'y' => $v, 'fill' => self::$c['color']['text'], 'xlink:href' => $row_string->get_attribute('href'));
|
||||
$r = array('x' => ($this->i['left_start'] - 2), 'y' => $v, 'xlink:href' => $row_string->get_attribute('href'));
|
||||
if($row_string->get_attribute('alert'))
|
||||
{
|
||||
$r['fill'] = self::$c['color']['alert'];
|
||||
@@ -296,15 +296,15 @@ class pts_Table extends pts_graph_core
|
||||
}
|
||||
else
|
||||
{
|
||||
$x = $this->i['left_start'] + ($i * $table_item_width) + ($table_item_width / 2);
|
||||
$y = $this->i['top_heading_height'] + ($top_identifier_height / 2);
|
||||
$x = round($this->i['left_start'] + ($i * $table_item_width) + ($table_item_width / 2));
|
||||
$y = round($this->i['top_heading_height'] + ($top_identifier_height / 2));
|
||||
$this->svg_dom->add_text_element($col_string, array('x' => $x, 'y' => $y), $g);
|
||||
}
|
||||
}
|
||||
|
||||
// Write the columns
|
||||
$g_background = $this->svg_dom->make_g(array());
|
||||
$g = $this->svg_dom->make_g(array('text-anchor' => 'middle', 'font-size' => $this->i['identifier_size']));
|
||||
$g_background = $this->svg_dom->make_g(array('fill' => self::$c['color']['body']));
|
||||
$g = $this->svg_dom->make_g(array('text-anchor' => 'middle', 'font-size' => $this->i['identifier_size'], 'fill' => self::$c['color']['text']));
|
||||
foreach($this->table_data as $index => &$table_values)
|
||||
{
|
||||
if(!is_array($table_values))
|
||||
@@ -334,7 +334,7 @@ class pts_Table extends pts_graph_core
|
||||
{
|
||||
$row = $i - 1; // if using $row, the alignment may be off sometimes
|
||||
$hover = array();
|
||||
$text_color = self::$c['color']['text'];
|
||||
$text_color = null;
|
||||
$bold = false;
|
||||
|
||||
if($result_table_value == null)
|
||||
@@ -391,12 +391,23 @@ class pts_Table extends pts_graph_core
|
||||
$background_paint = $i % 2 == 0 ? self::$c['color']['body_light'] : self::$c['color']['body'];
|
||||
}
|
||||
|
||||
$y = round($this->i['top_heading_height'] + $top_identifier_height + (($row + 1) * $table_line_height));
|
||||
$this->svg_dom->add_element('rect', array('x' => $left_bounds, 'y' => $y + 1, 'width' => ($right_bounds - $left_bounds), 'height' => $table_line_height, 'fill' => $background_paint), $g_background);
|
||||
$gbr = array('x' => $left_bounds, 'y' => round($this->i['top_heading_height'] + $top_identifier_height + (($row + 1) * $table_line_height)) + 1, 'width' => ($right_bounds - $left_bounds), 'height' => $table_line_height);
|
||||
|
||||
if(self::$c['color']['body'] != $background_paint)
|
||||
{
|
||||
$gbr['fill'] = $background_paint;
|
||||
}
|
||||
|
||||
$this->svg_dom->add_element('rect', $gbr, $g_background);
|
||||
}
|
||||
|
||||
$x = $left_bounds + (($right_bounds - $left_bounds) / 2);
|
||||
$this->svg_dom->add_text_element($result_table_value, array('x' => $x, 'y' => round($this->i['top_heading_height'] + $top_identifier_height + (($row + 2) * $table_line_height) - 3), 'fill' => $text_color, 'xlink:title' => implode('; ', $hover), 'xlink:href' => $result_table_value->get_attribute('href')), $g);
|
||||
$x = round($left_bounds + (($right_bounds - $left_bounds) / 2));
|
||||
$gbr = array('x' => $x, 'y' => round($this->i['top_heading_height'] + $top_identifier_height + (($row + 2) * $table_line_height) - 3), 'xlink:title' => implode('; ', $hover), 'xlink:href' => $result_table_value->get_attribute('href'));
|
||||
if($text_color != null)
|
||||
{
|
||||
$gbr['fill'] = $text_color;
|
||||
}
|
||||
$this->svg_dom->add_text_element($result_table_value, $gbr, $g);
|
||||
//$row++;
|
||||
}
|
||||
}
|
||||
@@ -418,18 +429,17 @@ class pts_Table extends pts_graph_core
|
||||
{
|
||||
$estimated_height = 0;
|
||||
$previous_section = null;
|
||||
$g = $this->svg_dom->make_g(array('fill' => self::$c['color']['background'], 'text-anchor' => 'start'));
|
||||
foreach($this->i['notes'] as $i => $note_r)
|
||||
{
|
||||
if($note_r['section'] != null && $note_r['section'] !== $previous_section)
|
||||
{
|
||||
$estimated_height += 2;
|
||||
$this->svg_dom->add_textarea_element($note_r['section'] . ' Details', array('x' => 6, 'y' => ($table_proper_height + $table_line_height + $estimated_height), 'xlink:title' => $note_r['hover-title'], 'style' => 'font-weight: bold', 'fill' => self::$c['color']['background'], 'font-size' => (self::$c['size']['key'] - 1)), $estimated_height, $g);
|
||||
$this->svg_dom->add_textarea_element($note_r['section'] . ' Details', array('x' => 6, 'y' => ($table_proper_height + $table_line_height + $estimated_height), 'xlink:title' => $note_r['hover-title'], 'style' => 'font-weight: bold', 'text-anchor' => 'start', 'fill' => self::$c['color']['background'], 'font-size' => (self::$c['size']['key'] - 1)), $estimated_height);
|
||||
$estimated_height += 2;
|
||||
$previous_section = $note_r['section'];
|
||||
}
|
||||
|
||||
$this->svg_dom->add_textarea_element('- ' . $note_r['note'], array('x' => 6, 'y' => ($table_proper_height + $table_line_height + $estimated_height), 'xlink:title' => $note_r['hover-title'], 'fill' => self::$c['color']['background'], 'font-size' => (self::$c['size']['key'] - 1)), $estimated_height, $g);
|
||||
$this->svg_dom->add_textarea_element('- ' . $note_r['note'], array('x' => 6, 'y' => ($table_proper_height + $table_line_height + $estimated_height), 'xlink:title' => $note_r['hover-title'], 'text-anchor' => 'start', 'fill' => self::$c['color']['background'], 'font-size' => (self::$c['size']['key'] - 1)), $estimated_height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, 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
|
||||
@@ -32,7 +32,11 @@ class pts_graph_box_plot extends pts_graph_horizontal_bars
|
||||
|
||||
$group_offsets = array();
|
||||
$id_offsets = array();
|
||||
$g_lines = $this->svg_dom->make_g(array('stroke' => self::$c['color']['body_light'], 'stroke-width' => 2));
|
||||
$g_bars = $this->svg_dom->make_g(array('stroke' => self::$c['color']['body_light'], 'stroke-width' => 1));
|
||||
$g_overtop = $this->svg_dom->make_g(array('stroke' => self::$c['color']['headers'], 'stroke-width' => 1));
|
||||
$g_text = $this->svg_dom->make_g(array('font-size' => ($this->i['identifier_size'] - 2), 'fill' => self::$c['color']['text'], 'text-anchor' => 'end'));
|
||||
$g_circles = $this->svg_dom->make_g(array('fill' => self::$c['color']['headers']));
|
||||
|
||||
foreach($this->results as $identifier => &$group)
|
||||
{
|
||||
@@ -93,7 +97,8 @@ class pts_graph_box_plot extends pts_graph_horizontal_bars
|
||||
$max_value = round(max($unique_values), 2);
|
||||
|
||||
$stat_value = 'Min: ' . $min_value . ' / Avg: ' . $avg_value . ' / Max: ' . $max_value;
|
||||
$title_tooltip = $buffer_item->get_result_identifier() . ': ' . $stat_value;
|
||||
$title_tooltip = $stat_value;
|
||||
//$title_tooltip = $buffer_item->get_result_identifier() . ': ' . $stat_value;
|
||||
|
||||
$value_end_left = $this->i['left_start'] + max(1, round(($whisker_bottom / $this->i['graph_max_value']) * $work_area_width));
|
||||
$value_end_right = $this->i['left_start'] + round(($whisker_top / $this->i['graph_max_value']) * $work_area_width);
|
||||
@@ -110,24 +115,24 @@ class pts_graph_box_plot extends pts_graph_horizontal_bars
|
||||
|
||||
$box_color = in_array($buffer_item->get_result_identifier(), $this->value_highlights) ? $this->darken_color($box_color) : $box_color;
|
||||
|
||||
$this->svg_dom->draw_svg_line($value_end_left, $middle_of_bar, $value_end_right, $middle_of_bar, $box_color, 2, array('xlink:title' => $title_tooltip));
|
||||
$this->svg_dom->draw_svg_line($value_end_left, $px_bound_top, $value_end_left, $px_bound_bottom, self::$c['color']['notches'], 2, array('xlink:title' => $title_tooltip));
|
||||
$this->svg_dom->draw_svg_line($value_end_right, $px_bound_top, $value_end_right, $px_bound_bottom, self::$c['color']['notches'], 2, array('xlink:title' => $title_tooltip));
|
||||
$this->svg_dom->add_element('line', array('x1' => $value_end_left, 'y1' => $middle_of_bar, 'x2' => $value_end_right, 'y2' => $middle_of_bar), $g_lines);
|
||||
$this->svg_dom->add_element('line', array('x1' => $value_end_left, 'y1' => $px_bound_top, 'x2' => $value_end_left, 'y2' => $px_bound_bottom), $g_lines);
|
||||
$this->svg_dom->add_element('line', array('x1' => $value_end_right, 'y1' => $px_bound_top, 'x2' => $value_end_right, 'y2' => $px_bound_bottom), $g_lines);
|
||||
|
||||
$box_left = $this->i['left_start'] + round((pts_math::find_percentile($values, 0.25) / $this->i['graph_max_value']) * $work_area_width);
|
||||
$box_middle = $this->i['left_start'] + round(($median / $this->i['graph_max_value']) * $work_area_width);
|
||||
$box_right = $this->i['left_start'] + round((pts_math::find_percentile($values, 0.75) / $this->i['graph_max_value']) * $work_area_width);
|
||||
|
||||
$this->svg_dom->add_element('rect', array('x' => $box_left, 'y' => $px_bound_top, 'width' => ($box_right - $box_left), 'height' => $bar_height, 'fill' => $box_color, 'xlink:title' => $title_tooltip), $g_bars);
|
||||
$this->svg_dom->draw_svg_line($box_middle, $px_bound_top, $box_middle, $px_bound_bottom, self::$c['color']['notches'], 2, array('xlink:title' => $title_tooltip));
|
||||
$this->svg_dom->add_element('line', array('x1' => $box_middle, 'y1' => $px_bound_top, 'x2' => $box_middle, 'y2' => $px_bound_bottom), $g_overtop);
|
||||
|
||||
$this->svg_dom->add_text_element($stat_value, array('x' => ($this->i['left_start'] - 5), 'y' => ceil($px_bound_top + ($bar_height * 0.8) + 6), 'font-size' => ($this->i['identifier_size'] - 2), 'fill' => self::$c['color']['text'], 'text-anchor' => 'end'));
|
||||
$this->svg_dom->add_text_element($stat_value, array('x' => ($this->i['left_start'] - 5), 'y' => ceil($px_bound_top + ($bar_height * 0.8) + 6)), $g_text);
|
||||
|
||||
foreach($unique_values as &$val)
|
||||
{
|
||||
if(($val < $whisker_bottom || $val > $whisker_top) && $val > 0.1)
|
||||
{
|
||||
$this->svg_dom->draw_svg_circle($this->i['left_start'] + round(($val / $this->i['graph_max_value']) * $work_area_width), $middle_of_bar, 1, self::$c['color']['notches']);
|
||||
$this->svg_dom->add_element('circle', array('cx' => $this->i['left_start'] + round(($val / $this->i['graph_max_value']) * $work_area_width), 'cy' => $middle_of_bar, 'r' => 1), $g_circles);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, Michael Larabel
|
||||
pho_graph.php: The core graph object that is used by the different graphing objects.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -71,6 +71,7 @@ abstract class pts_graph_core
|
||||
$this->i['top_end_bottom'] = 22;
|
||||
$this->i['mark_count'] = 6; // Number of marks to make on vertical axis
|
||||
$this->i['multi_way_comparison_invert_default'] = true;
|
||||
$this->i['support_color_branding'] = true;
|
||||
$this->i['notes'] = array();
|
||||
|
||||
// Reset of setup besides config
|
||||
@@ -129,6 +130,10 @@ abstract class pts_graph_core
|
||||
{
|
||||
$this->i['multi_way_comparison_invert_default'] = $extra_attributes['multi_way_comparison_invert_default'];
|
||||
}
|
||||
if(isset($extra_attributes['no_color_branding']))
|
||||
{
|
||||
$this->i['support_color_branding'] = false;
|
||||
}
|
||||
|
||||
$this->test_result = &$result_object;
|
||||
|
||||
@@ -384,17 +389,22 @@ abstract class pts_graph_core
|
||||
}
|
||||
protected function identifier_to_branded_color($identifier, $fallback_color = null)
|
||||
{
|
||||
if($this->i['support_color_branding'] == false || !isset($identifier[6]))
|
||||
{
|
||||
return $fallback_color;
|
||||
}
|
||||
|
||||
// See if the result identifier matches something to be color-coded better
|
||||
$identifier = strtolower($identifier) . ' ';
|
||||
if(strpos($identifier, 'geforce') !== false || strpos($identifier, 'nvidia') !== false || strpos($identifier, 'quadro') !== false)
|
||||
{
|
||||
$paint_color = '#77b900';
|
||||
}
|
||||
else if(strpos($identifier, 'radeon') !== false || strpos($identifier, 'amd ') !== false || strpos($identifier, 'opteron ') !== false || strpos($identifier, 'fx-') !== false || strpos($identifier, 'firepro ') !== false)
|
||||
else if(strpos($identifier, 'radeon') !== false || strpos($identifier, 'amd ') !== false || strpos($identifier, 'a10-') !== false || strpos($identifier, 'opteron ') !== false || strpos($identifier, 'fx-') !== false || strpos($identifier, 'firepro ') !== false || strpos($identifier, 'ryzen ') !== false)
|
||||
{
|
||||
$paint_color = '#f1052d';
|
||||
}
|
||||
else if(strpos($identifier, 'intel ') !== false || strpos($identifier, 'xeon ') !== false || strpos($identifier, 'core i') !== false || strpos($identifier, 'celeron') !== false)
|
||||
else if(strpos($identifier, 'intel ') !== false || strpos($identifier, 'xeon ') !== false || strpos($identifier, 'core i') !== false || strpos($identifier, 'pentium') !== false || strpos($identifier, 'celeron') !== false)
|
||||
{
|
||||
$paint_color = '#0b5997';
|
||||
}
|
||||
@@ -484,7 +494,7 @@ abstract class pts_graph_core
|
||||
}
|
||||
else
|
||||
{
|
||||
$longest_identifier_width = self::text_string_width($longest_identifier, $this->i['identifier_size']) + 8;
|
||||
$longest_identifier_width = ceil(self::text_string_width($longest_identifier, $this->i['identifier_size']) * 1.065) + 10;
|
||||
}
|
||||
|
||||
$longest_identifier_max = ($this->i['graph_width'] * 0.5) + 0.01;
|
||||
@@ -525,9 +535,15 @@ abstract class pts_graph_core
|
||||
{
|
||||
$longest_string = explode(' - ', $longest_identifier);
|
||||
$longest_string = pts_strings::find_longest_string($longest_string);
|
||||
|
||||
$rotated_text = round(self::text_string_width($longest_string, $this->i['identifier_size']) * 0.96);
|
||||
$per_identifier_height = max((14 + (14 * count($this->results))), $rotated_text);
|
||||
$per_identifier_height = 26; // default
|
||||
|
||||
if(ceil($rotated_text * 1.25) >= floor($per_identifier_height * count($this->results)))
|
||||
{
|
||||
// this is to avoid having a rotated text bar overrun other results
|
||||
// XXX the 50 number might be too hacky
|
||||
$per_identifier_height = max(54, ceil($rotated_text / count($this->results) * 1.1));
|
||||
}
|
||||
}
|
||||
else if(count($this->results) > 3)
|
||||
{
|
||||
@@ -557,8 +573,7 @@ abstract class pts_graph_core
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$num_identifiers = $this->test_result->test_result_buffer->get_count();
|
||||
$num_identifiers = $this->test_result->test_result_buffer->get_count() + ($this->is_multi_way_comparison ? 2 : 0);
|
||||
$this->i['graph_top_end'] = $this->i['top_start'] + ($num_identifiers * $per_identifier_height);
|
||||
// $this->i['top_end_bottom']
|
||||
$this->i['graph_height'] = $this->i['graph_top_end'] + 25 + $bottom_heading;
|
||||
@@ -640,7 +655,7 @@ abstract class pts_graph_core
|
||||
}
|
||||
}
|
||||
|
||||
$this->svg_dom->add_text_element($this->graph_title, array('x' => 6, 'y' => (self::$c['size']['headers'] + 2), 'font-size' => self::$c['size']['headers'], 'fill' => self::$c['color']['background'], 'text-anchor' => 'start', 'xlink:show' => 'new', 'xlink:href' => $href));
|
||||
$this->svg_dom->add_text_element($this->graph_title, array('x' => 6, 'y' => (self::$c['size']['headers'] + 2), 'font-size' => self::$c['size']['headers'], 'fill' => self::$c['color']['background'], 'text-anchor' => 'start', 'xlink:show' => 'new', 'xlink:href' => $href, 'font-weight' => 'bold'));
|
||||
|
||||
foreach($this->graph_sub_titles as $i => $sub_title)
|
||||
{
|
||||
@@ -651,7 +666,7 @@ abstract class pts_graph_core
|
||||
while(self::text_string_width($sub_title, $sub_title_size) > ($this->i['graph_left_end'] - 20))
|
||||
$sub_title_size -= 0.5;
|
||||
}
|
||||
$this->svg_dom->add_text_element($sub_title, array('x' => 6, 'y' => $vertical_offset, 'font-size' => $sub_title_size, 'fill' => self::$c['color']['background'], 'text-anchor' => 'start'));
|
||||
$this->svg_dom->add_text_element($sub_title, array('x' => 6, 'y' => $vertical_offset, 'font-size' => $sub_title_size, 'font-weight' => 'bold', 'fill' => self::$c['color']['background'], 'text-anchor' => 'start'));
|
||||
}
|
||||
|
||||
// SVG version of PTS thanks to https://gist.github.com/xorgy/65c6d0e87757dbb56a75
|
||||
@@ -706,12 +721,12 @@ abstract class pts_graph_core
|
||||
if($this->i['graph_orientation'] == 'HORIZONTAL' || $this->i['iveland_view'])
|
||||
{
|
||||
$g = $this->svg_dom->make_g(array('stroke' => self::$c['color']['notches'], 'stroke-width' => 1));
|
||||
$this->svg_dom->add_element('line', array('x1' => ($left_start + 0.5), 'y1' => $top_start, 'x2' => ($left_start + 0.5), 'y2' => ($top_end + 1)), $g);
|
||||
$this->svg_dom->add_element('line', array('x1' => $left_start, 'y1' => ($top_end + 0.5), 'x2' => ($left_end + 1), 'y2' => ($top_end + 0.5)), $g);
|
||||
$this->svg_dom->add_element('line', array('x1' => $left_start, 'y1' => $top_start, 'x2' => $left_start, 'y2' => ($top_end + 1)), $g);
|
||||
$this->svg_dom->add_element('line', array('x1' => $left_start, 'y1' => $top_end, 'x2' => ($left_end + 1), 'y2' => $top_end), $g);
|
||||
|
||||
if(!empty(self::$c['text']['watermark']))
|
||||
{
|
||||
$this->svg_dom->add_text_element(self::$c['text']['watermark'], array('x' => $left_end, 'y' => ($top_start - 5), 'font-size' => 7, 'fill' => self::$c['color']['text'], 'text-anchor' => 'end', 'xlink:show' => 'new', 'xlink:href' => self::$c['text']['watermark_url']));
|
||||
$this->svg_dom->add_text_element(self::$c['text']['watermark'], array('x' => $left_end, 'y' => ($top_start - 5), 'font-size' => 8, 'fill' => self::$c['color']['text'], 'text-anchor' => 'end', 'xlink:show' => 'new', 'xlink:href' => self::$c['text']['watermark_url']));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -772,7 +787,7 @@ abstract class pts_graph_core
|
||||
}
|
||||
}
|
||||
|
||||
$this->svg_dom->add_text_element($str, array('x' => ($left_start + $offset), 'y' => ($top_start - 5), 'font-size' => 7, 'fill' => self::$c['color']['text'], 'text-anchor' => 'start'));
|
||||
$this->svg_dom->add_text_element($str, array('x' => ($left_start + $offset), 'y' => ($top_start - 5), 'font-size' => 8, 'fill' => self::$c['color']['text'], 'text-anchor' => 'start'));
|
||||
}
|
||||
}
|
||||
protected function render_graph_value_ticks($left_start, $top_start, $left_end, $top_end, $show_numbers = true)
|
||||
@@ -792,9 +807,9 @@ abstract class pts_graph_core
|
||||
|
||||
if($i != 0)
|
||||
{
|
||||
$show_numbers && $this->svg_dom->add_text_element($display_value, array('x' => $px_from_left + 2.5, 'y' => ($top_end + 5 + self::$c['size']['tick_mark'])), $g);
|
||||
$this->svg_dom->add_element('line', array('x1' => ($px_from_left + 2.5), 'y1' => ($top_start), 'x2' => ($px_from_left + 2.5), 'y2' => ($top_end - 5), 'stroke-dasharray' => '5,5'), $g_lines);
|
||||
$this->svg_dom->add_element('line', array('x1' => ($px_from_left + 2.5), 'y1' => ($top_end - 4), 'x2' => ($px_from_left + 2.5), 'y2' => ($top_end + 5)), $g_lines);
|
||||
$show_numbers && $this->svg_dom->add_text_element($display_value, array('x' => $px_from_left + 2, 'y' => ($top_end + 5 + self::$c['size']['tick_mark'])), $g);
|
||||
$this->svg_dom->add_element('line', array('x1' => ($px_from_left + 2), 'y1' => ($top_start), 'x2' => ($px_from_left + 2), 'y2' => ($top_end - 5), 'stroke-dasharray' => '5,5'), $g_lines);
|
||||
$this->svg_dom->add_element('line', array('x1' => ($px_from_left + 2), 'y1' => ($top_end - 4), 'x2' => ($px_from_left + 2), 'y2' => ($top_end + 5)), $g_lines);
|
||||
}
|
||||
|
||||
$display_value += $increment;
|
||||
@@ -819,15 +834,15 @@ abstract class pts_graph_core
|
||||
|
||||
if($i != 0)
|
||||
{
|
||||
$show_numbers && $this->svg_dom->add_text_element($display_value, array('x' => ($px_from_left_start - 4), 'y' => round($px_from_top + (self::$c['size']['tick_mark'] / 2)) + 0.5), $g_text);
|
||||
$show_numbers && $this->svg_dom->add_text_element($display_value, array('x' => ($px_from_left_start - 4), 'y' => round($px_from_top + (self::$c['size']['tick_mark'] / 2))), $g_text);
|
||||
|
||||
if($this->i['show_background_lines'])
|
||||
{
|
||||
$this->svg_dom->add_element('line', array('x1' => ($px_from_left_end + 6), 'y1' => ($px_from_top + 1.5), 'x2' => ($this->i['graph_left_end']), 'y2' => ($px_from_top + 1.5)), $g_background_lines);
|
||||
$this->svg_dom->add_element('line', array('x1' => ($px_from_left_end + 6), 'y1' => ($px_from_top + 1), 'x2' => ($this->i['graph_left_end']), 'y2' => ($px_from_top + 1)), $g_background_lines);
|
||||
}
|
||||
|
||||
$this->svg_dom->add_element('line', array('x1' => ($left_start), 'y1' => ($px_from_top + 1.5), 'x2' => ($left_end), 'y2' => ($px_from_top + 1.5)), $g_lines);
|
||||
$this->svg_dom->add_element('line', array('x1' => ($left_start - 4), 'y1' => ($px_from_top + 1.5), 'x2' => ($left_start + 4), 'y2' => ($px_from_top + 1.5)), $g_lines_2);
|
||||
$this->svg_dom->add_element('line', array('x1' => ($left_start), 'y1' => ($px_from_top + 1), 'x2' => ($left_end), 'y2' => ($px_from_top + 1)), $g_lines);
|
||||
$this->svg_dom->add_element('line', array('x1' => ($left_start - 4), 'y1' => ($px_from_top + 1), 'x2' => ($left_start + 4), 'y2' => ($px_from_top + 1)), $g_lines_2);
|
||||
}
|
||||
|
||||
$display_value += $increment;
|
||||
@@ -851,7 +866,7 @@ abstract class pts_graph_core
|
||||
|
||||
$this->i['key_line_height'] = 16;
|
||||
$ak = array_keys($this->results);
|
||||
$this->i['key_item_width'] = 16 + self::text_string_width(pts_strings::find_longest_string($ak), self::$c['size']['key']);
|
||||
$this->i['key_item_width'] = 20 + self::text_string_width(pts_strings::find_longest_string($ak), self::$c['size']['key']);
|
||||
$this->i['keys_per_line'] = max(1, floor(($this->i['graph_left_end'] - $this->i['left_start']) / $this->i['key_item_width']));
|
||||
|
||||
return ceil(count($this->results) / $this->i['keys_per_line']) * $this->i['key_line_height'];
|
||||
@@ -867,7 +882,7 @@ abstract class pts_graph_core
|
||||
|
||||
$i = 0;
|
||||
$g_rect = $this->svg_dom->make_g(array('stroke' => self::$c['color']['notches'], 'stroke-width' => 1));
|
||||
$g_text = $this->svg_dom->make_g(array('font-size' => self::$c['size']['key'], 'text-anchor' => 'start'));
|
||||
$g_text = $this->svg_dom->make_g(array('font-size' => self::$c['size']['key'], 'text-anchor' => 'start', 'font-weight' => 'bold'));
|
||||
|
||||
if(!is_array($this->results))
|
||||
{
|
||||
@@ -916,9 +931,9 @@ abstract class pts_graph_core
|
||||
$arrow_length_half = $arrow_length / 2;
|
||||
|
||||
$arrow_points = array(
|
||||
$tip_x1 + 0.5 . ',' . $tip_y1,
|
||||
$tail_x1 + 0.5 . ',' . ($tail_y1 + $arrow_length_half),
|
||||
$tail_x1 + 0.5. ',' . ($tail_y1 - $arrow_length_half)
|
||||
$tip_x1 . ',' . $tip_y1,
|
||||
$tail_x1 . ',' . ($tail_y1 + $arrow_length_half),
|
||||
$tail_x1 . ',' . ($tail_y1 - $arrow_length_half)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, Michael Larabel
|
||||
pts_HorizontalBarGraph.php: The horizontal bar graph object that extends pts_Graph.php
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -43,11 +43,13 @@ class pts_graph_horizontal_bars extends pts_graph_core
|
||||
protected function render_graph_identifiers()
|
||||
{
|
||||
$px_from_top_end = $this->i['graph_top_end'] + 5;
|
||||
if(count($this->graph_identifiers) > 1)
|
||||
{
|
||||
$this->svg_dom->draw_svg_line($this->i['left_start'], $this->i['top_start'] + $this->i['identifier_height'], $this->i['left_start'], $this->i['graph_top_end'] - ($this->i['graph_height'] % $this->i['identifier_height']), self::$c['color']['notches'], 11, array('stroke-dasharray' => 1 . ',' . ($this->i['identifier_height'] - 1)));
|
||||
}
|
||||
$middle_of_vert = round($this->i['top_start'] + ($this->is_multi_way_comparison ? 5 : 0) - ($this->i['identifier_height'] * 0.5) - 2);
|
||||
|
||||
$this->svg_dom->draw_svg_line($this->i['left_start'] + 0.5, $this->i['top_start'] + $this->i['identifier_height'], $this->i['left_start'] + 0.5, $this->i['graph_top_end'] - ($this->i['graph_height'] % $this->i['identifier_height']), self::$c['color']['notches'], 11, array('stroke-dasharray' => 1 . ',' . ($this->i['identifier_height'] - 1)));
|
||||
$middle_of_vert = $this->i['top_start'] + ($this->is_multi_way_comparison ? 5 : 0) - ($this->i['identifier_height'] * 0.5) - 2;
|
||||
|
||||
$g = $this->svg_dom->make_g(array('font-size' => $this->i['identifier_size'], 'fill' => self::$c['color']['headers']));
|
||||
$g = $this->svg_dom->make_g(array('font-size' => $this->i['identifier_size'], 'fill' => self::$c['color']['headers'], 'font-weight' => 'bold'));
|
||||
foreach($this->graph_identifiers as $identifier)
|
||||
{
|
||||
$middle_of_vert += $this->i['identifier_height'];
|
||||
@@ -94,8 +96,10 @@ class pts_graph_horizontal_bars extends pts_graph_core
|
||||
$id_offsets = array();
|
||||
$g_bars = $this->svg_dom->make_g(array('stroke' => self::$c['color']['body_light'], 'stroke-width' => 1));
|
||||
$g_se = $this->svg_dom->make_g(array('font-size' => ($this->i['identifier_size'] - 2), 'fill' => self::$c['color']['text'], 'text-anchor' => 'end'));
|
||||
$g_values = $this->svg_dom->make_g(array('font-size' => $this->i['identifier_size'], 'fill' => self::$c['color']['body_text']));
|
||||
$bar_x = $this->i['left_start'] + 0.5;
|
||||
$g_values = $this->svg_dom->make_g(array('font-size' => $this->i['identifier_size'], 'fill' => self::$c['color']['body_text'], 'font-weight' => 'bold', 'text-anchor' => 'end'));
|
||||
$g_note = null;
|
||||
$g_identifier_note = null;
|
||||
|
||||
foreach($this->results as $identifier => &$group)
|
||||
{
|
||||
$paint_color = $this->get_paint_color($identifier);
|
||||
@@ -120,7 +124,7 @@ class pts_graph_horizontal_bars extends pts_graph_core
|
||||
$value_end_right = max($this->i['left_start'] + $graph_size, 1);
|
||||
$px_bound_top = $this->i['top_start'] + ($this->is_multi_way_comparison ? 5 : 0) + ($this->i['identifier_height'] * $i) + ($bar_height * $i_o) + ($separator_height * ($i_o + 1));
|
||||
$px_bound_bottom = $px_bound_top + $bar_height;
|
||||
$middle_of_bar = $px_bound_top + ($bar_height / 2) + ($this->i['identifier_size'] - 4);
|
||||
$middle_of_bar = round($px_bound_top + ($bar_height / 2) + ($this->i['identifier_size'] - 4));
|
||||
$title_tooltip = $buffer_item->get_result_identifier() . ': ' . $value;
|
||||
|
||||
$std_error = -1;
|
||||
@@ -142,9 +146,9 @@ class pts_graph_horizontal_bars extends pts_graph_core
|
||||
}
|
||||
}
|
||||
|
||||
$this->svg_dom->add_element('rect', array('x' => $bar_x, 'y' => $px_bound_top + 0.5, 'height' => $bar_height, 'width' => $graph_size, 'fill' => (in_array($buffer_item->get_result_identifier(), $this->value_highlights) ? $this->darken_color($paint_color) : $paint_color), 'xlink:title' => $title_tooltip), $g_bars);
|
||||
$this->svg_dom->add_element('rect', array('x' => $this->i['left_start'], 'y' => $px_bound_top, 'height' => $bar_height, 'width' => $graph_size, 'fill' => (in_array($buffer_item->get_result_identifier(), $this->value_highlights) ? $this->darken_color($paint_color) : $paint_color), 'xlink:title' => $title_tooltip), $g_bars);
|
||||
|
||||
if($std_error != -1 && $value != null)
|
||||
if($std_error != -1 && $std_error > 0 && $value != null)
|
||||
{
|
||||
$std_error_height = 8;
|
||||
if($std_error > 0 && is_numeric($std_error))
|
||||
@@ -152,11 +156,13 @@ class pts_graph_horizontal_bars extends pts_graph_core
|
||||
$std_error_rel_size = round(($std_error / $this->i['graph_max_value']) * ($this->i['graph_left_end'] - $this->i['left_start']));
|
||||
if($std_error_rel_size > 4)
|
||||
{
|
||||
$std_error_base_left = ($value_end_right - $std_error_rel_size) + 0.5;
|
||||
$std_error_base_right = ($value_end_right + $std_error_rel_size) + 0.5;
|
||||
$this->svg_dom->draw_svg_line($std_error_base_left, $px_bound_top, $std_error_base_left, $px_bound_top + $std_error_height, self::$c['color']['notches'], 1);
|
||||
$this->svg_dom->draw_svg_line($std_error_base_right, $px_bound_top, $std_error_base_right, $px_bound_top + $std_error_height, self::$c['color']['notches'], 1);
|
||||
$this->svg_dom->draw_svg_line($std_error_base_left, $px_bound_top + 0.5, $std_error_base_right, $px_bound_top + 0.5, self::$c['color']['notches'], 1);
|
||||
$std_error_base_left = ($value_end_right - $std_error_rel_size);
|
||||
$std_error_base_right = ($value_end_right + $std_error_rel_size);
|
||||
|
||||
$g = $this->svg_dom->make_g(array('stroke' => self::$c['color']['notches'], 'stroke-width' => 1));
|
||||
$this->svg_dom->add_element('line', array('x1' => $std_error_base_left, 'y1' => $px_bound_top, 'x2' => $std_error_base_left, 'y2' => $px_bound_top + $std_error_height), $g);
|
||||
$this->svg_dom->add_element('line', array('x1' => $std_error_base_right, 'y1' => $px_bound_top, 'x2' => $std_error_base_right, 'y2' => $px_bound_top + $std_error_height), $g);
|
||||
$this->svg_dom->add_element('line', array('x1' => $std_error_base_left, 'y1' => $px_bound_top, 'x2' => $std_error_base_right, 'y2' => $px_bound_top), $g);
|
||||
}
|
||||
}
|
||||
$bar_offset_34 = round($middle_of_bar + ($this->is_multi_way_comparison ? 0 : ($bar_height / 5) + 1));
|
||||
@@ -167,12 +173,15 @@ class pts_graph_horizontal_bars extends pts_graph_core
|
||||
{
|
||||
if(isset($this->d['identifier_notes'][$buffer_item->get_result_identifier()]) && $this->i['compact_result_view'] == false && !$this->is_multi_way_comparison)
|
||||
{
|
||||
$note_size = self::$c['size']['key'] - 2;
|
||||
$this->svg_dom->add_text_element($this->d['identifier_notes'][$buffer_item->get_result_identifier()], array('x' => ($this->i['left_start'] + 4), 'y' => ($px_bound_top + self::$c['size']['key']), 'font-size' => $note_size, 'fill' => self::$c['color']['body_text'], 'text-anchor' => 'start'));
|
||||
if($g_identifier_note == null)
|
||||
{
|
||||
$g_identifier_note = $this->svg_dom->make_g(array('font-size' => (self::$c['size']['key'] - 2), 'fill' => self::$c['color']['body_text'], 'text-anchor' => 'start'));
|
||||
}
|
||||
$this->svg_dom->add_text_element($this->d['identifier_notes'][$buffer_item->get_result_identifier()], array('x' => ($this->i['left_start'] + 4), 'y' => ($px_bound_top + self::$c['size']['key'])), $g_identifier_note);
|
||||
}
|
||||
else
|
||||
{
|
||||
// XXX this code can potentially replace the above identifier_notes stuff
|
||||
// TODO XXX this code can potentially replace the above identifier_notes stuff
|
||||
$data = $buffer_item->get_result_json();
|
||||
$note = null;
|
||||
if(isset($data['min-result']) && is_numeric($data['min-result']))
|
||||
@@ -189,13 +198,15 @@ class pts_graph_horizontal_bars extends pts_graph_core
|
||||
|
||||
if(!empty($note))
|
||||
{
|
||||
$note_size = self::$c['size']['key'] - 2;
|
||||
$this->svg_dom->add_text_element($note, array('x' => ($this->i['left_start'] + 4), 'y' => ($px_bound_top + self::$c['size']['key']), 'font-size' => $note_size, 'fill' => self::$c['color']['body_text'], 'text-anchor' => 'start'));
|
||||
|
||||
if($g_note == null)
|
||||
{
|
||||
$g_note = $this->svg_dom->make_g(array('font-size' => (self::$c['size']['key'] - 2), 'fill' => self::$c['color']['body_text'], 'text-anchor' => 'start', 'font-weight' => 'bold'));
|
||||
}
|
||||
$this->svg_dom->add_text_element($note, array('x' => ($this->i['left_start'] + 4), 'y' => ($px_bound_top + self::$c['size']['key'])), $g_note);
|
||||
}
|
||||
}
|
||||
|
||||
$this->svg_dom->add_text_element($value, array('x' => ($value_end_right - 5), 'y' => $middle_of_bar, 'text-anchor' => 'end'), $g_values);
|
||||
$this->svg_dom->add_text_element($value, array('x' => ($value_end_right - 5), 'y' => $middle_of_bar), $g_values);
|
||||
}
|
||||
else if($value > 0)
|
||||
{
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2012 - 2016, Phoronix Media
|
||||
Copyright (C) 2012 - 2016, Michael Larabel
|
||||
Copyright (C) 2012 - 2017, Phoronix Media
|
||||
Copyright (C) 2012 - 2017, 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
|
||||
@@ -30,15 +30,19 @@ class pts_exdep_generic_parser
|
||||
|
||||
if(PTS_IS_CLIENT)
|
||||
{
|
||||
$xml_parser = new nye_XmlReader(PTS_EXDEP_PATH . 'xml/generic-packages.xml');
|
||||
$generic_package_name = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ExternalDependencies/Package/GenericName');
|
||||
$title = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ExternalDependencies/Package/Title');
|
||||
$generic_file_check = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ExternalDependencies/Package/FileCheck');
|
||||
$possible_packages = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ExternalDependencies/Package/PossibleNames');
|
||||
$xml_options = LIBXML_COMPACT | LIBXML_PARSEHUGE;
|
||||
$xml = simplexml_load_file(PTS_EXDEP_PATH . 'xml/generic-packages.xml', 'SimpleXMLElement', $xml_options);
|
||||
|
||||
foreach(array_keys($generic_package_name) as $i)
|
||||
if(isset($xml->ExternalDependencies) && isset($xml->ExternalDependencies->Package))
|
||||
{
|
||||
$this->struct['external-dependencies']['generic-packages'][$generic_package_name[$i]] = $this->get_package_format($title[$i], $generic_file_check[$i], $possible_packages[$i]);
|
||||
foreach($xml->ExternalDependencies->Package as $pkg)
|
||||
{
|
||||
$generic_name = isset($pkg->GenericName) ? $pkg->GenericName->__toString() : null;
|
||||
$title = isset($pkg->Title) ? $pkg->Title->__toString() : null;
|
||||
$file_check = isset($pkg->FileCheck) ? $pkg->FileCheck->__toString() : null;
|
||||
$possible_packages = isset($pkg->PossibleNames) ? $pkg->PossibleNames->__toString() : null;
|
||||
$this->struct['external-dependencies']['generic-packages'][$generic_name] = $this->get_package_format($title, $file_check, $possible_packages);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2012 - 2016, Phoronix Media
|
||||
Copyright (C) 2012 - 2016, Michael Larabel
|
||||
Copyright (C) 2012 - 2017, Phoronix Media
|
||||
Copyright (C) 2012 - 2017, 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
|
||||
@@ -31,34 +31,37 @@ class pts_exdep_platform_parser
|
||||
if(PTS_IS_CLIENT)
|
||||
{
|
||||
$xml = PTS_EXDEP_PATH . 'xml/' . $identifier . '-packages.xml';
|
||||
$xml_parser = new nye_XmlReader($xml);
|
||||
$xml_options = LIBXML_COMPACT | LIBXML_PARSEHUGE;
|
||||
$xml = simplexml_load_file($xml, 'SimpleXMLElement', $xml_options);
|
||||
|
||||
$this->struct['external-dependencies']['name'] = $xml_parser->getXMLValue('PhoronixTestSuite/ExternalDependencies/Information/Name');
|
||||
$this->struct['external-dependencies']['package_manager'] = $xml_parser->getXMLValue('PhoronixTestSuite/ExternalDependencies/Information/PackageManager');
|
||||
$generic_package = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ExternalDependencies/Package/GenericName');
|
||||
$distro_package = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ExternalDependencies/Package/PackageName');
|
||||
$file_check = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ExternalDependencies/Package/FileCheck');
|
||||
$arch_specific = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ExternalDependencies/Package/ArchitectureSpecific');
|
||||
$os_version_specific = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ExternalDependencies/Package/VersionSpecific');
|
||||
$os_version = phodevi::read_property('system', 'os-version');
|
||||
$this->struct['external-dependencies']['name'] = isset($xml->ExternalDependencies->Information->Name) ? $xml->ExternalDependencies->Information->Name->__toString() : null;
|
||||
$this->struct['external-dependencies']['package_manager'] = isset($xml->ExternalDependencies->Information->PackageManager) ? $xml->ExternalDependencies->Information->PackageManager->__toString() : null;
|
||||
|
||||
foreach(array_keys($generic_package) as $i)
|
||||
if(isset($xml->ExternalDependencies) && isset($xml->ExternalDependencies->Package))
|
||||
{
|
||||
if(empty($generic_package[$i]))
|
||||
foreach($xml->ExternalDependencies->Package as $pkg)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$os_version_compliant = empty($os_version_specific[$i]) || in_array($os_version, pts_strings::comma_explode($os_version_specific[$i]));
|
||||
if($os_version_compliant == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$generic_package = isset($pkg->GenericName) ? $pkg->GenericName->__toString() : null;
|
||||
if(empty($generic_package))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->struct['external-dependencies']['packages'][$generic_package[$i]] = $this->get_package_format($distro_package[$i], $file_check[$i], $arch_specific[$i]);
|
||||
$os_version_specific = isset($pkg->VersionSpecific) ? $pkg->VersionSpecific->__toString() : null;
|
||||
$os_version_compliant = empty($os_version_specific) || in_array(phodevi::read_property('system', 'os-version'), pts_strings::comma_explode($os_version_specific));
|
||||
if($os_version_compliant == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$distro_package = isset($pkg->PackageName) ? $pkg->PackageName->__toString() : null;
|
||||
$file_check = isset($pkg->FileCheck) ? $pkg->FileCheck->__toString() : null;
|
||||
$arch_specific = isset($pkg->ArchitectureSpecific) ? $pkg->ArchitectureSpecific->__toString() : null;
|
||||
$this->struct['external-dependencies']['packages'][$generic_package] = $this->get_package_format($distro_package, $file_check, $arch_specific);
|
||||
}
|
||||
}
|
||||
|
||||
$aliases = $xml_parser->getXMLValue('PhoronixTestSuite/ExternalDependencies/Information/Aliases');
|
||||
|
||||
$aliases = isset($xml->ExternalDependencies->Information->Aliases) ? $xml->ExternalDependencies->Information->Aliases->__toString() : null;
|
||||
if($aliases != null)
|
||||
{
|
||||
$aliases = pts_strings::trim_explode(',', $aliases);
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2010 - 2016, Phoronix Media
|
||||
Copyright (C) 2010 - 2016, Michael Larabel
|
||||
Copyright (C) 2010 - 2017, Phoronix Media
|
||||
Copyright (C) 2010 - 2017, 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
|
||||
@@ -40,7 +40,7 @@ class pts_openbenchmarking
|
||||
}
|
||||
public static function valid_user_name()
|
||||
{
|
||||
$invalid_users = array('pts', 'phoronix', 'local');
|
||||
$invalid_users = array('pts', 'phoronix', 'local', 'official');
|
||||
// TODO: finish function
|
||||
}
|
||||
public static function stats_software_list()
|
||||
@@ -130,6 +130,7 @@ class pts_openbenchmarking
|
||||
$composite_xml = $json_response['openbenchmarking']['result']['composite_xml'];
|
||||
|
||||
$result_file = new pts_result_file($composite_xml);
|
||||
$result_file->set_reference_id($id);
|
||||
//$id = strtolower($id);
|
||||
$valid = $return_xml ? $result_file->get_xml() : pts_client::save_test_result($id . '/composite.xml', $result_file->get_xml(), true);
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, 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
|
||||
@@ -89,7 +89,7 @@ class pts_render
|
||||
}
|
||||
public static function render_graph_process(&$result_object, &$result_file = null, $save_as = false, $extra_attributes = null)
|
||||
{
|
||||
// TODO XXX: $save_as doesn't appear used anymore
|
||||
// NOTICE: $save_as doesn't appear used anymore
|
||||
if(isset($extra_attributes['clear_unchanged_results']))
|
||||
{
|
||||
$result_object->remove_unchanged_results();
|
||||
@@ -176,33 +176,6 @@ class pts_render
|
||||
{
|
||||
$result_object->test_profile->set_display_format('HORIZONTAL_BOX_PLOT');
|
||||
}
|
||||
/* else // XXX commented out during PTS 6.0 development, TODO decide if to delete
|
||||
{
|
||||
// Turn a multi-way line graph into an averaged bar graph
|
||||
$buffer_items = $result_object->test_result_buffer->get_buffer_items();
|
||||
$result_object->test_result_buffer = new pts_test_result_buffer();
|
||||
|
||||
foreach($buffer_items as $buffer_item)
|
||||
{
|
||||
$values = pts_strings::comma_explode($buffer_item->get_result_value());
|
||||
$avg_value = pts_math::set_precision(array_sum($values) / count($values), 2);
|
||||
$j = null;
|
||||
if(count($values) > 2)
|
||||
{
|
||||
$j['min-result'] = min($values);
|
||||
$j['max-result'] = max($values);
|
||||
|
||||
if($j['min-result'] == $j['max-result'])
|
||||
{
|
||||
$json = null;
|
||||
}
|
||||
}
|
||||
|
||||
$result_object->test_result_buffer->add_test_result($buffer_item->get_result_identifier(), $avg_value, null, $j, $j['min-result'], $j['max-result']);
|
||||
}
|
||||
|
||||
$result_object->test_profile->set_display_format('BAR_GRAPH');
|
||||
} */
|
||||
}
|
||||
|
||||
if($result_file->is_results_tracker() && !isset($extra_attributes['compact_to_scalar']))
|
||||
@@ -496,23 +469,24 @@ class pts_render
|
||||
|
||||
foreach($json as $identifier => &$data)
|
||||
{
|
||||
// TODO XXX: Ultimately merge this data into the SE +/- line...
|
||||
$graph_identifier_note = null;
|
||||
if(isset($data['min-result']))
|
||||
{
|
||||
if(isset($data['max-result']))
|
||||
{
|
||||
$graph->addGraphIdentifierNote($identifier, 'MIN: ' . $data['min-result'] . ' / MAX: ' . $data['max-result']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$graph->addGraphIdentifierNote($identifier, 'MIN: ' . $data['min-result']);
|
||||
}
|
||||
$graph_identifier_note .= 'MIN: ' . $data['min-result'];
|
||||
}
|
||||
if(isset($data['max-result']))
|
||||
{
|
||||
$graph_identifier_note .= ($graph_identifier_note == null ? '' : ' / ') . 'MAX: ' . $data['min-result'];
|
||||
}
|
||||
|
||||
if($graph_identifier_note)
|
||||
{
|
||||
$graph->addGraphIdentifierNote($identifier, $graph_identifier_note);
|
||||
}
|
||||
|
||||
if(isset($data['install-footnote']) && $data['install-footnote'] != null)
|
||||
{
|
||||
$graph->addTestNote($identifier . ': ' . $data['install-footnote']);
|
||||
//$graph->addGraphIdentifierNote($identifier, $data['install-footnote']);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -604,7 +578,7 @@ class pts_render
|
||||
{
|
||||
if($days_keys == null)
|
||||
{
|
||||
// TODO: Rather messy and inappropriate way of getting the days keys
|
||||
// Rather messy and inappropriate way of getting the days keys
|
||||
$days_keys = array_keys($system);
|
||||
break;
|
||||
}
|
||||
@@ -674,11 +648,6 @@ class pts_render
|
||||
$targets[$identifier_r[1]] = !isset($targets[$identifier_r[1]]) ? 1 : $targets[$identifier_r[1]] + 1;
|
||||
}
|
||||
|
||||
if(false && $is_ordered == false && $is_multi_way)
|
||||
{
|
||||
// TODO: get the reordering code to work
|
||||
}
|
||||
|
||||
$is_multi_way_inverted = $is_multi_way && count($targets) > count($systems);
|
||||
|
||||
return $is_multi_way ? array($is_multi_way, $is_multi_way_inverted) : false;
|
||||
@@ -732,33 +701,6 @@ class pts_render
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(($p = strpos($user_agent, 'Opera/')) !== false)
|
||||
{
|
||||
// Opera
|
||||
$ver = substr($user_agent, ($p + 6));
|
||||
$ver = substr($ver, 0, strpos($ver, ' '));
|
||||
|
||||
// 9.27, 9.64 displays most everything okay
|
||||
if($ver < 9.27)
|
||||
{
|
||||
$selected_renderer = 'PNG';
|
||||
}
|
||||
|
||||
// text-alignment is still fucked as of 11.50/12.0
|
||||
// With PTS4 and the bilde_svg_dom calls not using dominant-baseline, Opera support seems to be fine
|
||||
// $selected_renderer = 'PNG';
|
||||
}
|
||||
else if(($p = strpos($user_agent, 'Epiphany/')) !== false)
|
||||
{
|
||||
// Older versions of Epiphany. Newer versions should report their Gecko or WebKit appropriately
|
||||
$ver = substr($user_agent, ($p + 9));
|
||||
$ver = substr($ver, 0, 4);
|
||||
|
||||
if($ver < 2.22)
|
||||
{
|
||||
$selected_renderer = 'PNG';
|
||||
}
|
||||
}
|
||||
else if(($p = strpos($user_agent, 'KHTML/')) !== false)
|
||||
{
|
||||
// KDE Konqueror as of 4.7 is still broken for SVG
|
||||
|
||||
@@ -267,6 +267,25 @@ class pts_result_file
|
||||
{
|
||||
return count($this->get_result_objects());
|
||||
}
|
||||
public function has_matching_test_and_run_identifier(&$test_result, $run_identifier_to_check)
|
||||
{
|
||||
$found_match = false;
|
||||
$hash_to_check = $test_result->get_comparison_hash();
|
||||
|
||||
foreach($this->get_result_objects() as $result_object)
|
||||
{
|
||||
if($hash_to_check == $result_object->get_comparison_hash())
|
||||
{
|
||||
if(in_array($run_identifier_to_check, $result_object->test_result_buffer->get_identifiers()))
|
||||
{
|
||||
$found_match = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $found_match;
|
||||
}
|
||||
public function get_contained_tests_hash($raw_output = true)
|
||||
{
|
||||
$result_object_hashes = $this->get_result_object_hashes();
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2010 - 2016, Phoronix Media
|
||||
Copyright (C) 2010 - 2016, Michael Larabel
|
||||
Copyright (C) 2010 - 2017, Phoronix Media
|
||||
Copyright (C) 2010 - 2017, 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
|
||||
@@ -91,7 +91,7 @@ class pts_result_file_output
|
||||
}
|
||||
|
||||
$csv_output .= PHP_EOL;
|
||||
$csv_output .= ' ';
|
||||
$csv_output .= ' ' . $delimiter;
|
||||
|
||||
foreach($columns as $column)
|
||||
{
|
||||
@@ -110,6 +110,8 @@ class pts_result_file_output
|
||||
$csv_output .= '"' . $result_object->test_profile->get_identifier() . ' - ' . $result_object->get_arguments() . '"';
|
||||
}
|
||||
|
||||
$csv_output .= $delimiter . $result_object->test_profile->get_result_proportion();
|
||||
|
||||
foreach($columns as $column)
|
||||
{
|
||||
$buffer_item = $result_object->test_result_buffer->find_buffer_item($column);
|
||||
@@ -195,7 +197,8 @@ class pts_result_file_output
|
||||
|
||||
if(is_numeric($val))
|
||||
{
|
||||
$result_output .= str_repeat(' ', $longest_result - strlen($val)) . '|';
|
||||
$repeat_length = $longest_result - strlen($val);
|
||||
$result_output .= ($repeat_length >= 0 ? str_repeat(' ', $repeat_length) : null) . '|';
|
||||
$current_line_length = strlen(substr($result_output, strrpos($result_output, PHP_EOL) + 1)) + 1;
|
||||
$result_output .= str_repeat('=', round(($val / $max_value) * ($terminal_width - $current_line_length)));
|
||||
|
||||
@@ -254,7 +257,7 @@ class pts_result_file_output
|
||||
$pdf->Ln(100);
|
||||
$pdf->ImageJPGInline($output, 50, 40 + (($placement - 1) * 120), 120);
|
||||
|
||||
if($placement == 2)
|
||||
if($placement == 2 || $result_object->test_result_buffer->get_count() > 12)
|
||||
{
|
||||
$placement = 0;
|
||||
if($i != count($results))
|
||||
@@ -265,6 +268,7 @@ class pts_result_file_output
|
||||
$placement++;
|
||||
$i++;
|
||||
}
|
||||
$pdf->WriteText('This file was automatically generated via the Phoronix Test Suite open-source benchmarking software.');
|
||||
ob_get_clean();
|
||||
$pdf->Output($dest, $output_name);
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2011 - 2016, Phoronix Media
|
||||
Copyright (C) 2011 - 2016, Michael Larabel
|
||||
Copyright (C) 2011 - 2017, Phoronix Media
|
||||
Copyright (C) 2011 - 2017, 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
|
||||
|
||||
@@ -319,13 +319,14 @@ class pts_test_profile extends pts_test_profile_parser
|
||||
|
||||
return $supported;
|
||||
}
|
||||
public static function generate_comparison_hash($test_identifier, $arguments, $attributes = null, $version = null, $raw_output = true)
|
||||
public static function generate_comparison_hash($test_identifier, $arguments, $attributes = null, $version = null, $result_scale = null, $raw_output = true)
|
||||
{
|
||||
$hash_table = array(
|
||||
$test_identifier,
|
||||
trim($arguments),
|
||||
trim($attributes),
|
||||
$version
|
||||
trim($version),
|
||||
trim($result_scale)
|
||||
);
|
||||
|
||||
return sha1(implode(',', $hash_table), $raw_output);
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, 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
|
||||
@@ -32,7 +32,8 @@ class pts_test_result
|
||||
public $test_result_buffer;
|
||||
|
||||
public $active = null;
|
||||
public $secondary_linked_results = null;
|
||||
public $generated_result_buffers = null;
|
||||
public $test_run_times = null;
|
||||
|
||||
// Added to make it easy to have PTS modules run a custom binary prior to running a program for the test
|
||||
public $exec_binary_prepend = null;
|
||||
@@ -42,6 +43,7 @@ class pts_test_result
|
||||
{
|
||||
$this->test_profile = clone $test_profile;
|
||||
$this->result = 0;
|
||||
$this->test_run_times = array();
|
||||
}
|
||||
public function __clone()
|
||||
{
|
||||
@@ -60,6 +62,13 @@ class pts_test_result
|
||||
{
|
||||
$this->used_arguments_description = $arguments_description;
|
||||
}
|
||||
public function append_to_arguments_description($arguments_description)
|
||||
{
|
||||
if(strpos(' ' . $this->used_arguments_description . ' ', ' ' . $arguments_description . ' ') === false)
|
||||
{
|
||||
$this->used_arguments_description .= ($this->used_arguments_description != null ? ' ' : null) . $arguments_description;
|
||||
}
|
||||
}
|
||||
public function set_result_precision($precision = 2)
|
||||
{
|
||||
$this->result_precision = $precision;
|
||||
@@ -95,7 +104,7 @@ class pts_test_result
|
||||
// this removal is done since the zz segment should be maintainable between comparisons
|
||||
$tp = substr($tp, 0, $x);
|
||||
}
|
||||
return pts_test_profile::generate_comparison_hash($tp, $this->get_arguments(), $this->get_arguments_description(), $this->test_profile->get_app_version(), $raw_output);
|
||||
return pts_test_profile::generate_comparison_hash($tp, $this->get_arguments(), $this->get_arguments_description(), $this->test_profile->get_app_version(), $this->test_profile->get_result_scale(), $raw_output);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -172,6 +181,38 @@ class pts_test_result
|
||||
|
||||
return $largest_variation;
|
||||
}
|
||||
public function get_result_first()
|
||||
{
|
||||
// a.k.a. the result winner
|
||||
$winner = null;
|
||||
|
||||
if($this->test_profile->get_result_proportion() == 'LIB')
|
||||
{
|
||||
$winner = $this->test_result_buffer->get_min_value(true);
|
||||
}
|
||||
else if($this->test_profile->get_result_proportion() == 'HIB')
|
||||
{
|
||||
$winner = $this->test_result_buffer->get_max_value(true);
|
||||
}
|
||||
|
||||
return $winner;
|
||||
}
|
||||
public function get_result_last()
|
||||
{
|
||||
// a.k.a. the result loser
|
||||
$winner = null;
|
||||
|
||||
if($this->test_profile->get_result_proportion() == 'HIB')
|
||||
{
|
||||
$winner = $this->test_result_buffer->get_min_value(true);
|
||||
}
|
||||
else if($this->test_profile->get_result_proportion() == 'LIB')
|
||||
{
|
||||
$winner = $this->test_result_buffer->get_max_value(true);
|
||||
}
|
||||
|
||||
return $winner;
|
||||
}
|
||||
public function normalize_buffer_values($normalize_against = false)
|
||||
{
|
||||
if($this->test_profile->get_display_format() != 'BAR_GRAPH') // BAR_ANALYZE_GRAPH is currently unsupported
|
||||
@@ -188,13 +229,14 @@ class pts_test_result
|
||||
foreach($keys as $k)
|
||||
{
|
||||
$identifier_r = pts_strings::trim_explode(': ', $this->test_result_buffer->buffer_items[$k]->get_result_identifier());
|
||||
$position = 1;
|
||||
|
||||
if(!isset($key_sets[$identifier_r[0]]))
|
||||
if(!isset($key_sets[$identifier_r[$position]]))
|
||||
{
|
||||
$key_sets[$identifier_r[0]] = array();
|
||||
$key_sets[$identifier_r[$position]] = array();
|
||||
}
|
||||
|
||||
$key_sets[$identifier_r[0]][] = $k;
|
||||
$key_sets[$identifier_r[$position]][] = $k;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2016, Phoronix Media
|
||||
Copyright (C) 2009 - 2016, Michael Larabel
|
||||
Copyright (C) 2009 - 2017, Phoronix Media
|
||||
Copyright (C) 2009 - 2017, 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
|
||||
@@ -295,19 +295,37 @@ class pts_test_result_buffer
|
||||
|
||||
return $identifier;
|
||||
}
|
||||
public function get_max_value()
|
||||
public function get_max_value($return_identifier = false)
|
||||
{
|
||||
$value = 0;
|
||||
$max_id = null;
|
||||
|
||||
foreach($this->buffer_items as &$buffer_item)
|
||||
{
|
||||
if($buffer_item->get_result_value() > $value)
|
||||
{
|
||||
$value = $buffer_item->get_result_value();
|
||||
$max_id = $buffer_item->get_result_identifier();
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
return $return_identifier ? $max_id : $value;
|
||||
}
|
||||
public function get_min_value($return_identifier = false)
|
||||
{
|
||||
$value = 0;
|
||||
$max_id = null;
|
||||
|
||||
foreach($this->buffer_items as &$buffer_item)
|
||||
{
|
||||
if($buffer_item->get_result_value() < $value || $value == 0)
|
||||
{
|
||||
$value = $buffer_item->get_result_value();
|
||||
$max_id = $buffer_item->get_result_identifier();
|
||||
}
|
||||
}
|
||||
|
||||
return $return_identifier ? $max_id : $value;
|
||||
}
|
||||
public function buffer_values_to_percent()
|
||||
{
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2016, Phoronix Media
|
||||
Copyright (C) 2009 - 2016, Michael Larabel
|
||||
Copyright (C) 2009 - 2017, Phoronix Media
|
||||
Copyright (C) 2009 - 2017, 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,10 +25,7 @@ class pts_test_result_buffer_active
|
||||
public $results;
|
||||
public $min_results;
|
||||
public $max_results;
|
||||
public $active = null;
|
||||
public $active_result = null;
|
||||
public $active_min_result = null;
|
||||
public $active_max_result = null;
|
||||
//public $active = null;
|
||||
private $result = 0;
|
||||
private $result_min = 0;
|
||||
private $result_max = 0;
|
||||
@@ -45,10 +42,6 @@ class pts_test_result_buffer_active
|
||||
$this->min_results[] = $min;
|
||||
$this->max_results[] = $max;
|
||||
}
|
||||
public function get_trial_run_count()
|
||||
{
|
||||
return count($this->results);
|
||||
}
|
||||
public function get_values_as_string()
|
||||
{
|
||||
return implode(':', $this->results);
|
||||
@@ -77,6 +70,34 @@ class pts_test_result_buffer_active
|
||||
{
|
||||
return $this->result_max;
|
||||
}
|
||||
public function get_max_value()
|
||||
{
|
||||
$value = 0;
|
||||
|
||||
foreach($this->results as $result)
|
||||
{
|
||||
if($result > $value)
|
||||
{
|
||||
$value = $result;
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
public function get_min_value()
|
||||
{
|
||||
$value = 0;
|
||||
|
||||
foreach($this->results as $result)
|
||||
{
|
||||
if($result < $value || $value == 0)
|
||||
{
|
||||
$value = $result;
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2015, Phoronix Media
|
||||
Copyright (C) 2009 - 2015, Michael Larabel
|
||||
Copyright (C) 2009 - 2017, Phoronix Media
|
||||
Copyright (C) 2009 - 2017, 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
|
||||
@@ -33,7 +33,7 @@ class pts_test_result_buffer_item
|
||||
{
|
||||
$this->result_identifier = $identifier;
|
||||
$this->result_final = $final;
|
||||
$this->result_raw = $raw;
|
||||
$this->result_raw = $final != $raw ? $raw : null;
|
||||
$this->result_min = $min_value;
|
||||
$this->result_max = $max_value;
|
||||
$this->result_json = $json;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, 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
|
||||
@@ -26,11 +26,22 @@ class pts_user_io
|
||||
{
|
||||
return trim(fgets(STDIN));
|
||||
}
|
||||
public static function strip_ansi_escape_sequences($output)
|
||||
{
|
||||
if(function_exists('preg_replace'))
|
||||
{
|
||||
$output = preg_replace('/\x1b(\[|\(|\))[;?0-9]*[0-9A-Za-z]/', null, $output);
|
||||
$output = preg_replace('/\x1b(\[|\(|\))[;?0-9]*[0-9A-Za-z]/', null, $output);
|
||||
$output = preg_replace('/[\x03|\x1a]/', null, $output);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
public static function prompt_user_input($question, $allow_null = false)
|
||||
{
|
||||
do
|
||||
{
|
||||
echo PHP_EOL . $question . ': ';
|
||||
echo PHP_EOL . pts_client::cli_just_bold($question . ': ');
|
||||
$answer = pts_user_io::read_user_input();
|
||||
}
|
||||
while(!$allow_null && empty($answer));
|
||||
@@ -48,7 +59,7 @@ class pts_user_io
|
||||
|
||||
return $list;
|
||||
}
|
||||
public static function display_text_table(&$table, $prepend_to_lines = null, $extra_width_to_column = 0)
|
||||
public static function display_text_table(&$table, $prepend_to_lines = null, $extra_width_to_column = 0, $min_width = 0)
|
||||
{
|
||||
$column_widths = array();
|
||||
$formatted_table = $prepend_to_lines;
|
||||
@@ -72,7 +83,7 @@ class pts_user_io
|
||||
|
||||
if(($c + 1) != $rc_count)
|
||||
{
|
||||
$formatted_table .= str_repeat(' ', (1 + $extra_width_to_column + $column_widths[$c] - strlen($table[$r][$c])));
|
||||
$formatted_table .= str_repeat(' ', (max($min_width, 1 + $extra_width_to_column + $column_widths[$c]) - strlen($table[$r][$c])));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +113,7 @@ class pts_user_io
|
||||
|
||||
do
|
||||
{
|
||||
pts_client::$display->generic_prompt($question);
|
||||
pts_client::$display->generic_prompt(pts_client::cli_just_bold($question));
|
||||
$input = strtolower(pts_user_io::read_user_input());
|
||||
}
|
||||
while($input != 'y' && $input != 'n' && $input != '');
|
||||
@@ -138,9 +149,9 @@ class pts_user_io
|
||||
foreach(array_keys($options_r) as $i => $key)
|
||||
{
|
||||
$key_index[($i + 1)] = $key;
|
||||
echo $line_prefix . ($i + 1) . ': ' . str_repeat(' ', strlen($option_count) - strlen(($i + 1))) . $options_r[$key] . PHP_EOL;
|
||||
echo $line_prefix . pts_client::cli_just_bold(($i + 1) . ': ') . str_repeat(' ', strlen($option_count) - strlen(($i + 1))) . $options_r[$key] . PHP_EOL;
|
||||
}
|
||||
echo $line_prefix . $user_string . ': ';
|
||||
echo $line_prefix . pts_client::cli_just_bold($user_string . ': ');
|
||||
$select_choice = pts_user_io::read_user_input();
|
||||
|
||||
foreach(($allow_multi_select ? pts_strings::comma_explode($select_choice) : array($select_choice)) as $choice)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2016, Phoronix Media
|
||||
Copyright (C) 2009 - 2016, Michael Larabel
|
||||
Copyright (C) 2009 - 2017, Phoronix Media
|
||||
Copyright (C) 2009 - 2017, 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
|
||||
@@ -172,8 +172,9 @@ class pts_validation
|
||||
$writer->rebuild_download_file($test_profile);
|
||||
$writer->save_xml($download_xml_file);
|
||||
|
||||
$downloads_parser = new pts_test_downloads_nye_XmlReader($download_xml_file);
|
||||
$valid = $downloads_parser->validate();
|
||||
$dom = new DOMDocument();
|
||||
$dom->load($download_xml_file);
|
||||
$valid = $dom->schemaValidate(PTS_OPENBENCHMARKING_PATH . 'schemas/test-profile-downloads.xsd');
|
||||
|
||||
if($valid == false)
|
||||
{
|
||||
@@ -228,8 +229,9 @@ class pts_validation
|
||||
$writer = self::rebuild_result_parser_file($parser_file);
|
||||
$writer->saveXMLFile($parser_file);
|
||||
|
||||
$parser = new pts_parse_results_nye_XmlReader($parser_file);
|
||||
$valid = $parser->validate();
|
||||
$dom = new DOMDocument();
|
||||
$dom->load($parser_file);
|
||||
$valid = $dom->schemaValidate(PTS_OPENBENCHMARKING_PATH . 'schemas/results-parser.xsd');
|
||||
|
||||
if($valid == false)
|
||||
{
|
||||
@@ -260,7 +262,7 @@ class pts_validation
|
||||
public static function rebuild_result_parser_file($xml_file)
|
||||
{
|
||||
$xml_writer = new nye_XmlWriter();
|
||||
$xml_parser = new pts_parse_results_nye_XmlReader($xml_file);
|
||||
$xml_parser = new nye_XmlReader($xml_file);
|
||||
$result_template = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ResultsParser/OutputTemplate');
|
||||
$result_match_test_arguments = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ResultsParser/MatchToTestArguments');
|
||||
$result_key = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ResultsParser/ResultKey');
|
||||
@@ -278,6 +280,7 @@ class pts_validation
|
||||
$result_scale = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ResultsParser/ResultScale');
|
||||
$result_proportion = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ResultsParser/ResultProportion');
|
||||
$result_precision = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ResultsParser/ResultPrecision');
|
||||
$result_args_desc = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ResultsParser/ArgumentsDescription');
|
||||
|
||||
foreach(array_keys($result_template) as $i)
|
||||
{
|
||||
@@ -297,6 +300,7 @@ class pts_validation
|
||||
$xml_writer->addXmlNodeWNE('PhoronixTestSuite/ResultsParser/ResultScale', $result_scale[$i]);
|
||||
$xml_writer->addXmlNodeWNE('PhoronixTestSuite/ResultsParser/ResultProportion', $result_proportion[$i]);
|
||||
$xml_writer->addXmlNodeWNE('PhoronixTestSuite/ResultsParser/ResultPrecision', $result_precision[$i]);
|
||||
$xml_writer->addXmlNodeWNE('PhoronixTestSuite/ResultsParser/ArgumentsDescription', $result_args_desc[$i]);
|
||||
$xml_writer->addXmlNodeWNE('PhoronixTestSuite/ResultsParser/FileFormat', $file_format[$i]);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<xs:annotation>
|
||||
<xs:documentation xml:lang="en">
|
||||
Phoronix Test Suite / OpenBenchmarking.org XML Result File Specification
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, Michael Larabel
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:include schemaLocation="types.xsd" />
|
||||
@@ -61,7 +61,7 @@
|
||||
<xs:sequence>
|
||||
<xs:element name="Identifier" type="SystemIdentifier" />
|
||||
<xs:element name="Value" type="xs:string" />
|
||||
<xs:element name="RawString" type="xs:string" />
|
||||
<xs:element name="RawString" type="xs:string" minOccurs="0" maxOccurs="1" />
|
||||
<xs:element name="JSON" type="xs:string" minOccurs="0" maxOccurs="1" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<xs:annotation>
|
||||
<xs:documentation xml:lang="en">
|
||||
Phoronix Test Suite / OpenBenchmarking.org XML Test Profile Specification
|
||||
Copyright (C) 2008 - 2015, Phoronix Media
|
||||
Copyright (C) 2008 - 2015, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, Michael Larabel
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:include schemaLocation="types.xsd" />
|
||||
@@ -30,6 +30,7 @@
|
||||
<xs:element name="ResultScale" type="xs:string" minOccurs="0" maxOccurs="1" />
|
||||
<xs:element name="ResultProportion" type="xs:string" minOccurs="0" maxOccurs="1" />
|
||||
<xs:element name="ResultPrecision" type="xs:string" minOccurs="0" maxOccurs="1" />
|
||||
<xs:element name="ArgumentsDescription" type="xs:string" minOccurs="0" maxOccurs="1" />
|
||||
<xs:element name="FileFormat" type="xs:string" minOccurs="0" maxOccurs="1" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<xs:annotation>
|
||||
<xs:documentation xml:lang="en">
|
||||
Phoronix Test Suite / OpenBenchmarking.org XML Test Profile Specification
|
||||
Copyright (C) 2008 - 2013, Phoronix Media
|
||||
Copyright (C) 2008 - 2013, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, Michael Larabel
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:include schemaLocation="types.xsd" />
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<xs:annotation>
|
||||
<xs:documentation xml:lang="en">
|
||||
Phoronix Test Suite / OpenBenchmarking.org XML Test Profile Specification
|
||||
Copyright (C) 2008 - 2015, Phoronix Media
|
||||
Copyright (C) 2008 - 2015, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, Michael Larabel
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:include schemaLocation="types.xsd" />
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<xs:annotation>
|
||||
<xs:documentation xml:lang="en">
|
||||
Phoronix Test Suite / OpenBenchmarking.org XML Result File Specification
|
||||
Copyright (C) 2008 - 2010, Phoronix Media
|
||||
Copyright (C) 2008 - 2010, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, Michael Larabel
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:include schemaLocation="types.xsd" />
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<xs:annotation>
|
||||
<xs:documentation xml:lang="en">
|
||||
Phoronix Test Suite / OpenBenchmarking.org
|
||||
Copyright (C) 2008 - 2015, Phoronix Media
|
||||
Copyright (C) 2008 - 2015, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, Michael Larabel
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:simpleType name="ResultTitleString">
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, Michael Larabel
|
||||
phoronix-test-suite.php: The main code for initalizing the Phoronix Test Suite
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -142,6 +142,14 @@ pts_define('PTS_USER_LOCK', function_exists('posix_getpid') ? PTS_USER_PATH . 'r
|
||||
|
||||
if(QUICK_START == false)
|
||||
{
|
||||
// Cleanup old / expired runlocks XXX expire if this can eventually be removed
|
||||
foreach(pts_file_io::glob(PTS_USER_PATH . 'run-lock-*') as $possible_run_lock)
|
||||
{
|
||||
if(!pts_client::is_locked($possible_run_lock))
|
||||
{
|
||||
pts_file_io::unlink($possible_run_lock);
|
||||
}
|
||||
}
|
||||
if(pts_client::create_lock(PTS_USER_LOCK) == false)
|
||||
{
|
||||
//trigger_error('It appears that the Phoronix Test Suite is already running.' . PHP_EOL . 'For proper results, only run one instance at a time.', E_USER_WARNING);
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2016, Phoronix Media
|
||||
Copyright (C) 2008 - 2016, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, Michael Larabel
|
||||
pts-core.php: To boot-strap the Phoronix Test Suite start-up
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -190,6 +190,7 @@ function pts_needed_extensions()
|
||||
array(0, extension_loaded('openssl'), 'OpenSSL', 'OpenSSL support is recommended to support HTTPS traffic.'),
|
||||
array(0, extension_loaded('gd'), 'GD', 'The GD library is recommended for improved graph rendering.'),
|
||||
array(0, extension_loaded('zlib'), 'Zlib', 'The Zlib extension can be used for greater file compression.'),
|
||||
array(0, function_exists('bzcompress'), 'Bzip2', 'The bzcompress/bzip2 support can be used for greater file compression.'),
|
||||
array(0, extension_loaded('sqlite3'), 'SQLite3', 'SQLite3 is required when running a Phoromatic server.'),
|
||||
array(0, function_exists('pcntl_fork'), 'PCNTL', 'PCNTL is highly recommended as it is required by some tests.'),
|
||||
array(0, function_exists('posix_getpwuid'), 'POSIX', 'POSIX support is highly recommended.'),
|
||||
@@ -247,9 +248,9 @@ function pts_version_codenames()
|
||||
);
|
||||
}
|
||||
|
||||
pts_define('PTS_VERSION', '6.8.0');
|
||||
pts_define('PTS_CORE_VERSION', 6800);
|
||||
pts_define('PTS_CODENAME', 'TANA');
|
||||
pts_define('PTS_VERSION', '7.0.0');
|
||||
pts_define('PTS_CORE_VERSION', 7000);
|
||||
pts_define('PTS_CODENAME', 'RINGSAKER');
|
||||
pts_define('PTS_IS_CLIENT', (defined('PTS_MODE') && strstr(PTS_MODE, 'CLIENT') !== false));
|
||||
pts_define('PTS_IS_WEB_CLIENT', (defined('PTS_MODE') && PTS_MODE == 'WEB_CLIENT'));
|
||||
pts_define('PTS_IS_DEV_BUILD', (substr(PTS_VERSION, -2, 1) == 'm'));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright (C) 2008 - 2014, Michael Larabel -->
|
||||
<!-- Copyright (C) 2008 - 2017, Michael Larabel -->
|
||||
<application>
|
||||
<id type="desktop">phoronix-test-suite.desktop</id>
|
||||
<licence>CC0</licence>
|
||||
@@ -15,4 +15,5 @@
|
||||
</screenshots>
|
||||
<url type="homepage">http://www.phoronix-test-suite.com/</url>
|
||||
<updatecontact>michael_at_phoronix.com</updatecontact>
|
||||
<translation></translation>
|
||||
</application>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2008 - 2015, Phoronix Media
|
||||
Copyright (C) 2008 - 2015, Michael Larabel
|
||||
Copyright (C) 2008 - 2017, Phoronix Media
|
||||
Copyright (C) 2008 - 2017, 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
|
||||
@@ -53,7 +53,9 @@ function get_xml_values(xml_file, path)
|
||||
var results = [];
|
||||
while(result)
|
||||
{
|
||||
results.push(result.childNodes[0].nodeValue);
|
||||
if(result.childNodes[0])
|
||||
results.push(result.childNodes[0].nodeValue);
|
||||
|
||||
result = nodes.iterateNext();
|
||||
}
|
||||
|
||||
@@ -315,7 +317,7 @@ div#pts_footer_logo a:hover
|
||||
<div id="pts_footer_logo"><a href="http://www.phoronix-test-suite.com/"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewbox="0 0 76 41" width="76" height="41" preserveAspectRatio="xMinYMin meet">
|
||||
<path d="m74 22v9m-5-16v16m-5-28v28m-23-2h12.5c2.485281 0 4.5-2.014719 4.5-4.5s-2.014719-4.5-4.5-4.5h-8c-2.485281 0-4.5-2.014719-4.5-4.5s2.014719-4.5 4.5-4.5h12.5m-21 5h-11m11 13h-2c-4.970563 0-9-4.029437-9-9v-20m-24 40v-20c0-4.970563 4.0294373-9 9-9 4.970563 0 9 4.029437 9 9s-4.029437 9-9 9h-9" stroke="#c8d905" stroke-width="4" fill="none" />
|
||||
</svg></a></div>
|
||||
<p>Copyright © 2008 - 2016 by <a href="http://www.phoronix-media.com/">Phoronix Media</a>.</p>
|
||||
<p>Copyright © 2008 - 2017 by <a href="http://www.phoronix-media.com/">Phoronix Media</a>.</p>
|
||||
<p>All trademarks used are properties of their respective owners. All rights reserved.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user