Linux Power Management – How to Get Current CPUPower Governor

linuxpower-management

I want to get the current CPUPower governor.

When I type cpupower frequency-info I get a lot of information. I just want to get the governor, just like "ondemand" with no more information, to use its value in a program.

Best Answer

The current governor can be obtained as follows:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

Note that cpu* will give you the scaling governor of all your cores and not just e.g. cpu0.

This solution might be system dependent, though. I'm not 100% sure this is portable.

Related Question