Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 34d8ba7214 | |||
| 954e387544 | |||
| f22b2a8e82 | |||
| e9da74e3c8 | |||
| fb803c13f0 | |||
| b8c8a18db3 | |||
| 87540bf04b |
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
*.log
|
||||||
|
bin/minimal_test.sh
|
||||||
|
|
||||||
|
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
# pistress
|
# pistress
|
||||||
|
|
||||||
Measure the CPU core temperature on a Raspberry Pi on full load
|
A bunch of scripts for measuring the core temperature of the Raspberry Pi 5 CPU under full load
|
||||||
|
and plotting graphs .
|
||||||
|
Requirements: fio, gnuplot
|
||||||
|
|||||||
26
bin/measure_temp.sh
Executable file
26
bin/measure_temp.sh
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
START=$(date +%s)
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
local name=${0##*/}
|
||||||
|
|
||||||
|
cat <<-EOF
|
||||||
|
Usage: ${name} [-h || --help]
|
||||||
|
|
||||||
|
measures the pu core temperature an echoes with a squenence number to stdout.
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
NOW=$(date +%s)
|
||||||
|
TS=$((NOW - START))
|
||||||
|
TEMP=$(vcgencmd measure_temp | sed 's/[^0-9.]//g')
|
||||||
|
echo "$TS $TEMP"
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
@@ -1,12 +1,27 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
local name=${0##*/}
|
||||||
|
|
||||||
|
cat <<-EOF
|
||||||
|
Usage: ${name} [-h || --help] <logfile> <outfile> <title>
|
||||||
|
|
||||||
|
Generates graph of the <logfile> and writes it to <outfile>
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Eingabeparameter
|
# Eingabeparameter
|
||||||
LOGFILE="${1}"
|
LOGFILE="${1}"
|
||||||
OUTFILE="${2}"
|
OUTFILE="${2}"
|
||||||
TITLE="${3}"
|
TITLE="${3}"
|
||||||
|
|
||||||
if [ -z "$LOGFILE" ] || [ -z "$OUTFILE" ] || [ -z "$TITLE" ]; then
|
if [ -z "$LOGFILE" ] || [ -z "$OUTFILE" ] || [ -z "$TITLE" ]; then
|
||||||
echo "Usage: ${0} <temp.log> <output.png> <title>"
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,39 +1,33 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ACTIVE_LOG="${1}"
|
ACTIVE_LOG="$1"
|
||||||
ICE_LOG="${2}"
|
ICE_LOG="$2"
|
||||||
OUTFILE="${3}"
|
OUTFILE="$3"
|
||||||
TITLE="${4}
|
TITLE="$4"
|
||||||
|
|
||||||
if [ -z "${ACTIVE_LOG}" ] || [ -z "${ICE_LOG}" ] || [ -z "${OUTFILE}" ]; then
|
if [ -z "${ACTIVE_LOG}" ] || [ -z "${ICE_LOG}" ] || [ -z "${OUTFILE}" ]; then
|
||||||
echo "Usage: $0 <temp_active.log> <temp_ice.log> <output.png>"
|
echo "Usage: $0 <temp_active.log> <temp_ice.log> <output.png> [title]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
echo "ACTIVE_LOG=${ACTIVE_LOG}"
|
||||||
|
echo "ICE_LOG=${ICE_LOG}"
|
||||||
|
echo "OUTFILE=${OUTFILE}"
|
||||||
|
echo "TITLE=${TITLE}"
|
||||||
|
|
||||||
gnuplot <<EOF
|
gnuplot -e "
|
||||||
set terminal pngcairo size 1800,800
|
set terminal pngcairo size 1800,800;
|
||||||
set output "${OUTFILE}"
|
set output '${OUTFILE}';
|
||||||
|
set multiplot layout 1,2 title '${TITLE}';
|
||||||
|
set xlabel 'Zeit (s)';
|
||||||
|
set ylabel 'Temperatur (°C)';
|
||||||
|
set grid;
|
||||||
|
set key top left;
|
||||||
|
set yrange [0:100];
|
||||||
|
set title 'Active Cooler';
|
||||||
|
plot '${ACTIVE_LOG}' using 1:2 with lines lc rgb 'red' lw 2 title 'CPU-Temperatur';
|
||||||
|
set title 'Ice Tower Cooler 5';
|
||||||
|
plot '${ICE_LOG}' using 1:2 with lines lc rgb 'blue' lw 2 title 'CPU-Temperatur';
|
||||||
|
unset multiplot;
|
||||||
|
"
|
||||||
|
|
||||||
set multiplot layout 1,2 title "${TITLE}"
|
|
||||||
|
|
||||||
set xlabel "Zeit (s)"
|
|
||||||
set ylabel "Temperatur (°C)"
|
|
||||||
set grid
|
|
||||||
set key top left
|
|
||||||
|
|
||||||
# Einheitliche Y-Achse für fairen Vergleich
|
|
||||||
set yrange [30:90]
|
|
||||||
|
|
||||||
# Plot 1: Active Cooler
|
|
||||||
set title "Active Cooler"
|
|
||||||
plot "$I{ACTIVE_LOG}" using 1:2 with lines lc rgb "red" lw 2 title "CPU-Temperatur"
|
|
||||||
|
|
||||||
# Plot 2: Ice Tower Cooler
|
|
||||||
set title "Ice Tower Cooler 5"
|
|
||||||
plot "${ICE_LOG}" using 1:2 with lines lc rgb "blue" lw 2 title "CPU-Temperatur"
|
|
||||||
|
|
||||||
unset multiplot
|
|
||||||
EOF
|
|
||||||
|
|
||||||
echo "Vergleichsplot erzeugt: ${OUTFILE}"
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
5
bin/run-cpu-stress.sh
Executable file
5
bin/run-cpu-stress.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
temp_data.sh > temp.log &
|
||||||
|
TPID=$!
|
||||||
|
fio fio/fio_cpu
|
||||||
|
kill $TPID
|
||||||
|
|
||||||
Reference in New Issue
Block a user