File: calibration.sh

package info (click to toggle)
rt-app 1.0-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye
  • size: 496 kB
  • sloc: ansic: 2,231; python: 260; sh: 129; makefile: 33
file content (17 lines) | stat: -rwxr-xr-x 418 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

set -e

if [ ! $1 ] ; then
	echo "Please input one cpu"
	exit
fi

echo performance > /sys/devices/system/cpu/cpu$1/cpufreq/scaling_governor

sleep 1

sed 's/"calibration" : "CPU.*",/"calibration" : "CPU'$1'",/' -i calibration.json
pLoad=$(rt-app calibration.json 2>&1 |grep pLoad |sed 's/.*= \(.*\)ns.*/\1/')
sed 's/"calibration" : .*,/"calibration" : '$pLoad',/' -i dvfs.json
echo CPU$1\'s pLoad is $pLoad