[v0.98] Fix bug in get_str_peak_performance and always show unknown pp when freq is also unknown

This commit is contained in:
Dr-Noob
2021-08-07 08:57:41 +02:00
parent 2b21326167
commit a03f296390
2 changed files with 6 additions and 3 deletions

View File

@@ -684,15 +684,17 @@ struct frequency* get_frequency_info(struct cpuInfo* cpu) {
}
if(freq->max == 0) {
printWarn("Read max CPU frequency from CPUID and got 0 MHz");
#ifdef __linux__
printWarn("Using udev to detect frequency");
#ifdef __linux__
printWarn("Using udev to detect frequency");
freq->max = get_max_freq_from_file(0, cpu->hv->present);
if(freq->max == 0) {
printWarn("Read max CPU frequency from udev and got 0 MHz");
freq->max = UNKNOWN_FREQ;
}
#endif
#else
freq->max = UNKNOWN_FREQ;
#endif
}
}