Skip to content

Commit 8988cff

Browse files
Daniel LangeDaniel Lange
authored andcommitted
Merge branch 'loongarch-freq' of BenBE/htop
2 parents a1f6502 + bbea3dc commit 8988cff

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

linux/LinuxMachine.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,10 +590,15 @@ static void scanCPUFrequencyFromCPUinfo(LinuxMachine* this) {
590590
if (fgets(buffer, PROC_LINE_LENGTH, file) == NULL)
591591
break;
592592

593-
if (sscanf(buffer, "processor : %d", &cpuid) == 1) {
593+
if (
594+
(sscanf(buffer, "processor : %d", &cpuid) == 1) ||
595+
(sscanf(buffer, "cpu number : %d", &cpuid) == 1) // s390: https://github.com/torvalds/linux/blob/v6.15/arch/s390/kernel/processor.c#L349
596+
) {
594597
continue;
595598
} else if (
596599
(sscanf(buffer, "cpu MHz : %lf", &frequency) == 1) ||
600+
(sscanf(buffer, "CPU MHz : %lf", &frequency) == 1) || // LooooongArch: https://github.com/torvalds/linux/blob/v6.15/arch/loongarch/kernel/proc.c#L42
601+
(sscanf(buffer, "cpu MHz dynamic : %lf", &frequency) == 1) || // s390: https://github.com/torvalds/linux/blob/v6.15/arch/s390/kernel/processor.c#L335
597602
(sscanf(buffer, "clock : %lfMHz", &frequency) == 1)
598603
) {
599604
if (cpuid < 0 || (unsigned int)cpuid > (super->existingCPUs - 1)) {

0 commit comments

Comments
 (0)