This file is indexed.

/usr/share/phoronix-test-suite/pts-core/commands/debug_self_test.php is in phoronix-test-suite 4.8.3-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php

/*
	Phoronix Test Suite
	URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
	Copyright (C) 2013, Phoronix Media
	Copyright (C) 2013, 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_self_test implements pts_option_interface
{
	const doc_section = 'Other';
	const doc_description = 'This option is used during the development of the Phoronix Test Suite software for testing of internal interfaces, commands, and other common code-paths. The produced numbers should only be comparable for the same version of the Phoronix Test Suite, on the same hardware/software system, conducted on the same day of testing. This isn\'t intended as any scientific benchmark but simply to stress common PHP code-paths and looking for hot areas to optimize, etc.';

	public static function run($r)
	{
		$commands = array(
			'detailed_system_info' => null,
			'list_available_tests' => null,
			'list_available_suites' => null,
			'info' => array('xonotic'),
			'clone_openbenchmarking_result' => array('1107247-LI-MESACOMMI48'),
		//	'refresh_graphs' => array('1107247-LI-MESACOMMI48'),
			'result_file_to_text' => array('1107247-LI-MESACOMMI48'),
			'diagnostics' => null,
			'dump_possible_options' => null,
			);

		$individual_times = array();

		phodevi::clear_cache();

		$start = microtime(true);
		foreach($commands as $command => $args)
		{
			echo PHP_EOL . '### ' . $command . ' ###' . PHP_EOL;
			$individual_times[$command] = array();

			for($i = 0; $i < 3; $i++)
			{
				$c_start = microtime(true);
				pts_client::execute_command($command, $args);
				$c_finish = microtime(true);
				array_push($individual_times[$command], ($c_finish - $c_start));
			}
		}
		$finish = microtime(true);

		echo PHP_EOL . PHP_EOL . '### OVERALL DATA ###' . PHP_EOL . PHP_EOL;
		echo 'PHP:  ' . PTS_PHP_VERSION . PHP_EOL;

		$longest_c = max(array_map('strlen', array_keys($individual_times)));
		foreach($individual_times as $component => $times)
		{
			echo strtoupper($component) . ': ' . (str_repeat(' ', $longest_c - strlen($component))) . pts_math::set_precision(round(array_sum($times) / count($times), 3), 3) . ' seconds' . PHP_EOL;
		}

		echo PHP_EOL . 'ELAPSED TIME: ' . (str_repeat(' ', $longest_c - strlen('ELAPSED TIME'))) . round($finish - $start, 3) . ' seconds';
		echo PHP_EOL . 'PEAK MEMORY USAGE: ' . (str_repeat(' ', $longest_c - strlen('PEAK MEMORY USAGE'))) . round(memory_get_peak_usage(true) / 1048576, 3) . ' MB';
		echo PHP_EOL . 'PEAK MEMORY USAGE (emalloc): ' . (str_repeat(' ', $longest_c - strlen('PEAK MEMORY USAGE (emalloc)'))) . round(memory_get_peak_usage() / 1048576, 3) . ' MB';
		echo PHP_EOL;
	}
}

?>