refactoring the build system

This commit is contained in:
Tonton Th
2025-01-05 00:41:14 +01:00
parent 5b7ad96a29
commit d89876b633
5 changed files with 238 additions and 0 deletions

56
tools/plot-timing.sh Executable file
View File

@@ -0,0 +1,56 @@
#!/bin/bash
set -ue
TMPFILE="/dev/shm/plot-timing.tmp"
IMAGE="timing.png"
echo ; figlet "plot timing" ; echo
wc WS/mp4.timing | tee -a WS/log
grep "passage" WS/mp4.timing | awk ' \
BEGIN { \
nbrames=360; \
for (foo=0; foo<nbrames; foo++) { \
mini[foo] = 666; \
maxi[foo] = -42; \
count[foo] = 0; \
} \
} \
\
{ \
accu[$2] += $3; \
count[$2]++; \
if (mini[$2] > $3) mini[$2] = $3; \
if (maxi[$2] < $3) maxi[$2] = $3; \
} \
\
END { \
for (foo=0; foo<nbrames; foo++) { \
if (count[foo] > 0) { \
mean = accu[foo] / count[foo]; \
printf "%4d %4f %4d %4d\n", foo, mean, \
mini[foo], maxi[foo]; \
} \
} \
} \
' > $TMPFILE
# cat -n $TMPFILE | tail # ; exit
gnuplot << __EOC__
set term png size 1024,768
set output "timing.png"
set grid
set xrange [:360]
set yrange [0:]
set title "HexaCone : temps de rendu"
set xlabel "numéro de la trame"
set ylabel "temps en secondes"
plot "/dev/shm/plot-timing.tmp" u 1:4 w l t "maximum", \
"/dev/shm/plot-timing.tmp" u 1:3 w l t "minimum", \
"/dev/shm/plot-timing.tmp" u 1:2 w l t "moyenne",
__EOC__
convert -negate $IMAGE WS/negatif.png