0
1
I am doing scientific computing and I need to keep an eye on the cpu frequency and load of each core (there are 2 cores, on Ubuntu 14.04 w/ Gnome3). I can see the frequency with this bash script:
echo ""
while true; do
if [ ! -z $ind ] ; then ind=; else ind="."; fi
f0=$(sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq)
f1=$(sudo cat /sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_cur_freq)
printf " CPU MHz: %5i %5i $ind \r" $(($f0/1000)) $(($f1/1000))
sleep 0.5
done
The output looks like this:
CPU MHz: 800 2401
And see CPU current load with:
glances -1rmnd
I'd like to get the current load for each core (in e.g. %) together with the frequency in the same terminal window and a compact format. Ideally it would look like this:
CPU MHz: 800 2401
Load: 12% 100%
Any advice is welcome, even different solution, or programs. Cheers /J