pts-core: Minor fixes over time
This commit is contained in:
75
pts-core/commands/prune_extra_data.php
Normal file
75
pts-core/commands/prune_extra_data.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2024, Phoronix Media
|
||||
Copyright (C) 2024, 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 prune_extra_data implements pts_option_interface
|
||||
{
|
||||
const doc_section = 'Result Management';
|
||||
const doc_description = 'This option is used to remove any extra/erroneous data from appearing if any duplicate result entries or other data appears within a saved result file. This option is typically only used for testing or encountering any errored result files.';
|
||||
|
||||
public static function argument_checks()
|
||||
{
|
||||
return array(
|
||||
new pts_argument_check(0, array('pts_types', 'is_result_file'), null)
|
||||
);
|
||||
}
|
||||
public static function run($r)
|
||||
{
|
||||
$result_file = new pts_result_file($r[0]);
|
||||
$result_count_with_extra_data = 0;
|
||||
$table = array();
|
||||
$system_identifiers = $result_file->get_system_identifiers();
|
||||
foreach($result_file->get_result_objects() as &$result_object)
|
||||
{
|
||||
foreach($result_object->test_result_buffer as &$buffers)
|
||||
{
|
||||
if(empty($buffers))
|
||||
continue;
|
||||
|
||||
foreach($buffers as &$buffer_item)
|
||||
{
|
||||
if(!in_array($buffer_item->get_result_identifier(), $system_identifiers))
|
||||
{
|
||||
$result_count_with_extra_data++;
|
||||
echo $result_object->test_profile->get_title() . ' ' . $result_object->get_arguments_description() . '!!!!' . $buffer_item->get_result_identifier() . PHP_EOL;
|
||||
$result_object->test_result_buffer->remove($buffer_item->get_result_identifier());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($result_count_with_extra_data == 0)
|
||||
{
|
||||
echo 'No result objects found with zero data.';
|
||||
}
|
||||
else
|
||||
{
|
||||
$do_save = pts_user_io::prompt_bool_input('Save the result file changes?');
|
||||
if($do_save)
|
||||
{
|
||||
pts_client::save_test_result($result_file->get_file_location(), $result_file->get_xml());
|
||||
pts_client::display_result_view($result_file, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
122
pts-core/commands/prune_zero_data.php
Normal file
122
pts-core/commands/prune_zero_data.php
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2024, Phoronix Media
|
||||
Copyright (C) 2024, 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 prune_zero_data implements pts_option_interface
|
||||
{
|
||||
const doc_section = 'Result Management';
|
||||
const doc_description = 'This option is used if there are test results (benchmarks) to be where there is line graph data that currently has zero values (e.g. inaccurate/invalid sensor readings) and you wish to just drop those zero reading values from the result file.';
|
||||
|
||||
public static function argument_checks()
|
||||
{
|
||||
return array(
|
||||
new pts_argument_check(0, array('pts_types', 'is_result_file'), null)
|
||||
);
|
||||
}
|
||||
public static function run($r)
|
||||
{
|
||||
$result_file = new pts_result_file($r[0]);
|
||||
$result_count_with_zero_data = 0;
|
||||
$table = array();
|
||||
foreach($result_file->get_result_objects() as &$result_object)
|
||||
{
|
||||
foreach($result_object->test_result_buffer as &$buffers)
|
||||
{
|
||||
if(empty($buffers))
|
||||
continue;
|
||||
|
||||
foreach($buffers as &$buffer_item)
|
||||
{
|
||||
$v = $buffer_item->get_result_value();
|
||||
|
||||
// Example Hacky workaround to correct existing recorded data such as from this bug of double reporting CPU power - https://lore.kernel.org/lkml/20240719092545.50441-3-Dhananjay.Ugwekar@amd.com/
|
||||
/*
|
||||
if(stripos($v, ',') !== false && stripos($buffer_item->get_result_identifier(), 'Ryzen 9 79') !== false)
|
||||
{
|
||||
$encountered_zero = false;
|
||||
$v = explode(',', $v);
|
||||
$new_v = array();
|
||||
for($i = 0; $i < count($v); $i++)
|
||||
{
|
||||
$encountered_zero = true;
|
||||
$new_v[] = round($v[$i] / 2, 2);
|
||||
}
|
||||
if($encountered_zero)
|
||||
{
|
||||
$buffer_item->reset_result_value(implode(',', $new_v));
|
||||
$result_count_with_zero_data++;
|
||||
echo $result_object->test_profile->get_title() . ' ' . $result_object->get_arguments_description() . '!!!!' . PHP_EOL;
|
||||
}
|
||||
}
|
||||
else if(stripos($result_object->test_profile->get_result_scale(), 'Per Watt') !== false && stripos($buffer_item->get_result_identifier(), 'Ryzen 9 79') !== false)
|
||||
{
|
||||
$num_p = pts_math::get_precision($v);
|
||||
$v = round($v * 2, $num_p);
|
||||
$buffer_item->reset_result_value($v);
|
||||
$result_count_with_zero_data++;
|
||||
echo $result_object->test_profile->get_title() . ' ' . $result_object->get_arguments_description() . '!!!!' . PHP_EOL;
|
||||
}
|
||||
*/
|
||||
if(stripos($v, ',') !== false)
|
||||
{
|
||||
$encountered_zero = false;
|
||||
$v = explode(',', $v);
|
||||
$new_v = array();
|
||||
for($i = 0; $i < count($v); $i++)
|
||||
{
|
||||
if($v[$i] == 0 || $v[$i] == "0.0")
|
||||
{
|
||||
// Zero data
|
||||
$encountered_zero = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$new_v[] = $v[$i];
|
||||
}
|
||||
}
|
||||
if($encountered_zero)
|
||||
{
|
||||
$buffer_item->reset_result_value(implode(',', $new_v));
|
||||
$result_count_with_zero_data++;
|
||||
echo $result_object->test_profile->get_title() . ' ' . $result_object->get_arguments_description() . ' ' . PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($result_count_with_zero_data == 0)
|
||||
{
|
||||
echo 'No result objects found with zero data.';
|
||||
}
|
||||
else
|
||||
{
|
||||
$do_save = pts_user_io::prompt_bool_input('Save the result file changes?');
|
||||
if($do_save)
|
||||
{
|
||||
pts_client::save_test_result($result_file->get_file_location(), $result_file->get_xml());
|
||||
pts_client::display_result_view($result_file, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -4,7 +4,7 @@
|
||||
if [ `whoami` = "root" ] && [ ! -w /usr/bin/sudo ]; then
|
||||
yum -y install $*
|
||||
elif [ -x /usr/bin/dnf ]; then
|
||||
sudo dnf -y install $*
|
||||
sudo dnf -y --skip-unavailable install $*
|
||||
elif [ `whoami` = "ec2-user" ]; then
|
||||
sudo yum -y --skip-broken install $*
|
||||
else
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/*
|
||||
Phoronix Test Suite
|
||||
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
|
||||
Copyright (C) 2009 - 2019, Phoronix Media
|
||||
Copyright (C) 2009 - 2019, Michael Larabel
|
||||
Copyright (C) 2009 - 2025, Phoronix Media
|
||||
Copyright (C) 2009 - 2025, 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
|
||||
@@ -84,12 +84,15 @@ class gpu_temp extends phodevi_sensor
|
||||
{
|
||||
// This works on the NVIDIA Jetson TX1
|
||||
// On the TX1 the name = GPU-therm
|
||||
if(is_readable($temp_name) == false || stripos(file_get_contents($temp_name), 'GPU') === false)
|
||||
// Or on Intel Xe/Arc Graphics is "xe" name
|
||||
$name_contents = file_get_contents($temp_name);
|
||||
if(is_readable($temp_name) == false || (stripos($name_contents, 'GPU') === false && stripos($name_contents, 'xe') === false))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$temp_input_file = dirname($temp_name) . '/temp1_input';
|
||||
$temp_input_files = pts_file_io::glob(dirname($temp_name) . '/temp*_input');
|
||||
$temp_input_file = !empty($temp_input_files) ? $temp_input_files[0] : false;
|
||||
|
||||
if(!is_file($temp_input_file))
|
||||
{
|
||||
|
||||
@@ -322,7 +322,7 @@ class pts_render
|
||||
{
|
||||
$paint_color = '#f1052d';
|
||||
}
|
||||
else if(strpos($i, 'intel ') !== false || strpos($i, 'xeon ') !== false || strpos($i, 'core i') !== false || strpos($i, 'core ultra') !== false || strpos($i, 'pentium') !== false || strpos($i, 'celeron') !== false)
|
||||
else if(strpos($i, 'intel ') !== false || strpos($i, 'xeon ') !== false || strpos($i, 'core i') !== false || strpos($i, 'core ultra') !== false || strpos($i, 'pentium') !== false || strpos($i, 'celeron') !== false || strpos($i, 'Arc ') !== false)
|
||||
{
|
||||
$paint_color = '#0b5997';
|
||||
}
|
||||
|
||||
@@ -404,7 +404,7 @@ class pts_strings
|
||||
$str = str_ireplace($original_phrase, $new_phrase, $str);
|
||||
}
|
||||
|
||||
$remove_phrases = array('incorporation', 'corporation', 'corp.', 'invalid', 'technologies', 'technology', ' version', ' project ', 'computer', 'To Be Filled By', 'ODM', 'O.E.M.', 'Desktop Reference Platform', 'small form factor', 'convertible', ' group', 'chipset', 'community', 'reference', 'communications', 'semiconductor', 'processor', 'host bridge', 'adapter', ' CPU', 'platform', 'international', 'express', 'graphics', ' none', 'electronics', 'integrated', 'alternate', 'quad-core', 'memory', 'series', 'network', 'motherboard', 'electric ', 'industrial ', 'serverengines', 'Manufacturer', 'x86/mmx/sse2', '/AGP/SSE/3DNOW!', '/AGP/SSE2', 'controller', '(extreme graphics innovation)', 'pci-e_gfx and ht3 k8 part', 'pci-e_gfx and ht1 k8 part', 'Northbridge only', 'dual slot', 'dual-core', 'dual core', 'microsystems', 'not specified', 'single slot', 'genuine', 'unknown device', 'systemberatung', 'gmbh', 'graphics adapter', 'video device', 'http://', 'www.', '.com', '.tw/', '/pci/sse2/3dnow!', '/pcie/sse2', '/pci/sse2', 'balloon', 'network connection', 'ethernet', ' to ', ' fast ', 'limited.', ' systems', ' system', 'compliant', 'co. ltd', 'co.', 'ltd.', 'LTD ', ' LTD', '\AE', '(r)', '(tm)', 'inc.', 'inc', '6.00 PG', ',', '\'', '_ ', '_ ', 'corp', 'product name', 'base board', 'mainboard', 'pci to pci', ' release ', 'nee ', 'default string', ' AG ', '/DRAM', 'shared ', ' sram', 'and subsidiaries', ' SCSI', 'Disk Device', ' ATA', 'Daughter Card', 'Gigabit Connection', 'altivec supported', ' family', ' ing');
|
||||
$remove_phrases = array('incorporation', 'corporation', 'corp.', 'invalid', 'technologies', 'technology', ' version', ' project ', 'computer', 'To Be Filled By', 'ODM', 'O.E.M.', 'Desktop Reference Platform', 'small form factor', 'convertible', ' group', 'chipset', 'community', 'reference', 'communications', 'semiconductor', 'processor', 'host bridge', 'adapter', ' CPU', 'platform', 'international', 'express', 'graphics', ' none', 'electronics', 'integrated', 'alternate', 'quad-core', 'memory', 'series', 'network', 'motherboard', 'electric ', 'industrial ', 'serverengines', 'Manufacturer', 'x86/mmx/sse2', '/AGP/SSE/3DNOW!', '/AGP/SSE2', 'controller', '(extreme graphics innovation)', 'pci-e_gfx and ht3 k8 part', 'pci-e_gfx and ht1 k8 part', 'Northbridge only', 'dual slot', 'dual-core', 'dual core', 'microsystems', 'not specified', 'single slot', 'genuine', 'unknown device', 'systemberatung', 'gmbh', 'graphics adapter', 'video device', 'http://', 'www.', '.com', '.tw/', '/pci/sse2/3dnow!', '/pcie/sse2', '/pci/sse2', 'balloon', 'network connection', 'ethernet', ' to ', ' fast ', 'limited.', ' systems', ' system', 'compliant', 'co. ltd', 'co.', 'ltd.', 'LTD ', ' LTD', '\AE', '(r)', '(tm)', 'inc.', ' inch ', 'inc', '6.00 PG', ',', '\'', '_ ', '_ ', 'corp', 'product name', 'base board', 'mainboard', 'pci to pci', ' release ', 'nee ', 'default string', ' AG ', '/DRAM', 'shared ', ' sram', 'and subsidiaries', ' SCSI', 'Disk Device', ' ATA', 'Daughter Card', 'Gigabit Connection', 'altivec supported', ' family', ' ing');
|
||||
$str = str_ireplace($remove_phrases, ' ', $str . ' ');
|
||||
|
||||
if(($w = stripos($str, 'WARNING')) !== false)
|
||||
|
||||
Reference in New Issue
Block a user