Add emu breakdown test for zero values

This commit is contained in:
Rodrigo Arias 2023-03-24 19:31:35 +01:00 committed by Rodrigo Arias Mallo
parent 999a79b074
commit c30a5d94b5
2 changed files with 53 additions and 0 deletions

View File

@ -10,3 +10,5 @@ test_emu(ss-mismatch.c SHOULD_FAIL
REGEX "thread [0-9]\\+ ended with 1 stacked nanos6 subsystems") REGEX "thread [0-9]\\+ ended with 1 stacked nanos6 subsystems")
test_emu(delayed-connect-ss.c) test_emu(delayed-connect-ss.c)
test_emu(switch-same-type.c) test_emu(switch-same-type.c)
test_emu(breakdown-no-black.c BREAKDOWN)

View File

@ -0,0 +1,51 @@
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#include <stdio.h>
#include "common.h"
#include "emu/emu_prv.h"
#include "instr.h"
#include "instr_nanos6.h"
/* This test attempts to create holes in the breakdown trace by creating a
* thread that emits the first Nanos6 event later than the ovni thread execute
* event OHx. When the breakdown model is enabled, the output breakdown PRV
* trace should contain already a value for time=0, which is when OHx is
* emitted. We also test that on 6W[ we emit another non-zero state.
*
* . .
* OHx 6W[
* --------------x--------------x--------------> time
* . .
* . .
* breakdown ----A--------------B--------------
* . .
*
* We check that A and B are not emitting 0. */
int
main(void)
{
instr_start(0, 1);
/* Match the PRV line in the trace */
FILE *f = fopen("match.sh", "w");
if (f == NULL)
die("fopen failed:");
/* Ensure non-zero for A (first event) */
fprintf(f, "grep ':%ld:%d:[^0][0-9]*$' ovni/nanos6-breakdown.prv\n",
get_delta(), PRV_NANOS6_BREAKDOWN);
instr_nanos6_worker_loop_enter();
/* And for B */
fprintf(f, "grep ':%ld:%d:[^0][0-9]*$' ovni/nanos6-breakdown.prv\n",
get_delta(), PRV_NANOS6_BREAKDOWN);
instr_nanos6_worker_loop_exit();
instr_end();
return 0;
}