Categories
DailyOps

How to control Power Profiles daemon using command-line

Control Power Profiles daemon using a dedicated powerprofilesctl command-line utility.

Permanently change the power profile

Display version of the Power Profiles command-line utility.

$ powerprofilesctl version
0.10.1

Display active power profile.

$ powerprofilesctl get
performance

Display available power profiles.

$ powerprofilesctl list
* performance:
    Driver:     intel_pstate
    Degraded:   no

  balanced:
    Driver:     intel_pstate

  power-saver:
    Driver:     intel_pstate

Alter currently active power profile.

$ powerprofilesctl set balanced
$ powerprofilesctl get
balanced

Inspect permanent configuration.

$ cat /var/lib/power-profiles-daemon/state.ini
[State]
Driver=intel_pstate
Profile=balanced

Temporarily change the power profile

Launch a command while holding a specific power profile.

$ powerprofilesctl launch --profile performance --reason "performance profile for 5 minutes" --appid "sleep - $$"  sleep 300

Display active alterations.

$ powerprofilesctl list-holds
Hold:
  Profile:         performance
  Application ID:  sleep - 1567353
  Reason:          performance profile for 5 minutes

Display command used to create this hold/alteration.

$ ps --ppid 1567353 -o command=
/usr/bin/python3 /usr/bin/powerprofilesctl launch --profile performance --reason performance profile for 5 minutes --appid sleep - 1567353 sleep 300