mirror of
https://github.com/aristocratos/btop.git
synced 2024-05-15 18:03:06 +12:00
impossible to get CPU freq on M1 apparently
This commit is contained in:
parent
66072711c2
commit
b9d58e3faf
|
@ -271,6 +271,7 @@ namespace Cpu {
|
|||
|
||||
if (sysctl(mib, 2, &freq, &size, NULL, 0) < 0) {
|
||||
Logger::error("Failed to get CPU frequency: " + std::to_string(errno));
|
||||
return "";
|
||||
}
|
||||
return std::to_string(freq / 1000.0 / 1000.0 / 1000.0).substr(0, 3);
|
||||
}
|
||||
|
@ -463,8 +464,12 @@ namespace Cpu {
|
|||
//? Reduce size if there are more values than needed for graph
|
||||
while (cmp_greater(cpu.cpu_percent.at("total").size(), width * 2)) cpu.cpu_percent.at("total").pop_front();
|
||||
|
||||
if (Config::getB("show_cpu_freq"))
|
||||
cpuHz = get_cpuHz();
|
||||
if (Config::getB("show_cpu_freq")) {
|
||||
auto hz = get_cpuHz();
|
||||
if (hz != "") {
|
||||
cpuHz = hz;
|
||||
}
|
||||
}
|
||||
|
||||
if (Config::getB("check_temp") and got_sensors)
|
||||
update_sensors();
|
||||
|
|
Loading…
Reference in a new issue