Fix intel
All checks were successful
PikaOS Package Build & Release (amd64-v3) / build (push) Successful in 28s
All checks were successful
PikaOS Package Build & Release (amd64-v3) / build (push) Successful in 28s
This commit is contained in:
parent
861de368d7
commit
ed2c2eb112
2
.github/release-nest-v3
vendored
2
.github/release-nest-v3
vendored
@ -1 +1 @@
|
|||||||
1
|
2
|
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,3 +1,9 @@
|
|||||||
|
falcon (1.0.2-101pika1) pika; urgency=low
|
||||||
|
|
||||||
|
* Fix Intel
|
||||||
|
|
||||||
|
-- Ward Nakchbandi <hotrod.master@hotmail.com> Sat, 10 Dec 2022 13:48:00 +0300
|
||||||
|
|
||||||
falcon (1.0.1-101pika1) pika; urgency=low
|
falcon (1.0.1-101pika1) pika; urgency=low
|
||||||
|
|
||||||
* Initial release
|
* Initial release
|
||||||
|
27
main.go
27
main.go
@ -204,16 +204,25 @@ func GetPPStatusAndHighestCores() (bool, []CoreFreq, bool, []int, error) {
|
|||||||
return fmt.Errorf("failed to unmarshal lscpu output: %w", err)
|
return fmt.Errorf("failed to unmarshal lscpu output: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var maxMHz float64
|
sort.Slice(lscpuOutput.CPUs, func(i, j int) bool {
|
||||||
for _, cpu := range lscpuOutput.CPUs {
|
return lscpuOutput.CPUs[i].MaxMHz > lscpuOutput.CPUs[j].MaxMHz
|
||||||
if cpu.MaxMHz > maxMHz {
|
})
|
||||||
maxMHz = cpu.MaxMHz
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, cpu := range lscpuOutput.CPUs {
|
if len(lscpuOutput.CPUs) > 0 {
|
||||||
if cpu.MaxMHz == maxMHz {
|
topMHz := lscpuOutput.CPUs[0].MaxMHz
|
||||||
highestCores = append(highestCores, cpu.CPU)
|
secondMHz := topMHz
|
||||||
|
|
||||||
|
for _, cpu := range lscpuOutput.CPUs {
|
||||||
|
if cpu.MaxMHz < topMHz {
|
||||||
|
secondMHz = cpu.MaxMHz
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, cpu := range lscpuOutput.CPUs {
|
||||||
|
if cpu.MaxMHz == topMHz || cpu.MaxMHz == secondMHz {
|
||||||
|
highestCores = append(highestCores, cpu.CPU)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user