Skip to content

Commit c6253fb

Browse files
dcpleungioannisg
authored andcommitted
tests: latency_measure: fix mis-matched timing start/stop calls
Inside the semaphore tests, there are mis-matched pair of timing start/stop calls. One called start without calling stop, another one calling stop twice. So fix them. Signed-off-by: Daniel Leung <[email protected]>
1 parent d489765 commit c6253fb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/benchmarks/latency_measure/src/sema_test_signal_release.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ void thread_sema_test1(void *p1, void *p2, void *p3)
4444
int sema_context_switch(void)
4545
{
4646
uint32_t diff;
47+
48+
bench_test_start();
4749
timing_start();
4850

4951
k_thread_create(&thread_one_data, thread_one_stack,
@@ -63,6 +65,8 @@ int sema_context_switch(void)
6365
diff = timing_cycles_get(&timestamp_start_sema_g_c, &timestamp_end_sema_g_c);
6466
PRINT_STATS("Semaphore give time (context switch)", diff);
6567

68+
timing_stop();
69+
6670
return 0;
6771
}
6872

@@ -121,6 +125,6 @@ int sema_test_signal(void)
121125
error_count++;
122126
PRINT_OVERFLOW_ERROR();
123127
}
124-
timing_stop();
128+
125129
return 0;
126130
}

0 commit comments

Comments
 (0)