Skip to content

Commit

Permalink
Ensures that reperf runners are finalized after each iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
sfstewman authored and katef committed Dec 1, 2020
1 parent 1dff40b commit f0df55b
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/retest/reperf.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,13 +696,13 @@ perf_case_run(struct perf_case *c, enum halt halt,
}
}

ret = ERROR_NONE;

if (c->mt != MATCH_NONE) {
struct timespec t0, t1;

xclock_gettime(&t0);

ret = ERROR_NONE;

for (iter=0; iter < c->count; iter++) {
int r;

Expand All @@ -721,21 +721,18 @@ perf_case_run(struct perf_case *c, enum halt halt,
str_free(&contents);
}

if (ret != ERROR_NONE) {
fsm_runner_finalize(&runner);
return ret;
}

xclock_gettime(&t1);
if (ret == ERROR_NONE) {
xclock_gettime(&t1);

report_delta(&t->run_delta, &t0, &t1);
report_delta(&t->run_delta, &t0, &t1);
}
}

done:

fsm_runner_finalize(&runner);

return ERROR_NONE;
return ret;
}

static void
Expand Down

0 comments on commit f0df55b

Please sign in to comment.