scx/meson-scripts/veristat
likewhatevs bf68679d35
Setup "debugging" and misc cleanup (#695)
* Fix a couple of misc errors in build scripts.
* Tweak scripts/kconfigs to make bpftrace work.
* Update how CI caching works to make builds faster (6 minute turnaround
  time)
* Update CI config to generate per-scheduler debug archives w/ guest
  dmesg/scheduler stdout, guest stdout, bpftrace script output,
  veristat output.

* Update build scripts to accept the following:
** VNG RW -- write to host filesystem (better caching, logging).
* For stress tests in particular (via ini config):
** QEMU Opts -- to facilitate reproducing bugs (i.e. high core count).
** bpftrace scripts -- specify bpftrace scripts to run during stress
tests.
2024-09-26 11:11:10 -04:00

48 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
GUEST_TIMEOUT=25
BUILD_DIR=$1
SCHED=$2
KERNEL=$3
VNG_RW_ARG=$4
if [ "${KERNEL}" == "vmlinuz" ]; then
unset KERNEL
fi
VNG_RW=''
if [ "${VNG_RW_ARG}" == "VNG_RW=true" ]; then
VNG_RW=' --rw '
fi
cd $BUILD_DIR || exit 1
if [ -n "${KERNEL}" ] && [ ! -x `which vng` ]; then
echo "vng not found, please install virtme-ng to enable testing"
exit 1
fi
if [ -n "${SCHED}" ]; then
BPF_PATH=$(find ${BUILD_DIR} -type f -name bpf.bpf.o | grep ${SCHED})
echo "Running veristat on ${BPF_PATH}"
if [ -n "${KERNEL}" ]; then
timeout --preserve-status ${GUEST_TIMEOUT} \
vng --user root -m 10G --cpu 8 -v --user root -r ${KERNEL} -- \
sudo veristat ${BPF_PATH} 2>&1 | tee veristat.ci.log
exit $?
else
sudo veristat ${BPF_PATH} 2>&1 | tee veristat.ci.log
exit $?
fi
fi
for BPF_PATH in $(find ${BUILD_DIR} -type f -name bpf.bpf.o); do
if [ -n "${KERNEL}" ]; then
timeout --preserve-status ${GUEST_TIMEOUT} \
vng --user root -m 10G --cpu 8 $VNG_RW -v --user root -r ${KERNEL} -- \
sudo veristat ${BPF_PATH} 2>&1 | tee "$(basename "${BPF_PATH}")-veristat.ci.log"
else
echo "$BPF_PATH"
sudo veristat ${BPF_PATH} 2>&1 | tee "$(basename "${BPF_PATH}")-veristat.ci.log"
fi
done