mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
optimized cpu cache logic
This commit is contained in:
parent
c842901804
commit
eb6294f0b0
12
inxi
12
inxi
|
@ -7385,17 +7385,19 @@ sub cpu_cache_dmi {
|
|||
my @item = @$ref;
|
||||
next if $item[0] != 7;
|
||||
last if $item[0] > 7;
|
||||
# skip first three row, we don't need that data
|
||||
splice @item, 0, 3;
|
||||
($id,$amount) = ('',0);
|
||||
foreach my $value (@item){
|
||||
# some cpus only show Socket Designation: Internal cache
|
||||
if (!$id && $value =~ /^Configuration:.* Level.*([1-3])\b/){
|
||||
$id = "L$1";
|
||||
}
|
||||
# variants: L3 - Cache; L3 Cache; L3-cache
|
||||
if ($value =~ /^Socket Designation: (L[1-3])\b/){
|
||||
$id = $1;
|
||||
}
|
||||
if ($value =~ /^Installed Size: (.*B)$/){
|
||||
# some cpus only show Socket Designation: Internal cache
|
||||
elsif (!$id && $value =~ /^Configuration:.* Level.*([1-3])\b/){
|
||||
$id = "L$1";
|
||||
}
|
||||
elsif ($id && $value =~ /^Installed Size: (.*B)$/){
|
||||
$amount = main::translate_size($1);
|
||||
}
|
||||
if ($id && $amount){
|
||||
|
|
Loading…
Reference in a new issue