mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 08:11:39 +00:00
Quick bug fix release. With as many changes as we got in 3.3.10, there were
bound to be a handful of oversights that were not caught in testing simply because those hardware scenarios were not present in the tested systems. Also minor feature enhancement for CPU scaling min/max speeds. -------------------------------------------------------------------------------- KNOWN ISSUES: 1. Due to the huge amount of changes, and the speed of change, while the new code is working as intended, it's somewhat lacking in coding elegance since a lot of it was hacked out very quickly, in near real time. This will get cleaned up and refactored to be less redundant if it does not impact execution speed, but is not pressing since there should be no functional difference. -------------------------------------------------------------------------------- BUGS: 1. Tiny oversight, in single case CPU model id would fail because it was using an undefined test from previous tests, not the right test, that is. Tripped error on Elbrus for example. 2. Typo in battery secondary type status, created undefined value error. This was I believe an older bug. -------------------------------------------------------------------------------- FIXES: 1. PPC revision change broke Elbrus revision test for stepping. Added in more tests to show stepping for elbrus revision. 2. Single core Elbrus in cpuinfo fallback mode failed to assign core multiplier so L1 cache failed. 3. In cpuinfo fallback mode, Elbrus E2C3 cache data failed to appear, that data in not per block in cpuinfo, but is the last block, so those tests had to run on each block, not just the first one. -------------------------------------------------------------------------------- ENHANCEMENTS: 1. Show for -Ca scaling min/max speeds if different from CPU min/max speeds. 2. If no cpuinfo_min/max_freq speeds found, and scaling_min/max_freq found, set overall min/max to use scaling min/max instead of cpuinfo min/max. -------------------------------------------------------------------------------- CHANGES: 1. None. -------------------------------------------------------------------------------- DOCUMENTATION: 1. Cleaned up and proofread better 3.3.10 changelog, it had a lot of errors because stuff kept changing. -------------------------------------------------------------------------------- CODE: 1. Small code optimizations.
This commit is contained in:
parent
c3d0e551a4
commit
ec8ab3c213
208
inxi
208
inxi
|
@ -47,8 +47,8 @@ use POSIX qw(ceil uname strftime ttyname);
|
|||
|
||||
## INXI INFO ##
|
||||
my $self_name='inxi';
|
||||
my $self_version='3.3.10';
|
||||
my $self_date='2021-12-13';
|
||||
my $self_version='3.3.11';
|
||||
my $self_date='2021-12-16';
|
||||
my $self_patch='00';
|
||||
## END INXI INFO ##
|
||||
my ($b_pledge,@pledges);
|
||||
|
@ -7585,7 +7585,6 @@ sub battery_output {
|
|||
$charge = 'N/A';
|
||||
}
|
||||
$model = $battery->{$key}{'model_name'} if $battery->{$key}{'model_name'};
|
||||
$status = ($battery->{$key}{'status'}) ? $battery->{$key}{'staus'}: 'N/A' ;
|
||||
$vendor = $battery->{$key}{'manufacturer'} if $battery->{$key}{'manufacturer'};
|
||||
if ($vendor || $model){
|
||||
if ($vendor && $model){
|
||||
|
@ -7610,6 +7609,7 @@ sub battery_output {
|
|||
if ($extra > 2 && $upower_data{'rechargeable'}){
|
||||
$rows[$j]->{main::key($num++,0,2,'rechargeable')} = $upower_data{'rechargeable'};
|
||||
}
|
||||
$status = ($battery->{$key}{'status'}) ? $battery->{$key}{'status'}: 'N/A' ;
|
||||
$rows[$j]->{main::key($num++,0,2,'status')} = $status;
|
||||
}
|
||||
}
|
||||
|
@ -8591,6 +8591,10 @@ sub full_output {
|
|||
$rows[$j]->{main::key($num++,0,3,'driver')} = $cpu->{'scaling-driver'};
|
||||
$cpu->{'governor'} ||= 'N/A';
|
||||
$rows[$j]->{main::key($num++,0,3,'governor')} = $cpu->{'governor'};
|
||||
# only set if different from cpu min/max
|
||||
if ($cpu->{'scaling-min-max'} && $cpu->{'scaling-min-max-key'}){
|
||||
$rows[$j]->{main::key($num++,0,3,$cpu->{'scaling-min-max-key'})} = $cpu->{'scaling-min-max'};
|
||||
}
|
||||
}
|
||||
if ($extra > 2){
|
||||
if ($properties->{'volts'}){
|
||||
|
@ -8858,7 +8862,7 @@ sub cpuinfo_data {
|
|||
$cpu{'sys-freq'} = \%freq if %freq;
|
||||
}
|
||||
}
|
||||
cpuinfo_data_grabber($file) if !$loaded{'cpuinfo'};
|
||||
cpuinfo_data_grabber($file,\$cpu{'type'}) if !$loaded{'cpuinfo'};
|
||||
$cpu{'type'} = cpu_vendor($cpu_arch) if $cpu_arch =~ /e2k/; # already set to lower
|
||||
my ($core_count,$proc_count,$speed) = (0,0,0);
|
||||
my ($b_block_1) = (1);
|
||||
|
@ -8912,21 +8916,21 @@ sub cpuinfo_data {
|
|||
# note: stepping and ARM cpu revision are integers
|
||||
$temp = main::get_defined($block->{'stepping'},$block->{'cpu revision'});
|
||||
# can be 0, but can be 'unknown'
|
||||
if (defined $temp){
|
||||
if (defined $temp ||
|
||||
($cpu{'type'} eq 'elbrus' && defined $block->{'revision'})){
|
||||
$temp = $block->{'revision'} if defined $block->{'revision'};
|
||||
if ($temp =~ /^\d+$/){
|
||||
$cpu{'stepping'} = uc(sprintf("%x",$temp));
|
||||
}
|
||||
}
|
||||
# PPC revision is a string
|
||||
# PPC revision is a string, but elbrus revision is hex
|
||||
elsif (defined $block->{'revision'}){
|
||||
$cpu{'revision'} = $block->{'revision'};
|
||||
}
|
||||
# this is hex so uc for cpu arch id. raspi 4 has Model rather than Hardware
|
||||
if (defined $block->{'model'}){
|
||||
# can be 0, but can be 'unknown'
|
||||
if ($temp =~ /^\d+$/){
|
||||
$cpu{'model-id'} = uc(sprintf("%x",$block->{'model'}));
|
||||
}
|
||||
$cpu{'model-id'} = uc(sprintf("%x",$block->{'model'}));
|
||||
}
|
||||
if ($block->{'cpu variant'}){
|
||||
$cpu{'model-id'} = uc($block->{'cpu variant'});
|
||||
|
@ -8956,25 +8960,6 @@ sub cpuinfo_data {
|
|||
$block->{'l3 cache size'} =~ /(\d+\s*[KMG])i?B?$/){
|
||||
$cpu{'l3-cache'} = main::translate_size($1);
|
||||
}
|
||||
if ($cpu{'type'} eq 'elbrus'){
|
||||
# note: cache0 is L1i and cache1 L1d. cp_caches_fallback handles
|
||||
if (!$cpu{'l1i-cache'} && $block->{'cache0'} &&
|
||||
$block->{'cache0'} =~ /size\s*=\s*(\d+)K\s/){
|
||||
$cpu{'l1i-cache'} = $1;
|
||||
}
|
||||
if (!$cpu{'l1d-cache'} && $block->{'cache1'} &&
|
||||
$block->{'cache1'} =~ /size\s*=\s*(\d+)K\s/){
|
||||
$cpu{'l1d-cache'} = $1;
|
||||
}
|
||||
if (!$cpu{'l2-cache'} && $block->{'cache2'} &&
|
||||
$block->{'cache2'} =~ /size\s*=\s*(\d+)(K|M)\s/){
|
||||
$cpu{'l2-cache'} = ($2 eq 'M') ? ($1*1024) : $1;
|
||||
}
|
||||
if (!$cpu{'l3-cache'} && $block->{'cache3'} &&
|
||||
$block->{'cache3'} =~ /size\s*=\s*(\d+)(K|M)\s/){
|
||||
$cpu{'l3-cache'} = ($2 eq 'M') ? ($1*1024) : $1;
|
||||
}
|
||||
}
|
||||
$temp = main::get_defined($block->{'flags'} || $block->{'features'});
|
||||
if ($temp){
|
||||
$cpu{'flags'} = $temp;
|
||||
|
@ -8997,6 +8982,28 @@ sub cpuinfo_data {
|
|||
}
|
||||
}
|
||||
}
|
||||
# These occurs in a separate block with E2C3, last in cpuinfo blocks,
|
||||
# otherwise per block in E8C variants
|
||||
if ($cpu{'type'} eq 'elbrus' && (!$cpu{'l1i-cache'} &&
|
||||
!$cpu{'l1d-cache'} && !$cpu{'l2-cache'} && !$cpu{'l3-cache'})){
|
||||
# note: cache0 is L1i and cache1 L1d. cp_caches_fallback handles
|
||||
if ($block->{'cache0'} &&
|
||||
$block->{'cache0'} =~ /size\s*=\s*(\d+)K\s/){
|
||||
$cpu{'l1i-cache'} = $1;
|
||||
}
|
||||
if ($block->{'cache1'} &&
|
||||
$block->{'cache1'} =~ /size\s*=\s*(\d+)K\s/){
|
||||
$cpu{'l1d-cache'} = $1;
|
||||
}
|
||||
if ($block->{'cache2'} &&
|
||||
$block->{'cache2'} =~ /size\s*=\s*(\d+)(K|M)\s/){
|
||||
$cpu{'l2-cache'} = ($2 eq 'M') ? ($1*1024) : $1;
|
||||
}
|
||||
if ($block->{'cache3'} &&
|
||||
$block->{'cache3'} =~ /size\s*=\s*(\d+)(K|M)\s/){
|
||||
$cpu{'l3-cache'} = ($2 eq 'M') ? ($1*1024) : $1;
|
||||
}
|
||||
}
|
||||
## Start incrementers
|
||||
$temp = main::get_defined($block->{'cpu mhz'},$block->{'clock'});
|
||||
if ($temp){
|
||||
|
@ -9050,7 +9057,7 @@ sub cpuinfo_data {
|
|||
}
|
||||
sub cpuinfo_data_grabber {
|
||||
eval $start if $b_log;
|
||||
my ($file) = @_;
|
||||
my ($file,$cpu_type) = @_; # type by ref
|
||||
$loaded{'cpuinfo'} = 1;
|
||||
# use --arm flag when testing arm cpus, and --fake-cpu to trigger fake data
|
||||
if ($fake{'cpu'}){
|
||||
|
@ -9058,7 +9065,7 @@ sub cpuinfo_data_grabber {
|
|||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/android-pocom3-fake-cpuinfo.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/arm-pine64-cpuinfo-1.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/arm-riscyslack2-cpuinfo-1.txt";
|
||||
$file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/ppc-stuntkidz~cpuinfo.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/ppc-stuntkidz~cpuinfo.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/riscv-unmatched-2021~cpuinfo-1.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/x86-brickwizard-atom-n270~cpuinfo-1.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/x86-amd-phenom-chrisretusn-cpuinfo-1.txt";
|
||||
|
@ -9080,7 +9087,7 @@ sub cpuinfo_data_grabber {
|
|||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/amd/4-core-althlon-mjro.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/amd/4-core-apu-vc-box.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/amd/4-core-a10-5800k-1.txt";
|
||||
$file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/intel/1-core-486-fourtysixandtwo.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/intel/1-core-486-fourtysixandtwo.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/intel/2-core-ht-atom-bruh.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/intel/core-2-i3.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/intel/8-core-i7-damentz64.txt";
|
||||
|
@ -9091,7 +9098,7 @@ sub cpuinfo_data_grabber {
|
|||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/intel/4-1-core-xeon-vps-frodo1.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/intel/4-6-core-xeon-no-mt-lathander.txt";
|
||||
## Elbrus
|
||||
# $cpu{'type'} = 'elbrus'; # uncomment to test elbrus
|
||||
# $$cpu_type = 'elbrus'; # uncomment to test elbrus
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/elbrus/elbrus-2c3/cpuinfo.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/elbrus/1xE1C-8.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/elbrus/1xE2CDSP-4.txt";
|
||||
|
@ -9156,7 +9163,7 @@ sub cpu_sys_data {
|
|||
return \%cpu_sys if !%{$working};
|
||||
$cpu_sys{'data'} = $working->{'data'} if $working->{'data'};
|
||||
my ($core_id,$fake_core_id,$phys_id,) = (0,0,-1);
|
||||
my (%cache_ids,@freq_max,@freq_min);
|
||||
my (%cache_ids,@ci_freq_max,@ci_freq_min,@sc_freq_max,@sc_freq_min);
|
||||
foreach my $key (sort keys %{$working->{'cpus'}}){
|
||||
($core_id,$phys_id) = (0,0);
|
||||
my $cpu_id = $key + 0;
|
||||
|
@ -9194,8 +9201,8 @@ sub cpu_sys_data {
|
|||
# For max / min, we want to prep for the day 1 pys cpu has > 1 min/max freq
|
||||
if (defined $cpu->{'cpufreq'}{'cpuinfo_max_freq'}){
|
||||
$cpu->{'cpufreq'}{'cpuinfo_max_freq'} = clean_speed($cpu->{'cpufreq'}{'cpuinfo_max_freq'},'khz');
|
||||
if (!grep {$_ eq $cpu->{'cpufreq'}{'cpuinfo_max_freq'}} @freq_max){
|
||||
push(@freq_max,$cpu->{'cpufreq'}{'cpuinfo_max_freq'});
|
||||
if (!grep {$_ eq $cpu->{'cpufreq'}{'cpuinfo_max_freq'}} @ci_freq_max){
|
||||
push(@ci_freq_max,$cpu->{'cpufreq'}{'cpuinfo_max_freq'});
|
||||
}
|
||||
if (!grep {$_ eq $cpu->{'cpufreq'}{'cpuinfo_max_freq'}} @{$cpu_sys{'cpus'}->{$phys_id}{'max-freq'}}){
|
||||
push(@{$cpu_sys{'cpus'}->{$phys_id}{'max-freq'}},$cpu->{'cpufreq'}{'cpuinfo_max_freq'});
|
||||
|
@ -9203,13 +9210,31 @@ sub cpu_sys_data {
|
|||
}
|
||||
if (defined $cpu->{'cpufreq'}{'cpuinfo_min_freq'}){
|
||||
$cpu->{'cpufreq'}{'cpuinfo_min_freq'} = clean_speed($cpu->{'cpufreq'}{'cpuinfo_min_freq'},'khz');
|
||||
if (!grep {$_ eq $cpu->{'cpufreq'}{'cpuinfo_min_freq'}} @freq_min){
|
||||
push(@freq_min,$cpu->{'cpufreq'}{'cpuinfo_min_freq'});
|
||||
if (!grep {$_ eq $cpu->{'cpufreq'}{'cpuinfo_min_freq'}} @ci_freq_min){
|
||||
push(@ci_freq_min,$cpu->{'cpufreq'}{'cpuinfo_min_freq'});
|
||||
}
|
||||
if (!grep {$_ eq $cpu->{'cpufreq'}{'cpuinfo_min_freq'}} @{$cpu_sys{'cpus'}->{$phys_id}{'min-freq'}}){
|
||||
push(@{$cpu_sys{'cpus'}->{$phys_id}{'min-freq'}},$cpu->{'cpufreq'}{'cpuinfo_min_freq'});
|
||||
}
|
||||
}
|
||||
if (defined $cpu->{'cpufreq'}{'scaling_max_freq'}){
|
||||
$cpu->{'cpufreq'}{'scaling_max_freq'} = clean_speed($cpu->{'cpufreq'}{'scaling_max_freq'},'khz');
|
||||
if (!grep {$_ eq $cpu->{'cpufreq'}{'scaling_max_freq'}} @sc_freq_max){
|
||||
push(@sc_freq_max,$cpu->{'cpufreq'}{'scaling_max_freq'});
|
||||
}
|
||||
if (!grep {$_ eq $cpu->{'cpufreq'}{'scaling_max_freq'}} @{$cpu_sys{'cpus'}->{$phys_id}{'max-freq'}}){
|
||||
push(@{$cpu_sys{'cpus'}->{$phys_id}{'max-freq'}},$cpu->{'cpufreq'}{'scaling_max_freq'});
|
||||
}
|
||||
}
|
||||
if (defined $cpu->{'cpufreq'}{'scaling_min_freq'}){
|
||||
$cpu->{'cpufreq'}{'scaling_min_freq'} = clean_speed($cpu->{'cpufreq'}{'scaling_min_freq'},'khz');
|
||||
if (!grep {$_ eq $cpu->{'cpufreq'}{'scaling_min_freq'}} @sc_freq_min){
|
||||
push(@sc_freq_min,$cpu->{'cpufreq'}{'scaling_min_freq'});
|
||||
}
|
||||
if (!grep {$_ eq $cpu->{'cpufreq'}{'scaling_min_freq'}} @{$cpu_sys{'cpus'}->{$phys_id}{'min-freq'}}){
|
||||
push(@{$cpu_sys{'cpus'}->{$phys_id}{'min-freq'}},$cpu->{'cpufreq'}{'scaling_min_freq'});
|
||||
}
|
||||
}
|
||||
if (defined $cpu->{'cpufreq'}{'scaling_governor'}){
|
||||
if (!grep {$_ eq $cpu->{'cpufreq'}{'scaling_governor'}} @{$cpu_sys{'cpus'}->{$phys_id}{'governor'}}){
|
||||
push(@{$cpu_sys{'cpus'}->{$phys_id}{'governor'}},$cpu->{'cpufreq'}{'scaling_governor'});
|
||||
|
@ -9268,13 +9293,27 @@ sub cpu_sys_data {
|
|||
}
|
||||
# cpuinfo_max_freq:["2000000"] cpuinfo_max_freq:["1500000"]
|
||||
# cpuinfo_min_freq:["200000"]
|
||||
if (@freq_max){
|
||||
$cpu_sys{'data'}->{'speeds'}{'max-freq'} = join(':',@freq_max);
|
||||
if (@ci_freq_max){
|
||||
$cpu_sys{'data'}->{'speeds'}{'max-freq'} = join(':',@ci_freq_max);
|
||||
}
|
||||
if (@freq_min){
|
||||
$cpu_sys{'data'}->{'speeds'}{'min-freq'} = join(':',@freq_min);
|
||||
if (@ci_freq_min){
|
||||
$cpu_sys{'data'}->{'speeds'}{'min-freq'} = join(':',@ci_freq_min);
|
||||
}
|
||||
if ((scalar @freq_max < 2 && scalar @freq_min < 2) &&
|
||||
# also handle off chance that cpuinfo_min/max not set, but scaling_min/max there
|
||||
if (@sc_freq_max){
|
||||
$cpu_sys{'data'}->{'speeds'}{'scaling-max-freq'} = join(':',@sc_freq_max);
|
||||
if (!$cpu_sys{'data'}->{'speeds'}{'max-freq'}){
|
||||
$cpu_sys{'data'}->{'speeds'}{'max-freq'} = $cpu_sys{'data'}->{'speeds'}{'scaling-max-freq'};
|
||||
}
|
||||
}
|
||||
if (@sc_freq_min){
|
||||
$cpu_sys{'data'}->{'speeds'}{'scaling-min-freq'} = join(':',@sc_freq_min);
|
||||
if (!$cpu_sys{'data'}->{'speeds'}{'min-freq'}){
|
||||
$cpu_sys{'data'}->{'speeds'}{'min-freq'} = $cpu_sys{'data'}->{'speeds'}{'scaling-min-freq'};
|
||||
}
|
||||
}
|
||||
# this corrects a bug we see sometimes in min/max frequencies
|
||||
if ((scalar @ci_freq_max < 2 && scalar @ci_freq_min < 2) &&
|
||||
(defined $cpu_sys{'data'}->{'speeds'}{'min-freq'} &&
|
||||
defined $cpu_sys{'data'}->{'speeds'}{'max-freq'}) &&
|
||||
($cpu_sys{'data'}->{'speeds'}{'min-freq'} > $cpu_sys{'data'}->{'speeds'}{'max-freq'} ||
|
||||
|
@ -9292,7 +9331,7 @@ sub sys_data_grabber {
|
|||
# this data has to match the data in cpuinfo grabber fake cpu, and remember
|
||||
# to use --arm flag if arm tests
|
||||
if ($fake{'cpu'}){
|
||||
my $file;
|
||||
# my $file;
|
||||
## CPU sys/cpuinfo pairs:
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/android-pocom3-fake-sys.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/arm-pine64-sys-1.txt";
|
||||
|
@ -9300,9 +9339,9 @@ sub sys_data_grabber {
|
|||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/ppc-stuntkidz~sys.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/riscv-unmatched-2021~sys-1.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/x86-brickwizard-atom-n270~sys-1.txt";
|
||||
$file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/x86-amd-phenom-chrisretusn-sys-1.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/x86-amd-phenom-chrisretusn-sys-1.txt";
|
||||
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/sys-ci-pairs/x86-drgibbon-intel-i7-sys.txt";
|
||||
@files = main::reader($file);
|
||||
# @files = main::reader($file);
|
||||
}
|
||||
# There's a massive time hit reading full globbed set of files, so grab and
|
||||
# read only what we need.
|
||||
|
@ -9315,15 +9354,15 @@ sub sys_data_grabber {
|
|||
$glob .= 'cpu*/topology/{core_cpus_list,core_id,core_siblings_list,die_id,';
|
||||
$glob .= 'physical_package_id,thread_siblings_list}';
|
||||
$glob .= ',cpufreq/{boost,ondemand}';
|
||||
$glob .= ',cpu*/cpufreq/{cpb,cpuinfo_max_freq,cpuinfo_min_freq';
|
||||
$glob .= ($type eq 'full' && $b_admin) ? ',scaling_driver,scaling_governor}':'}';
|
||||
$glob .= ',cpu*/cpufreq/{cpb,cpuinfo_max_freq,cpuinfo_min_freq,';
|
||||
$glob .= 'scaling_max_freq,scaling_min_freq';
|
||||
$glob .= ',scaling_driver,scaling_governor' if $type eq 'full' && $b_admin;
|
||||
$glob .= '}';
|
||||
if ($type eq 'full'){
|
||||
$glob .= ',cpu*/cache/index*/{level,shared_cpu_list,shared_cpu_map,size,type}';
|
||||
}
|
||||
$glob .= ',smt/{active,control}';
|
||||
if ($b_admin){
|
||||
$glob .= ',vulnerabilities/*';
|
||||
}
|
||||
$glob .= ',vulnerabilities/*' if $b_admin;
|
||||
$glob .= '}';
|
||||
}
|
||||
@files = main::globber($glob);
|
||||
|
@ -9978,6 +10017,8 @@ sub cpu_properties {
|
|||
'min-max-key' => $speed_info->{'min-max-key'},
|
||||
'min-max' => $speed_info->{'min-max'},
|
||||
'socket' => $dmi_data{'socket'},
|
||||
'scaling-min-max-key' => $speed_info->{'scaling-min-max-key'},
|
||||
'scaling-min-max' => $speed_info->{'scaling-min-max'},
|
||||
'speed-key' => $speed_info->{'speed-key'},
|
||||
'speed' => $speed_info->{'speed'},
|
||||
'topology-full' => $topology{'full'},
|
||||
|
@ -10150,9 +10191,6 @@ sub cp_data_fallback {
|
|||
$counts->{'cpu-cores'} = $cpu->{'cores'};
|
||||
$counts->{'dies'} = $cpu->{'dies'} = 4;
|
||||
}
|
||||
# elsif ($tests->{'elbrus'}){
|
||||
# $counts->{'cpu-cores'} =
|
||||
# }
|
||||
# final check, override the num of cores value if it clearly is wrong
|
||||
# and use the raw core count and synthesize the total instead of real count
|
||||
if ($counts->{'cpu-cores'} == 0 &&
|
||||
|
@ -10194,7 +10232,8 @@ sub cp_data_fallback {
|
|||
}
|
||||
# only elbrus shows L1 / L3 cache data in cpuinfo, cpu_sys data should show
|
||||
# for newer full linux.
|
||||
elsif ($counts->{'cpu-cores'} && $counts->{'cpu-cores'} > 1) {
|
||||
elsif ($counts->{'cpu-cores'} &&
|
||||
($tests->{'elbrus'} || $counts->{'cpu-cores'} > 1)) {
|
||||
$counts->{'cores-multiplier'} = $counts->{'cpu-cores'};
|
||||
}
|
||||
# last test to catch some corner cases
|
||||
|
@ -10282,6 +10321,12 @@ sub cp_data_sys {
|
|||
if ($cpu_sys->{'cpus'}{$phys_id}{'scaling-driver'}){
|
||||
$cpu->{'scaling-driver'} = $cpu_sys->{'cpus'}{$phys_id}{'scaling-driver'};
|
||||
}
|
||||
if ($cpu_sys->{'cpus'}{$phys_id}{'scaling-max-freq'}){
|
||||
$cpu->{'scaling-max-freq'} = $cpu_sys->{'cpus'}{$phys_id}{'scaling-max-freq'};
|
||||
}
|
||||
if ($cpu_sys->{'cpus'}{$phys_id}{'scaling-min-freq'}){
|
||||
$cpu->{'scaling-min-freq'} = $cpu_sys->{'cpus'}{$phys_id}{'scaling-min-freq'};
|
||||
}
|
||||
if (!grep {$counts->{'cpu-cores'} eq $_} @phys_cores){
|
||||
push(@phys_cores,$counts->{'cpu-cores'});
|
||||
}
|
||||
|
@ -10372,7 +10417,6 @@ sub cp_caches_fallback {
|
|||
$caches->{'l1d-desc'} = $counts->{'cores-multiplier'} . 'x';
|
||||
$caches->{'l1d-desc'} .= main::get_size($cpu->{'l1d-cache'},'string');
|
||||
$caches->{'l1'} += $cpu->{'l1d-cache'} * $counts->{'cores-multiplier'};
|
||||
|
||||
}
|
||||
if ($cpu->{'l1i-cache'}){
|
||||
$caches->{'l1i-desc'} = $counts->{'cores-multiplier'} . 'x';
|
||||
|
@ -11039,6 +11083,20 @@ sub cp_speed_data {
|
|||
if (defined $cpu_sys->{'data'}{'speeds'}{'max-freq'}){
|
||||
$cpu->{'max-freq'} = $cpu_sys->{'data'}{'speeds'}{'max-freq'};
|
||||
}
|
||||
if (defined $cpu_sys->{'data'}{'speeds'}{'scaling-min-freq'}){
|
||||
$cpu->{'scaling-min-freq'} = $cpu_sys->{'data'}{'speeds'}{'scaling-min-freq'};
|
||||
}
|
||||
if (defined $cpu_sys->{'data'}{'speeds'}{'scaling-max-freq'}){
|
||||
$cpu->{'scaling-max-freq'} = $cpu_sys->{'data'}{'speeds'}{'scaling-max-freq'};
|
||||
}
|
||||
# we don't need to see these if they are the same
|
||||
if ($cpu->{'min-freq'} && $cpu->{'max-freq'} &&
|
||||
$cpu->{'scaling-min-freq'} && $cpu->{'scaling-max-freq'} &&
|
||||
$cpu->{'min-freq'} eq $cpu->{'scaling-min-freq'} &&
|
||||
$cpu->{'max-freq'} eq $cpu->{'scaling-max-freq'}){
|
||||
undef $cpu->{'scaling-min-freq'};
|
||||
undef $cpu->{'scaling-max-freq'};
|
||||
}
|
||||
if (defined $cpu_sys->{'data'}{'speeds'}{'all'}){
|
||||
# only replace if we got actual speed values from cpufreq, or if no legacy
|
||||
# sourced processors data. Handles fake syz core speeds for counts.
|
||||
|
@ -11079,19 +11137,16 @@ sub cp_speed_data {
|
|||
if ($cpu->{'cur-freq'} && !$info{'speed'}){
|
||||
$info{'speed'} = $cpu->{'cur-freq'};
|
||||
}
|
||||
# BSDs generally will have processors count, but not per core speeds
|
||||
if ($cpu->{'min-freq'} && $cpu->{'max-freq'}){
|
||||
$info{'min-max'} = "$cpu->{'min-freq'}/$cpu->{'max-freq'}";
|
||||
$info{'min-max-key'} = "min/max";
|
||||
}
|
||||
elsif ($cpu->{'max-freq'}){
|
||||
$info{'min-max'} = $cpu->{'max-freq'};
|
||||
$info{'min-max-key'} = "max";
|
||||
}
|
||||
elsif ($cpu->{'min-freq'}){
|
||||
$info{'min-max'} = $cpu->{'min-freq'};
|
||||
$info{'min-max-key'} = "min";
|
||||
}
|
||||
if ($cpu->{'min-freq'} || $cpu->{'max-freq'}){
|
||||
($info{'min-max'},$info{'min-max-key'}) = cp_speed_min_max(
|
||||
$cpu->{'min-freq'},
|
||||
$cpu->{'max-freq'});
|
||||
}
|
||||
if ($cpu->{'scaling-min-freq'} || $cpu->{'scaling-max-freq'}){
|
||||
($info{'scaling-min-max'},$info{'scaling-min-max-key'}) = cp_speed_min_max(
|
||||
$cpu->{'scaling-min-freq'},
|
||||
$cpu->{'scaling-max-freq'});
|
||||
}
|
||||
if ($cpu->{'cur-freq'}){
|
||||
if ($show{'short'}){
|
||||
$info{'speed-key'} = 'speed';
|
||||
|
@ -11106,6 +11161,23 @@ sub cp_speed_data {
|
|||
eval $end if $b_log;
|
||||
return \%info;
|
||||
}
|
||||
sub cp_speed_min_max {
|
||||
my ($min,$max) = @_;
|
||||
my ($min_max,$key);
|
||||
if ($min && $max){
|
||||
$min_max = "$min/$max";
|
||||
$key = "min/max";
|
||||
}
|
||||
elsif ($max){
|
||||
$min_max = $max;
|
||||
$key = "max";
|
||||
}
|
||||
elsif ($min){
|
||||
$min_max = $min;
|
||||
$key = "min";
|
||||
}
|
||||
return ($min_max,$key);
|
||||
}
|
||||
# update $tests by reference
|
||||
sub cp_test_types {
|
||||
my ($cpu,$tests) = @_;
|
||||
|
|
6
inxi.1
6
inxi.1
|
@ -15,7 +15,7 @@
|
|||
.\" with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
.\"
|
||||
.TH INXI 1 "2021\-12\-13" "inxi" "inxi manual"
|
||||
.TH INXI 1 "2021\-12\-16" "inxi" "inxi manual"
|
||||
|
||||
.SH NAME
|
||||
inxi \- Command line system information script for console and IRC
|
||||
|
@ -1697,7 +1697,9 @@ boost/turbo mode speeds, and appear to be hard\-coded values, not dynamic real
|
|||
values. The \fBbase/boost:\fR values are sometimes real, and sometimes not.
|
||||
\fBbase\fR appears in general to be real.
|
||||
|
||||
\- Adds frequency \fBscaling: governor:.. driver:..\fR if found/available.
|
||||
\- Adds frequency \fBscaling: governor:.. driver:..\fR if found/available. Also
|
||||
adds scaling min/max speeds if different from standard CPU min/max spees (not
|
||||
common).
|
||||
|
||||
\- Adds description of cache topology per cpu. Linux only.
|
||||
|
||||
|
|
157
inxi.changelog
157
inxi.changelog
|
@ -1,6 +1,79 @@
|
|||
================================================================================
|
||||
Version: 3.3.11
|
||||
Patch: 00
|
||||
Date: 2021-12-16
|
||||
--------------------------------------------------------------------------------
|
||||
RELEASE NOTES:
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Quick bug fix release. With as many changes as we got in 3.3.10, there were
|
||||
bound to be a handful of oversights that were not caught in testing simply
|
||||
because those hardware scenarios were not present in the tested systems.
|
||||
|
||||
Also minor feature enhancement for CPU scaling min/max speeds.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
KNOWN ISSUES:
|
||||
|
||||
1. Due to the huge amount of changes, and the speed of change, while the new
|
||||
code is working as intended, it's somewhat lacking in coding elegance since a
|
||||
lot of it was hacked out very quickly, in near real time. This will get cleaned
|
||||
up and refactored to be less redundant if it does not impact execution speed,
|
||||
but is not pressing since there should be no functional difference.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
BUGS:
|
||||
|
||||
1. Tiny oversight, in single case CPU model id would fail because it was using
|
||||
an undefined test from previous tests, not the right test, that is. Tripped
|
||||
error on Elbrus for example.
|
||||
|
||||
2. Typo in battery secondary type status, created undefined value error. This
|
||||
was I believe an older bug.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
FIXES:
|
||||
|
||||
1. PPC revision change broke Elbrus revision test for stepping. Added in more
|
||||
tests to show stepping for elbrus revision.
|
||||
|
||||
2. Single core Elbrus in cpuinfo fallback mode failed to assign core multiplier
|
||||
so L1 cache failed.
|
||||
|
||||
3. In cpuinfo fallback mode, Elbrus E2C3 cache data failed to appear, that data
|
||||
in not per block in cpuinfo, but is the last block, so those tests had to run
|
||||
on each block, not just the first one.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
ENHANCEMENTS:
|
||||
|
||||
1. Show for -Ca scaling min/max speeds if different from CPU min/max speeds.
|
||||
|
||||
2. If no cpuinfo_min/max_freq speeds found, and scaling_min/max_freq found, set
|
||||
overall min/max to use scaling min/max instead of cpuinfo min/max.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
CHANGES:
|
||||
|
||||
1. None.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
DOCUMENTATION:
|
||||
|
||||
1. Cleaned up and proofread better 3.3.10 changelog, it had a lot of errors
|
||||
because stuff kept changing.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
CODE:
|
||||
|
||||
1. Small code optimizations.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Harald Hope - Tue, 16 Dec 2021 16:14:08 -0800
|
||||
|
||||
================================================================================
|
||||
Version: 3.3.10
|
||||
Patch: 01
|
||||
Patch: 00
|
||||
Date: 2021-12-13
|
||||
--------------------------------------------------------------------------------
|
||||
RELEASE NOTES:
|
||||
|
@ -183,7 +256,7 @@ ENHANCEMENTS:
|
|||
sudo/root, and it will be more accurate than ever before.
|
||||
|
||||
2. CPU: shows per CPU L1/L2/L3 totals, and shows actual full system physical
|
||||
processor count * L1/L2/L3 total in parentheses, like: L2: 1.5 MiB (3 MiB).
|
||||
processor count * L1/L2/L3 total in parentheses, like: L2: 2x 1.5 MiB (3 MiB).
|
||||
|
||||
3. CPU: A long standing annoyance, previously for main CPU 'Speed:' item, showed
|
||||
the fastest core speed found, now shows avg: [speed] and with -Cx, shows the
|
||||
|
@ -242,17 +315,25 @@ section, can be useful for systems with disabled MT, but supporting it. If no
|
|||
topology data found (OpenBSD for example), for -C shows 'smt: disabled' after
|
||||
'type:' section, and enabled if -Cxxx (since MT really already tells you that).
|
||||
|
||||
13. For -Ca Speed: report, added 'governor:' item, if found. Can show 1 or more
|
||||
active governors.
|
||||
13. For -Ca Speed: report, added scaling: report, with childrend 'governor:'.
|
||||
Can show 1 or more active governors. Also shows scaling driver:. Shows if either
|
||||
is available.
|
||||
|
||||
14. Output height (in lines) control: -Y [-2|-1|0|1-xxx]]. This lets you break
|
||||
up any of the output into whatever number of lines you want. Also useful out of
|
||||
DISPLAY for reading -h options menu items etc.
|
||||
scaling:
|
||||
driver: ..
|
||||
governor: ..
|
||||
|
||||
These may be quite useful over time to help diagnose or debug scaling issues.
|
||||
|
||||
14. Output height (in lines) control: -Y [-3|-2|-1|0|1-xxx]]. This lets you
|
||||
break up any of the output into whatever number of lines you want. Also useful
|
||||
out of DISPLAY for reading -h options menu items etc.
|
||||
|
||||
It came tp my attention that the long standing shift+pgup/pgdown (aka
|
||||
'softscrollback) behavior had stopped working, and in fact has been removed from
|
||||
the current Linux kernel, at least until it is rewritten to be more clean and
|
||||
understandable. Read more about it in these kernel post/commit messages:
|
||||
'softscrollback) behavior had stopped working in kernel framebuffer mode, and in
|
||||
fact has been removed from the current Linux kernel, at least until it is
|
||||
rewritten to be more clean and understandable. Read more about it in these
|
||||
kernel post/commit messages:
|
||||
|
||||
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=50145474f6ef4a9c19205b173da6264a644c7489
|
||||
https://lwn.net/ml/linux-kernel/CAHk-=whe4ZdTdCebneWqC4gSQZwsVJ5-Emg0BucOGCwPhOAJpw@mail.gmail.com/
|
||||
|
@ -261,7 +342,9 @@ Options for -Y are:
|
|||
* -Y 0 or -Y: Set maximum block height to terminal line height.
|
||||
* -Y [1-xxx]: Set maximum block line height to given integer.
|
||||
* -Y -1: Print out one primary data block item at a time, with -F for example.
|
||||
* -Y -2: Restore default unlimited height if LINES_MAX configuration item used.
|
||||
* -Y -2: Do not remove color codes when piped or redirected. Mostly useful for
|
||||
piping to less -R, to preserve color codes.
|
||||
* -Y -3: Restore default unlimited height if LINES_MAX configuration item used.
|
||||
|
||||
15. And finally, more disk vendors/vendor ids. As usual. As expected.
|
||||
|
||||
|
@ -299,16 +382,16 @@ cache: [cache size]
|
|||
|
||||
and call it a day.
|
||||
|
||||
5a. Change default width to 80 columns, in and out of display. Too many users
|
||||
are posting horribly wrapping inxi output in forums, issue trackers, etc, and it
|
||||
frankly makes inxi look really bad, creates awful side scrolling code boxes,
|
||||
etc. So now default widths in and out of console are 80 (since often data is
|
||||
generated in SSH or out of X/Wayland) for issues.
|
||||
5a. Change default width to 80 columns in display, and 100 and out. Too many
|
||||
users are posting horribly wrapping inxi output in forums, issue trackers, etc,
|
||||
and it frankly makes inxi look really bad, creates awful side scrolling code
|
||||
boxes, etc. So now default widths in and out of console are 80/100 (since often
|
||||
data is generated in SSH or out of X/Wayland) for issues.
|
||||
|
||||
This essentially makes -y 80/-y the default width. This is what I've been using
|
||||
for a few years now, and after seeing far too many side scrolling or badly
|
||||
wrapping inxi outputs online, I think it's probably time to just force 80 column
|
||||
widths as default and call it a day.
|
||||
This essentially makes -y 80/-y the default width in display, and a wrapped 100
|
||||
out. This is what I've been using for a few years now, and after seeing far too
|
||||
many side scrolling or badly wrapping inxi outputs online, I think it's probably
|
||||
time to just force 80 column widths as default and call it a day.
|
||||
|
||||
You can change these new defaults using configuration options (these are the
|
||||
previous options, though due to a bug, COLS_MAX_CONSOLE was never being used):
|
||||
|
@ -317,12 +400,10 @@ previous options, though due to a bug, COLS_MAX_CONSOLE was never being used):
|
|||
COLS_MAX_IRC=100
|
||||
COLS_MAX_NO_DISPLAY=130 # not in display, no X/Wayland running
|
||||
|
||||
5b. Changed output wrapped indent to 1 column from 2, and make second and
|
||||
greater rows of a line indent +1 to make it more clear that it is a child row of
|
||||
its parent row. Note that because no arg short form, -S, and -I are special
|
||||
types of rows, this behavior is not used, they just print out as usual. This 1
|
||||
column indent also applies to -y1, making for a little more data per line but
|
||||
more readable and easy to follow.
|
||||
5b. Made second and greater rows of a line indent +2 to make it more clear that
|
||||
it is a child row of its parent row. Note that because no arg short form and -I
|
||||
are special types of rows, this behavior is not used, they just print out as
|
||||
usual. This makes for more readable and easy to follow flow of output data.
|
||||
|
||||
6. If > 1 physical cpu detected, no longer uses single/dual/triple/quad core
|
||||
strings, rather uses: 2x 2-core. Also uses lower case -core, not -Core.
|
||||
|
@ -339,15 +420,12 @@ Topology line rather than the Info: 6-core type item. For -b, short, -Cx, -Cxxx
|
|||
shows the Info: topology short form.
|
||||
|
||||
11. Bogomips always shows before flags data, whether -f or just -Cx trips flag
|
||||
output.
|
||||
output. This places bogomips at end of Speed: line, after the core speeds.
|
||||
|
||||
12. Flags/Features now shows in the same place, under Speeds: always, whether
|
||||
-Cx shortlist, or -Cf full list. Makes more sense that way, and code is much
|
||||
cleaner too.
|
||||
|
||||
13. Bogomips, being essentially bogus units of speed for cpu, are moved into
|
||||
Speed: report.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
DOCUMENTATION:
|
||||
|
||||
|
@ -362,7 +440,7 @@ sudo. Good job OpenBSD guys. Note that inxi already has had full doas support
|
|||
for a while now, but this finalizes it, and makes it fully agnostic. Internally
|
||||
doas is actually preferred over sudo, by the way.
|
||||
|
||||
4. Added documention items for INDENT (--indent), INDENT_MIN (--inident-min).
|
||||
4. Added documention items for INDENT (--indent), INDENTS (--indents).
|
||||
|
||||
5. Re-ordered help menu and man page, created new Filters and Output Controls
|
||||
sections to make stuff easier to find. In man page, also added on top a list of
|
||||
|
@ -372,11 +450,9 @@ OPTIONS sections to make finding stuff easier.
|
|||
CODE:
|
||||
|
||||
1. Removed legacy /sys cpu functions: cpu_bugs_sys(); get_boost_status();
|
||||
set_cpu_speeds_sys(). cpu_speeds() is deprecated and now will only be used for
|
||||
legacy Linux and BSDs if they had any per core speeds found; get_caches() was
|
||||
only a placeholder for the full featured cpu_sys data source, and was removed;
|
||||
cpu_speeds() no longer needed, integrated into other logic; cpu_dies_sys()
|
||||
removed, integrated into other logic.
|
||||
set_cpu_speeds_sys(). get_caches() was only a placeholder for the full featured
|
||||
cpu_sys data source, and was removed; cpu_speeds() no longer needed, integrated
|
||||
into other logic; cpu_dies_sys() removed, integrated into other logic.
|
||||
|
||||
This logic is now integrated into cpu_data_sys() data generator.
|
||||
|
||||
|
@ -392,7 +468,7 @@ processor blocks anyway, that was always a hack done by the kernel guys to toss
|
|||
that SOC data somewhere as far as I can tell.
|
||||
|
||||
4. New tools:
|
||||
* either_or() - takes a list, and returns the first defined element of list.
|
||||
* get_defined() - takes a list, and returns the first defined element of list.
|
||||
* regex_range() - generate ranges from comma, space, or ranges like 2-29, or any
|
||||
combination of those, like 3,6,12-29
|
||||
|
||||
|
@ -412,8 +488,8 @@ risc cpu. This is much cleaner, and use $risc{'id'} for print purposes, which
|
|||
got rid of a lot of tests. Also made all risc tests consistent, some were ARM
|
||||
only, or arm/mips, but were supposed to be for all risc cpus.
|
||||
|
||||
9. Set help menu code to roughly 80 columns width assuming 2 space tab
|
||||
indentation.
|
||||
13. Made help menu code more or less wrap to 80 columns, or close. Ongoing to
|
||||
bring to 80 columns where practical, but never at expense of clarity or logic.
|
||||
|
||||
10. Changed all xxx_cleaner subs to clean_xxx, all filter subs to filter_xxx,
|
||||
and row_defaults() to message().
|
||||
|
@ -425,9 +501,6 @@ pointlessly.
|
|||
12. Cleaned up print_data() to allow for more fine tuned indentation for the new
|
||||
2 indent levels.
|
||||
|
||||
13. Made help menu code more or less wrap to 80 columns, or close. Ongoing to
|
||||
bring to 80 columns where practical, but never at expense of clarity or logic.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Harald Hope - Tue, 13 Dec 2021 10:25:49 -0800
|
||||
|
||||
|
|
Loading…
Reference in a new issue