🛠 Surveillance fréquence et charge CPU

Hardkernel ODROID-C2 (Amlogic S905) · avance · Schéma : IMG-odroid-c2-avance-2-odroidc2-surveillance-thermique.svg — sondes cpufreq et loadavg de l'ODROID-C2 remontant vers un journal et un graphique

Objectives

Set up system monitoring for the ODROID-C2: actual per-core CPU frequency via cpufreq, load, and temperature — taking into account a peculiarity of the S905: no thermal sensor exposed by the mainline kernel (the U-Boot amlogic matrix indicates "Thermal Sensor: No"), so monitoring focuses on frequency, load, and potential throttling.

Hardware

Complete code

#!/usr/bin/env bash
# surveil.sh — journalise frequence CPU, charge et temperature si disponible
LOG=/var/log/c2-surveillance.csv
echo "horodatage,cpu0_khz,cpu3_khz,load1,temp" > $LOG
while :; do
  f0=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq 2>/dev/null || echo NA)
  f3=$(cat /sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq 2>/dev/null || echo NA)
  l1=$(cut -d' ' -f1 /proc/loadavg)
  t=$(cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null | head -n1 || true)
  echo "$(date -Is),$f0,$f3,$l1,${t:-absente}" >> $LOG
  sleep 10
done
# charge max volontaire pour observer le comportement (4 coeurs, 60 s)
timeout 60 sh -c 'for i in 1 2 3 4; do : & done; wait'
# governor : performance pour un serveur, powersave/ondemand sinon
sudo cpupower frequency-set -g performance

Expected verification

The CSV fills up every 10 s. Under intentional load, load1 rises towards 4 and scaling_cur_freq displays 1,500,000 kHz (the C2's fusion frequency, not the 2 GHz from the S905 datasheet). In mainline, the temperature column remains "absent": this is expected, not a failure. No DVFS SCPI either: the frequency is quasi-fixed depending on the governor.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials