ovni/test/rt/nosv/yield-noisy-l4.driver.sh
Rodrigo Arias c847ec19ad Add noisy yield test in nOS-V
Ensure we can call nosv_yield in a loop without generating a lot of
events when using the level 3 instrumentation level. Noisy events are
now moved to level 4, so they shouldn't appear on the trace.
Additionally, make sure that the noisy events appear on level 4.
2025-03-21 16:57:44 +01:00

39 lines
833 B
Bash

target=$OVNI_TEST_BIN
# We will set our own
unset NOSV_CONFIG
unset NOSV_CONFIG_OVERRIDE
export NOSV_APPID=1
cat > nosv.toml << EOF
instrumentation.version = "ovni"
ovni.level = 4
EOF
$target
. ./vars.sh
# We need to sort the trace as it has unsorted regions
ovnisort ovni
# Ensure we get a lot of VA[yY] and VS[nN] events. We need to make sure that all
# events are matched.
ovnitop ovni | awk -v n=$nyields \
'/^VA[Yy]/ { \
/* Match the number or nosv_yield calls exactly */
if ($2 == n) { print $0, "OK"; ok++ }
else { print $0, "BAD" }
} \
/^VS[Nn]/ { \
/* Use 2% for the non-blocking scheduler events */
if ($2 > 0.02 * n) { print $0, "OK"; ok++ }
else { print $0, "BAD" }
} END {
/* Be sure we matched the 4 rules */
if (ok != 4) { exit 1 }
}'
# Avoid emulation as may be huge