builds and runs on intel-x86 and rpi4 with acceptable realtime performance

This commit is contained in:
vaughn committed 2026-09-25 17:29:14 -04:00
1 parent 2bce6fa556
commit 3faf544f0b
120 files changed
+6317 -1

No files matched your search

+90
View File
@@ -0,0 +1,90 @@
#!/bin/sh
##modifiable variables
#high-level parameters
runtime=3600
corelist=-1
interval=200
full_test=0
do_stress=1
mode="svg"
out_dir=$(pwd)
#stress parameters
c_hogs=2
v_hogs=2
v_mem="128M"
d_hogs=1
i_hogs=2
#constants
start_dir=$(pwd)
work_dir="/tmp/tuned"
hist_max=400
#handle optional arguments
#end option handling
c_str=""
v_str=""
d_str=""
i_str=""
if [ $c_hogs -gt 0 ]; then
c_str="-c $c_hogs"
fi
if [ $v_hogs -gt 0 ]; then
v_str="--vm $v_hogs --vm-bytes $v_mem"
fi
if [ $d_hogs -gt 0 ]; then
d_str="-d $d_hogs"
fi
if [ $i_hogs -gt 0 ]; then
i_str="-i $i_hogs"
fi
n_intervals=$(($runtime*1000000/$interval))
mkdir -p $work_dir && cd $work_dir
if [ $do_stress = 1 ]; then
stress $c_str $v_str $d_str $i_str -t $((runtime+1)) &
fi
sudo cyclictest -m -t -a2-3 -c1 -p98 -i$interval -h$hist_max -l$n_intervals --mainaffinity=0 -q >output
max=`grep "Max Latencies" output | tr " " "\n" | sort -n | tail -1 | sed s/^0*//`
grep -v -e "^#" -e "^$" output | tr " " "\t" >histogram
ncores=2
fn="plot."$mode
for j in `seq 1 $ncores`
do
column=`expr $j + 1`
cut -f1,$column histogram >histogram$j
done
echo -n -e "set title \"Latency plot\"\n\
set terminal $mode\n\
set xlabel \"Latency (us), max $max us\"\n\
set logscale y\n\
set xrange [0:$hist_max]\n\
set yrange [0.8:*]\n\
set ylabel \"Number of latency samples\"\n\
set output \"$fn\"\n\
plot " >plotcmd
for j in `seq 1 $ncores`
do
if test $j != 1
then
echo -n ", " >>plotcmd
fi
cpuno=`expr $j - 1`
if test $cpuno -lt 10
then
title=" CPU$cpuno"
else
title="CPU$cpuno"
fi
echo -n "\"histogram$j\" using 1:2 title \"$title\" with histeps" >>plotcmd
done
gnuplot -persist <plotcmd
cp $fn $out_dir
cd $start_dir
rm -rf $work_dir
+46
View File
@@ -0,0 +1,46 @@
LICENSE = "CLOSED"
#MY_FILES =
#LIC_FILES_CHKSUM = "file://cf/install-sh;beginline=6;endline=16;md5=6c39b6a36ad775d09cc9ee0e33fe9e6c"
SRC_URI = "file://lat-plot \
"
# python3targetconfig: configuration for the target machine is accessible (such as correct installation directories)
# autotools-brokensep: autotools build process (without support for building outside of ${S})
# pkgconfig: standard way to get header and library information by using pkg-config
#inherit autotools-brokensep pkgconfig python3native
# Modify these as desired
PV = "0.1"
#SRCREV = "bcbf35634ccf49ff39261b291f01ca0c4a5fddd5"
#S = "${WORKDIR}/git"
# LinuxCNC build separation is broken, so we need to build in src
#B = "${S}/src"
S = '${UNPACKDIR}'
TARGET_CC_ARCH += " ${LDFLAGS}"
#######################################################
# autotools fixes
#######################################################
#AUTOTOOLS_SCRIPT_PATH = "${B}"
# We need to replace autotools_preconfigure with our own, because it deletes ${B} otherwise
# since S != B in our case (but B is still *inside* S)
#DEPENDS += " tk8 tcl8 tcl8-native tk8-native freetype"
RDEPENDS:${PN} += " rt-tests gnuplot stress"
#RDEPENDS:${PN} += "cairo pango gd"
#PREFERRED_VERSION:tk8 = "8.6.%"
#RDEPENDS:${PN}-dev += " tk8 "
#inherit autotools
FILES:${PN} += " /lat-plot;/usr/bin/lat-plot \
"
FILES:${PN}-dev = " "
FILES:${PN}-dbg = " "
do_install () {
install -m 777 ${UNPACKDIR}/lat-plot ${D}/lat-plot
}