ci: fix merge veristat cache generation

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
This commit is contained in:
Daniel Hodges 2024-08-19 18:30:32 -07:00
parent d7cc4f30f0
commit 40bb003555
2 changed files with 16 additions and 13 deletions

View File

@ -66,7 +66,7 @@ jobs:
### END DEPENDENCIES ###
# The actual build:
- run: meson setup build -Dkernel=$(pwd)/linux -Dkernel_headers=./linux/usr/include
- run: meson setup build -Dkernel=$(pwd)/linux -Dkernel_headers=./linux/usr/include -Dveristat_diff_dir=~/veristat
- run: meson compile -C build --jobs=1
# Print CPU model before running the tests (this can be useful for
@ -83,8 +83,7 @@ jobs:
- run: meson compile -C build veristat_diff
# update veristat cache dirs
- run: rm -rf ~/veristat/*.csv || echo 'nothing to clean'
- run: cp *.csv ~/veristat/
- run: cd ~/veristat && for file in *_new.csv; do mv "$file" "${file%_new.csv}.csv"; done
- name: Save veristat cache
id: cache-veristat-save

View File

@ -21,13 +21,15 @@ if [ -n "${SCHED}" ]; then
echo "Running veristat on ${BPF_PATH}"
if [ -n "${KERNEL}" ]; then
timeout --preserve-status ${GUEST_TIMEOUT} \
vng --force-9p -v --user root -r ${KERNEL} -- \
veristat ${BPF_PATH} -o csv > "${SCHED}.csv"
vng --force-9p -v --rwdir "${DIFF_DIR}" --user root -r ${KERNEL} -- \
veristat ${BPF_PATH} -o csv > "${DIFF_DIR}/${SCHED}_new.csv" \
|| echo "failed to verify ${SCHED}: ${BPF_PATH}"
if [ -n "${DIFF_DIR}" ]; then
timeout --preserve-status ${GUEST_TIMEOUT} \
vng --force-9p -v --user root -r ${KERNEL} -- \
veristat -C "${SCHED}.csv" "${DIFF_DIR}/${SCHED}.csv" \
-e file,prog,verdict,insns
vng --force-9p -v --rwdir "${DIFF_DIR}" --user root -r ${KERNEL} -- \
veristat -C "${DIFF_DIR}/${SCHED}_new.csv" "${DIFF_DIR}/${SCHED}.csv" \
-e file,prog,verdict,insns \
|| echo "failed to compare ${SCHED}: ${BPF_PATH}"
fi
exit $?
else
@ -45,13 +47,15 @@ for BPF_PATH in $(find ${BUILD_DIR} -type f -name bpf.bpf.o); do
SCHED=$(echo "${BPF_PATH}" | sed 's/.*\/rust\///g' | sed 's/\/.*//g')
if [ -n "${KERNEL}" ]; then
timeout --preserve-status ${GUEST_TIMEOUT} \
vng --force-9p -v --user root -r ${KERNEL} -- \
veristat ${BPF_PATH} -o csv > "${SCHED}.csv"
vng --force-9p -v --rwdir "${DIFF_DIR}" --user root -r ${KERNEL} -- \
veristat ${BPF_PATH} -o csv > "${DIFF_DIR}/${SCHED}_new.csv" \
|| echo "failed to verify ${SCHED}: ${BPF_PATH}"
if [ -n "${DIFF_DIR}" ]; then
timeout --preserve-status ${GUEST_TIMEOUT} \
vng --force-9p -v --user root -r ${KERNEL} -- \
veristat -C "${SCHED}.csv" "${DIFF_DIR}/${SCHED}.csv" \
-e file,prog,verdict,insns
vng --force-9p -v --rwdir "${DIFF_DIR}" --user root -r ${KERNEL} -- \
veristat -C "${SCHED}_new.csv" "${DIFF_DIR}/${SCHED}.csv" \
-e file,prog,verdict,insns \
|| echo "failed to compare ${SCHED}: ${BPF_PATH}"
fi
else
echo "saving veristat diff for ${SCHED}.csv"