Skip to content

Commit

Permalink
Fix Cortex CPU detection in sensors output
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Oct 19, 2023
1 parent c0e20f0 commit a85fa2f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions proc/linux-lib.pl
Expand Up @@ -500,7 +500,7 @@ sub get_current_cpu_data
my @fans;
my @cputhermisters;
if (&has_command("sensors")) {
my ($cpu, $cpu_aux, $cpu_package, $cpu_broadcom, $cpu_amd);
my ($cpu, $cpu_aux, $cpu_unnamed, $cpu_package, $cpu_broadcom, $cpu_amd);
my $fh = "SENSORS";

# Examples https://gist.github.com/547451c9ca376b2d18f9bb8d3748276c
Expand Down Expand Up @@ -563,7 +563,7 @@ sub get_current_cpu_data
else {

# Auxiliary CPU temperature and fans were already captured
next if ($cpu_aux);
next if ($cpu_aux && !$cpu_unnamed);

# CPU types
($cpu_broadcom) = $_ =~ /cpu_thermal-virtual-[\d]+/i if (!$cpu_broadcom);
Expand Down Expand Up @@ -598,6 +598,13 @@ sub get_current_cpu_data
'temp' => int($2)
});
}
elsif (/cpu\s+temp(.*?):\s+([\+\-][0-9\.]+)/i) {
$cpu_unnamed++;
push(@cpu,
{ 'core' => $cpu_unnamed,
'temp' => int($2)
});
}
}

# AMD
Expand Down

0 comments on commit a85fa2f

Please sign in to comment.