From 70f34e9e33246e2b23c91a51f4008d98ba2df918 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Fri, 22 Mar 2024 15:35:46 +0100 Subject: [PATCH] Fail fibonacci test on nOS-V kernel warnings Some threads may fail to enable the kernel instrumentation by reaching the memory lock limit, causing the kernel instrumentation to be disabled without any error in the emulation. To prevent this situation, we run the test manually and check that there are no warnings during the execution. --- test/rt/nodes/CMakeLists.txt | 2 +- test/rt/nodes/fibonacci.driver.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 test/rt/nodes/fibonacci.driver.sh diff --git a/test/rt/nodes/CMakeLists.txt b/test/rt/nodes/CMakeLists.txt index 2ac3b66..ab91816 100644 --- a/test/rt/nodes/CMakeLists.txt +++ b/test/rt/nodes/CMakeLists.txt @@ -61,7 +61,7 @@ nodes_rt_test(taskiter.c SORT) include(CheckPerfParanoid) if (PERF_PARANOID_KERNEL) message(STATUS "Enabling perf paranoid tests for NODES") - nodes_rt_test(fibonacci.c SORT LEVEL 3) + nodes_rt_test(fibonacci.c SORT LEVEL 3 DRIVER "fibonacci.driver.sh") elseif(ENABLE_ALL_TESTS) message(FATAL_ERROR "Cannot enable perf paranoid tests for NODES") else() diff --git a/test/rt/nodes/fibonacci.driver.sh b/test/rt/nodes/fibonacci.driver.sh new file mode 100644 index 0000000..e8cbbc5 --- /dev/null +++ b/test/rt/nodes/fibonacci.driver.sh @@ -0,0 +1,19 @@ +target=$OVNI_TEST_BIN + +$target 2>stderr.log + +# Ensure no nOS-V warnings at runtime +if grep -c "cannot enable kernel events" stderr.log; then + echo "cannot enable kernel events in all threads" >&2 + exit 1 +fi + +# We need to sort the trace as it has unsorted regions +ovnisort ovni + +# Ensure we have at least a pair of kernel CS events +ovnitop ovni | grep KCO +ovnitop ovni | grep KCI + +# Run the emulator +ovniemu -l ovni