Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meson: Add veristat script #488

Merged
merged 1 commit into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions meson-scripts/veristat
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
GUEST_TIMEOUT=25
BUILD_DIR=$1
SCHED=$2
KERNEL=$3

if [ "${KERNEL}" == "vmlinuz" ]; then
unset KERNEL
fi

cd $build_dir

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 --force-9p -v -r ${KERNEL} -- \
veristat ${BPF_PATH}
exit $?
else
sudo veristat ${BPF_PATH}
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 --force-9p -v -r ${KERNEL} -- \
veristat ${BPF_PATH}
exit $?
else
sudo veristat ${BPF_PATH}
exit $?
fi
done
8 changes: 8 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ serialize = get_option('serialize')

bpf_clang = find_program(get_option('bpf_clang'))

run_veristat = find_program(join_paths(meson.current_source_dir(),
'meson-scripts/veristat'))

enable_stress = get_option('enable_stress')

veristat_scheduler = get_option('veristat_scheduler')

if enable_rust
cargo = find_program(get_option('cargo'))
endif
Expand Down Expand Up @@ -323,6 +328,9 @@ endif

run_target('test_sched', command: [test_sched, kernel])

run_target('veristat', command: [run_veristat, meson.current_build_dir(),
get_option('veristat_scheduler'), get_option('kernel')])

if enable_rust
subdir('rust')
endif
Expand Down
2 changes: 2 additions & 0 deletions meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ option('enable_stress', type: 'boolean', value: 'true',
description: 'Enable stress tests')
option('kernel', type: 'string', value: 'vmlinuz',
description: 'kernel image used to test schedulers')
option('veristat_scheduler', type: 'string', value: '',
description: 'veristat scheduler to test')
option('kernel_headers', type: 'string', value: '',
description: 'kernel headers to build the schedulers')
option(
Expand Down