phodevi: Couple minor fixes

This commit is contained in:
Michael Larabel
2024-05-05 04:59:54 -05:00
parent 6fcb962514
commit bb7da532c7
3 changed files with 31 additions and 9 deletions

View File

@@ -63,7 +63,11 @@ class ob_test_profile_analyze implements pts_option_interface
if(!empty($test_binary) && is_executable($test_binary))
{
$ldd = trim(shell_exec('ldd ' . $test_binary));
$ldd = shell_exec('ldd ' . $test_binary);
if(!empty($ldd))
{
$ldd = trim($ldd);
}
foreach(explode(PHP_EOL, $ldd) as $line)
{

View File

@@ -811,12 +811,21 @@ class phodevi_cpu extends phodevi_device_interface
case '0xd82':
$new_info .= ' Cortex-X4';
break;
case '0xd83':
$new_info .= ' Neoverse-V3AE';
break;
case '0xd84':
$new_info .= ' Neoverse-V3';
break;
case '0xd88':
$new_info .= ' Cortex-A520E';
break;
case '0xd89':
$new_info .= ' Cortex-A720E';
break;
case '0xd8e':
$new_info .= ' Neoverse-N3';
break;
}
}
else if($implementer == '0x61')

View File

@@ -3,8 +3,8 @@
/*
Phoronix Test Suite
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
Copyright (C) 2009 - 2021, Phoronix Media
Copyright (C) 2009 - 2021, Michael Larabel
Copyright (C) 2009 - 2024, Phoronix Media
Copyright (C) 2009 - 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
@@ -210,14 +210,23 @@ class sys_power extends phodevi_sensor
}
private static function watts_up_power_meter()
{
$output = trim(shell_exec('wattsup -c 1 ttyUSB0 watts 2>&1'));
$output = explode(PHP_EOL, $output);
do
// Sometimes Wattsup have read failures returning 0....
for($i = 0; $i < 3; $i++)
{
$value = array_pop($output);
$output = trim(shell_exec('wattsup -c 1 ttyUSB0 watts 2>&1'));
$output = explode(PHP_EOL, $output);
do
{
$value = array_pop($output);
}
while(!is_numeric($value) && count($output) > 0);
if(is_numeric($value) && $value > 0)
{
break;
}
}
while(!is_numeric($value) && count($output) > 0);
return is_numeric($value) ? $value : -1;
}