-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a meson script to run veristat. This can later be used to generate reports for BPF program complexity at PR time. Signed-off-by: Daniel Hodges <[email protected]>
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters