diff --git a/.pistressrc b/.pistressrc new file mode 100644 index 0000000..601b192 --- /dev/null +++ b/.pistressrc @@ -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 + diff --git a/bin/measure_temp.sh b/bin/measure_temp.sh index ea2d07b..f53dc22 100755 --- a/bin/measure_temp.sh +++ b/bin/measure_temp.sh @@ -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}") diff --git a/bin/run-cpu-stress.sh b/bin/run-cpu-stress.sh index 2726a1f..c2029ff 100755 --- a/bin/run-cpu-stress.sh +++ b/bin/run-cpu-stress.sh @@ -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 diff --git a/fio/fio_cpu b/fio/fio_cpu index 3b126f9..777b9a6 100644 --- a/fio/fio_cpu +++ b/fio/fio_cpu @@ -2,7 +2,7 @@ ioengine=cpuio cpuload=100 cpuchunks=100000 -runtime=3600 +runtime=${FIO_RUNNING_TIME} time_based group_reporting numjobs=${FIO_NUMJOBS}