amanusk / s-tui

Terminal-based CPU stress and monitoring utility
https://amanusk.github.io/s-tui/
GNU General Public License v2.0
4.06k stars 140 forks source link

Feature request: display Power/Thermal/Current throttling #83

Open sanderboom opened 6 years ago

sanderboom commented 6 years ago

Step 1: Describe your environment

First of all: thanks for the great software.

Secondly: IMO it would be a very valuable addition if s-tui could display the onset/offset of Thermal/Power/Current throttling.

Thanks for taking a look at this.

amanusk commented 6 years ago

Could you please give some more information on these statistics?

I assume these are feature that exists in XTU and/or lenovo-throttling-fix?

A screenshot or an example from a logfile could be helpful

amanusk commented 6 years ago

@sanderboom ?

sanderboom commented 6 years ago

@amanusk Thanks for the reply. For a screenshot of XTU I had to boot windows - Something I typically try to avoid ;-)

The goal of these statistics is to indicate if/when the different types of throttling are active.

The first screenshot: XTU showing active Power Limit Throttling (the white line) during 2 stress tests. image

The second screenshot: XTU showing active Thermal Throttling (the green line) for a while during the last stress test (triggered by raising the TDP's), followed by the Power Limit Throttling kicking in. image

Thanks for looking into this.

amanusk commented 6 years ago

For a screenshot of XTU I had to boot windows - Something I typically try to avoid ;-)

I feel your pain ;)

Do you have a source/reference of how could this be monitored in Linux? Are these events written to a certain MSR? Does this show up in dmesg? or some other log file?

sanderboom commented 6 years ago

I've seen the following a bit too often (via journalctl -g "Package temperature"):

jul 25 11:55:49 T480s kernel: CPU1: Package temperature above threshold, cpu clock throttled (total events = 28)
jul 25 11:55:49 T480s kernel: CPU2: Package temperature above threshold, cpu clock throttled (total events = 28)
jul 25 11:55:49 T480s kernel: CPU5: Package temperature above threshold, cpu clock throttled (total events = 28)
jul 25 11:55:49 T480s kernel: CPU7: Package temperature above threshold, cpu clock throttled (total events = 28)
jul 25 11:55:49 T480s kernel: CPU6: Package temperature above threshold, cpu clock throttled (total events = 28)
jul 25 11:55:49 T480s kernel: CPU3: Package temperature above threshold, cpu clock throttled (total events = 28)
jul 25 11:55:49 T480s kernel: CPU4: Package temperature above threshold, cpu clock throttled (total events = 28)
jul 25 11:55:49 T480s kernel: CPU0: Package temperature above threshold, cpu clock throttled (total events = 28)
jul 25 11:55:49 T480s kernel: CPU5: Package temperature/speed normal
jul 25 11:55:49 T480s kernel: CPU2: Package temperature/speed normal
jul 25 11:55:49 T480s kernel: CPU1: Package temperature/speed normal
jul 25 11:55:49 T480s kernel: CPU3: Package temperature/speed normal
jul 25 11:55:49 T480s kernel: CPU6: Package temperature/speed normal
jul 25 11:55:49 T480s kernel: CPU7: Package temperature/speed normal
jul 25 11:55:49 T480s kernel: CPU4: Package temperature/speed normal
jul 25 11:55:49 T480s kernel: CPU0: Package temperature/speed normal

Power Limit Throttling... not sure.

Please also check this post at lenovo-throttling-fix as you two might exchange/combine knowledge & power :)

amanusk commented 5 years ago

Note: Might be possible by looking /sys/bus/cpu/devices/cpu0/thermal_throttle/core_throttle_count

erpalma commented 5 years ago

I've just added a very basic monitoring of throttling causes, you might have a look.

amanusk commented 5 years ago

@erpalma, thanks for the notice! I have seen the commit yesterday, defiantly interested in adding this feature :)

LinuxOnTheDesktop commented 2 years ago

Sorry to ask a question here, and especially on a closed issue, but where in s-tui does one see the throttling information? I have seen it before but for the life of me I cannot seem to see it now!