From 1dcb3f482253f5b8c486cfd69e024b5057f7487c Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Fri, 11 Apr 2025 15:14:35 +0200 Subject: [PATCH] Check ovniemu -b works without can_breakdown set Ensure that we can successfully process a trace that has nOS-V threads without the can_breakdown flag set to true. We simply don't enable the nOS-V breakdown, but other models can enable it. --- test/emu/nosv/CMakeLists.txt | 3 ++- test/emu/nosv/cannot-breakdown.c | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 test/emu/nosv/cannot-breakdown.c diff --git a/test/emu/nosv/CMakeLists.txt b/test/emu/nosv/CMakeLists.txt index 832159b..dcfe850 100644 --- a/test/emu/nosv/CMakeLists.txt +++ b/test/emu/nosv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024 Barcelona Supercomputing Center (BSC) +# Copyright (c) 2022-2025 Barcelona Supercomputing Center (BSC) # SPDX-License-Identifier: GPL-3.0-or-later test_emu(attach.c) @@ -18,6 +18,7 @@ test_emu(require-missing.c NAME flag-enable-all DRIVER "flag-enable-all.driver.sh" REGEX "all .* models are enabled") +test_emu(cannot-breakdown.c BREAKDOWN REGEX "WARN: cannot enable breakdown for nOS-V model") test_emu(parallel-tasks.c) test_emu(nest-to-parallel.c) test_emu(mutex.c) diff --git a/test/emu/nosv/cannot-breakdown.c b/test/emu/nosv/cannot-breakdown.c new file mode 100644 index 0000000..c8cc15e --- /dev/null +++ b/test/emu/nosv/cannot-breakdown.c @@ -0,0 +1,26 @@ +/* Copyright (c) 2025 Barcelona Supercomputing Center (BSC) + * SPDX-License-Identifier: GPL-3.0-or-later */ + +#include +#include "instr_nosv.h" + +/* Test that we can request the -b flag but still have threads that don't have + * the nosv.can_breakdown attribute set to true. OpenMP may enable the breakdown + * on its own. */ + +int +main(void) +{ + instr_start(0, 1); + /* Don't enable nosv model via instr_nosv_init() as that would set the + * nosv.can_breakdown to 1 */ + instr_require("nosv"); + ovni_attr_set_boolean("nosv.can_breakdown", 0); + + /* Emit a nosv event */ + instr_nosv_type_create(666); + + instr_end(); + + return 0; +}