9 Commits

Author SHA1 Message Date
olli e559c146b7 run-cpu-stress.sh fails when no logfilename is passed. 2026-07-04 11:16:30 +02:00
olli 69bea0be4f PISTRESS_HOME is only set if not set 2026-06-05 09:26:12 +02:00
raspithek b296fdb2da updated README.md 2026-06-04 19:49:24 +00:00
raspithek bf87653e77 updated Version 2026-06-04 19:39:37 +00:00
raspithek 8e6ea348cc configure default values in ~/pistressrc if exists 2026-06-04 11:38:50 +00:00
raspithek 3dbbedaec6 replced vcgencmd call with internal function. 2026-06-04 11:09:41 +00:00
raspithek 3f85cd6dd8 bin/measure_temp.sh aktualisiert
typos
2026-06-02 11:19:43 +00:00
raspithek 939da6f3dc fixed Tmax bug. 2026-05-21 12:22:55 +00:00
olli 3d68686a96 fio uses all cores of the system. 2026-02-27 09:14:32 +01:00
6 changed files with 68 additions and 12 deletions
+8
View File
@@ -0,0 +1,8 @@
if [ -z ${PISTRESS_HOME} ]; then
export PISTRESS_HOME=/home/pi/git/pistress
fi
export THERMAL_ZONE=/sys/class/thermal/thermal_zone0/temp
export FIO_NUMJOBS=$(nproc)
export FIO_RUNNING_TIME=3600
+12 -2
View File
@@ -1,5 +1,15 @@
# pistress
A bunch of scripts for measuring the core temperature of the Raspberry Pi 5 CPU under full load
A bunch of scripts for measuring the core temperature of any single board computer's CPU under full load
and plotting graphs .
Requirements: fio, gnuplot
== Installation ==
sudo apt install -y fio gnuplot
cp .pistressrc ~
Edit ~/.pistressrc and canfigure values for your needs.
== Licence ==
Licenced under MIT Licence See file LICENCE
+23 -3
View File
@@ -7,10 +7,30 @@ usage() {
cat <<-EOF
Usage: ${name} [-h || --help]
measures the pu core temperature an echoes with a squenence number to stdout.
measures the cpu's core temperature and writes it with a timestamp to stdout.
EOF
}
#format the temperature to float value
format_temp() {
ftemp=${1:0:2}
ftemp+="."
ftemp+=${1:2:1}
echo "${ftemp}"
}
#retrieve the cpu's temperature from /sys/class/thermal/thermal_zone0/temp
measure_temp() {
cpu_temp=$(cat ${THERMAL_ZONE})
formatted_temp=$(format_temp "${cpu_temp}")
echo "${formatted_temp}"
}
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
usage
exit 0
@@ -19,8 +39,8 @@ fi
while true; do
NOW=$(date +%s)
TS=$((NOW - START))
TEMP=$(vcgencmd measure_temp | sed 's/[^0-9.]//g')
echo "$TS $TEMP"
TEMP=$(measure_temp)
echo "${TS} ${TEMP}"
sleep 1
done
+4 -4
View File
@@ -1,5 +1,5 @@
#!/bin/bash
VERSION="1.00"
#! /usr/bin/env bash
VERSION="1.04"
usage() {
local name=${0##*/}
@@ -33,7 +33,7 @@ fi
verbose=false
COLOR='red'
PADDING=5
PADDING=0
VALID_ARGS=$(getopt -o vho:c:t:l: --long verbose,help,output,color:,title:,logfile: -- "$@")
if [[ $? -ne 0 ]]; then
@@ -121,6 +121,6 @@ plot LOGFILE using 1:2 with lines lc rgb COLOR lw 2 title 'CPU-Temperatur';
"
echo "Plot erzeugt: $OUTFILE"
echo "Plot generated: ${OUTFILE}"
exit 0
+19 -1
View File
@@ -1,5 +1,23 @@
#! /usr/bin/env bash
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
if [ -z "${1}" ]; then
echo "usage run-cpu-stress.sh <logfile>"
exit 1
fi
measure_temp.sh > ${1} &
TPID=$!
fio ~/git/pistress/fio/fio_cpu
fio ${PISTRESS_HOME}/fio/fio_cpu
kill $TPID > /dev/null
unset FIO_NUMJOBS
+2 -2
View File
@@ -2,10 +2,10 @@
ioengine=cpuio
cpuload=100
cpuchunks=100000
runtime=3600
runtime=${FIO_RUNNING_TIME}
time_based
group_reporting
numjobs=4
numjobs=${FIO_NUMJOBS}
[cpu-stress]