diff --git a/src/emu/player.c b/src/emu/player.c index a3dcca5..3d19e01 100644 --- a/src/emu/player.c +++ b/src/emu/player.c @@ -73,6 +73,9 @@ check_clock_gate(struct trace *trace) struct stream *stream; DL_FOREACH(trace->streams, stream) { + if (!stream->active) + continue; + struct ovni_ev *oev = stream_ev(stream); int64_t sclock = stream_evclock(stream, oev); diff --git a/test/emu/ovni/CMakeLists.txt b/test/emu/ovni/CMakeLists.txt index a0fbe6b..6d3412a 100644 --- a/test/emu/ovni/CMakeLists.txt +++ b/test/emu/ovni/CMakeLists.txt @@ -17,3 +17,4 @@ test_emu(no-cpus.c SHOULD_FAIL REGEX "loom .* has no physical CPUs") test_emu(sort-cpus-by-loom.c MP) test_emu(sort-cpus-by-rank.c MP) test_emu(tracedir-subdir.c MP DRIVER "tracedir-subdir.driver.sh") +test_emu(empty-stream.c SHOULD_FAIL REGEX "model_ovni_finish: thread .* is not dead") diff --git a/test/emu/ovni/empty-stream.c b/test/emu/ovni/empty-stream.c new file mode 100644 index 0000000..2570b5a --- /dev/null +++ b/test/emu/ovni/empty-stream.c @@ -0,0 +1,19 @@ +/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC) + * SPDX-License-Identifier: GPL-3.0-or-later */ + +#include +#include "instr.h" + +/* Create a trace where a stream doesn't contain any event */ + +int +main(void) +{ + instr_start(0, 1); + + /* Don't flush the thread to create an empty stream */ + + ovni_proc_fini(); + + return 0; +}