Tuesday, March 17, 2015

Read CPUs frequency of Raspberry Pi 2

There are 4 cpu core on Raspberry Pi 2. ls /sys/devices/system/cpu show 4 cpu, cpu0~cpu3. The files hold the scaling current frequency of each cpu.
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
/sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq
/sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq
/sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq

Tested on Raspberry Pi 2, running Raspbian.


No comments: