configure default values in ~/pistressrc if exists

This commit is contained in:
2026-06-04 11:38:50 +00:00
parent 3dbbedaec6
commit 8e6ea348cc
4 changed files with 18 additions and 4 deletions

6
.pistressrc Normal file
View File

@@ -0,0 +1,6 @@
export PISTRESS_HOME=/home/pi/git/pistress
export THERMAL_ZONE=/sys/class/thermal/thermal_zone0/temp
export FIO_NUMJOBS=$(nproc)
export FIO_RUNNING_TIME=3600

View File

@@ -21,11 +21,10 @@ format_temp() {
echo "${ftemp}"
}
ZONE=/sys/class/thermal/thermal_zone0/temp
#retrieve the cpu's temperature from /sys/class/thermal/thermal_zone0/temp
measure_temp() {
cpu_temp=$(cat ${ZONE})
cpu_temp=$(cat ${THERMAL_ZONE})
formatted_temp=$(format_temp "${cpu_temp}")

View File

@@ -1,4 +1,13 @@
export FIO_NUMJOBS=$(nproc)
if [ -f ~/.pistressrc ]; then
. ~/.pistressrc
else
export PISTRESS_HOME=/home/pi/git/pistress
export FIO_NUMJOBS=$(nproc)
export FIO_RUNNING_TIME=3600
export THERMAL_ZONE=/sys/class/thermal/thermal_zone0/temp
fi
measure_temp.sh > ${1} &
TPID=$!
fio ${PISTRESS_HOME}/fio/fio_cpu

View File

@@ -2,7 +2,7 @@
ioengine=cpuio
cpuload=100
cpuchunks=100000
runtime=3600
runtime=${FIO_RUNNING_TIME}
time_based
group_reporting
numjobs=${FIO_NUMJOBS}