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; } }
public static function set_cpu_feature_flags() { $flags = explode(' ', self::read_cpuinfo_line('flags')); self::$cpu_flags = 0; foreach (self::get_cpu_feature_constants() as $feature => $value) { if (in_array($feature, $flags)) { // The feature is supported on the CPU self::$cpu_flags |= $value; } } }
protected function generate_processor_data(&$result_file, $system_identifier) { $this->rows[] = $system_identifier; $rows_index = count($this->rows) - 1; foreach ($this->columns as $i => $cpuinfo_item) { switch ($cpuinfo_item) { case 'Features': $line = phodevi_cpu::instruction_set_extensions(); break; case 'Core Count': $line = phodevi_cpu::cpuinfo_core_count(); break; case 'Thread Count': $line = phodevi_cpu::cpuinfo_thread_count(); break; case 'L2 Cache': $line = phodevi_cpu::lscpu_l2_cache(); break; case 'Virtualization': $line = phodevi_cpu::virtualization_technology(); break; default: $line = phodevi_cpu::read_cpuinfo_line(strtolower($cpuinfo_item), false); break; } if ($line) { $line = pts_strings::strip_string($line); } $this->table_data[$i][$rows_index] = $line; } }
public static function render_page_process($PATH) { $COMPONENT = trim(str_replace('%20', ' ', $PATH[0])); switch ($COMPONENT) { case 'CPU': $model = phodevi::read_property('cpu', 'model'); $ob_type = 'Processor'; $sensor_flag = 'all.cpu'; $cpu_flags = phodevi_cpu::get_cpu_flags(); $features = array(array('Frequency', phodevi::read_property('cpu', 'mhz-default-frequency') . ' MHz'), array('Core Count', phodevi_cpu::cpuinfo_core_count()), array('Thread Count', phodevi_cpu::cpuinfo_thread_count()), array('Cache Size', phodevi_cpu::cpuinfo_cache_size() . ' KB'), array('Instruction Set Extensions', phodevi_cpu::instruction_set_extensions()), array('AES Encryption', $cpu_flags & phodevi_cpu::get_cpu_feature_constant('aes') ? 'YES' : 'NO'), array('Energy Performance Bias', $cpu_flags & phodevi_cpu::get_cpu_feature_constant('epb') ? 'YES' : 'NO'), array('Virtualization', phodevi_cpu::virtualization_technology() ? phodevi_cpu::virtualization_technology() : 'NO'), array('Scaling Governor', phodevi::read_property('cpu', 'scaling-governor'))); $software_features = array(); break; case 'GPU': $model = phodevi::read_property('gpu', 'model'); $ob_type = 'Graphics'; $sensor_flag = 'all.gpu'; $features = array(array('Frequency', implode(' / ', phodevi::read_property('gpu', 'stock-frequency')) . ' MHz'), array('vRAM Capacity', phodevi::read_property('gpu', 'memory-capacity') . ' MB'), array('Compute Cores', phodevi::read_property('gpu', 'compute-cores')), array('Screen Resolution', phodevi::read_property('gpu', 'screen-resolution-string')), array('2D Acceleration', phodevi::read_property('gpu', '2d-acceleration'))); $software_features = array(array('Video Driver', phodevi::read_property('system', 'display-driver-string')), array('OpenGL Driver', phodevi::read_property('system', 'opengl-driver')), array('Kernel', phodevi::read_property('system', 'kernel')), array('Video Drivers', phodevi::read_property('system', 'display-driver-string')), array('Display Server', phodevi::read_property('system', 'display-server'))); break; case 'Motherboard': $model = phodevi::read_property('motherboard', 'identifier'); $ob_type = 'System'; $sensor_flag = 'all.sys'; $features = array(array('Chipset', phodevi::read_property('chipset', 'identifier')), array('Serial Number', phodevi::read_property('motherboard', 'serial-number')), array('Network', phodevi::read_property('network', 'identifier')), array('Audio', phodevi::read_property('audio', 'identifier'))); $software_features = array(); break; case 'Disk': $model = phodevi::read_property('disk', 'identifier'); $ob_type = 'Disk'; $sensor_flag = 'all.hdd'; $mo = phodevi::read_property('disk', 'mount-options'); $mo = isset($mo['mount-options']) ? $mo['mount-options'] : null; $features = array(array('I/O Scheduler', phodevi::read_property('disk', 'scheduler')), array('Mount Options', $mo), array('File-System', phodevi::read_property('system', 'filesystem'))); $software_features = array(); break; case 'Memory': $model = phodevi::read_property('memory', 'identifier'); $ob_type = 'Memory'; $sensor_flag = 'all.memory'; $features = array(); $software_features = array(); break; case 'Software': $model = phodevi::read_property('system', 'operating-system'); $ob_type = ''; $sensor_flag = 'all.sys'; $features = array(array('Kernel', phodevi::read_property('system', 'kernel-string')), array('Compiler', phodevi::read_property('system', 'compiler')), array('Desktop', phodevi::read_property('system', 'desktop-environment')), array('Display Server', phodevi::read_property('system', 'display-server')), array('Display Driver', phodevi::read_property('system', 'display-driver-string')), array('OpenGL Driver', phodevi::read_property('system', 'opengl-driver')), array('File-System', phodevi::read_property('system', 'filesystem')), array('System Layer', phodevi::read_property('system', 'system-layer'))); $software_features = array(array('Kernel Parameters', phodevi::read_property('system', 'kernel-parameters')), array('Hostname', phodevi::read_property('system', 'hostname')), array('Local IP Address', $_SERVER['HTTP_HOST'])); break; } echo '<h1>' . $model . '</h1>'; echo '<div id="pts_side_pane" style="max-width: 30%;">'; if (!empty($features)) { echo '<h2>' . $COMPONENT . ' Features</h2>'; echo '<ul>'; foreach ($features as $feature) { if (isset($feature[1])) { $feature[0] .= ':'; if ($feature[1] == null) { $feature[1] = 'N/A'; } } $feature[0] = '<strong>' . $feature[0] . '</strong>'; echo '<li>' . implode(' ', $feature) . '</li>' . PHP_EOL; } echo '</ul>'; echo '<hr />'; } if (!empty($software_features)) { echo '<h2>' . $COMPONENT . ' Software Features</h2>'; echo '<ul>'; foreach ($software_features as $feature) { if (isset($feature[1])) { $feature[0] .= ':'; if ($feature[1] == null) { $feature[1] = 'N/A'; } } $feature[0] = '<strong>' . $feature[0] . '</strong>'; echo '<li>' . implode(' ', $feature) . '</li>' . PHP_EOL; } echo '</ul>'; echo '<hr />'; } echo '<div class="pts_pane_window">Log-in to OpenBenchmarking.org to gain access to more functionality.</div>'; echo '</div>'; echo '<div id="svg_graphs" style="margin: 10px 0; text-align: right;"></div>'; echo '<div id="tests_by_popularity" style="margin: 10px 0; text-align: left;"></div>'; echo '<div id="system_log_viewer"><select id="log_viewer_selector" onchange="javascript:log_viewer_change(); return true;"></select><div id="system_log_display"></div></div>'; echo '<script text="text/javascript"> pts_web_socket.submit_event("user-svg-system-graphs ' . $sensor_flag . '", "svg_graphs", "update_svg_graph_space"); pts_web_socket.submit_event("available-system-logs System ' . $COMPONENT . '", "available_system_logs", "update_system_log_viewer"); pts_web_socket.submit_event("tests-by-popularity 6 ' . $ob_type . '", "tests_by_popularity", "tests_by_popularity_display"); setInterval(function(){if(pts_web_socket.is_connected()) { pts_web_socket.send("user-svg-system-graphs ' . $sensor_flag . '"); }},1000); </script>'; }