Skip to content

Instantly share code, notes, and snippets.

@kewitz
Created January 30, 2016 20:06
Show Gist options
  • Save kewitz/55d9db86aa68197c5bc7 to your computer and use it in GitHub Desktop.
Save kewitz/55d9db86aa68197c5bc7 to your computer and use it in GitHub Desktop.
intel_pstate max cpu-frequency bash script.
#!/bin/bash
# Copyleft 2015 - Leonardo Kewitz github.com/kewitz
# intel_pstate max cpu-frequency script.
PMAX=/sys/devices/system/cpu/intel_pstate/max_perf_pct
CPUINFO=/proc/cpuinfo
if [ "$#" != "1" ]
then
echo -e "Usage: cpf 30-100"
else
sudo tee $PMAX <<<$1
fi
# Print current status...
PCT=$(<$PMAX)
MHZ=$(egrep -m 1 -o 'MHz.+\: (([[:digit:]]|\.)+$)' /proc/cpuinfo | egrep -o '([[:digit:]]|\.)+')
echo -e "Max performance currently at $PCT %. Actual clock $MHZ MHz"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment