aristocratos / btop

A monitor of resources
Apache License 2.0
21.37k stars 655 forks source link

[BUG] CPU Clock Mismatch between real clock frequency and apparent on Raspberry Pi #379

Open danielschickmunit opened 2 years ago

danielschickmunit commented 2 years ago

Describe the bug

the clock-speed that is shown in the upper right corner is the "apparent" or "should-be" (apparently from /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) - value but in fact the pi I am using is throttling due to insufficient power and that is not represented correctly

you can see it in the attached screenshot that the frequency is dipping, but btop shows 2Ghz constantly

you can check the real value via vcgenmod vcgencmd measure_clock arm

https://www.raspberrypi.com/documentation/computers/os.html#vcgencmd

To Reproduce

compare cpu freq in btop to vcgencmd measure_clock arm

Expected behavior

the dips in frequency should be represented accordingly

Screenshots

image

Info (please complete the following information):

Possible solution/Feature Request

change the get_cpuHz() function to get the current frequency via the vcgencmd measure_clock arm command

you could even add a warning if it is throtteling due to temperature or undervoltage

if i don't forget this issue, i could write a PR - concerning this issue

Overcraft90 commented 1 year ago

Hi there,

Indeed, a thermal throttling indicator would be great to have!

Let me know whether it is still something you might work on, thanks!