Skip to content

Commit

Permalink
[nrf fromtree] samples: boards: nordic: coresight_stm: Improve benchmark
Browse files Browse the repository at this point in the history
Add interrupt locking during test to ensure that main thread is not
interrupts which would impact the test.

Add longer sleep time between tests to ensure that all logs are
processed on time and not dropped.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit c61e92a)
  • Loading branch information
nordic-krch authored and nordic-segl committed Sep 30, 2024
1 parent 4322f51 commit 0684fbd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion samples/boards/nrf/coresight_stm/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ LOG_MODULE_REGISTER(app);

#define TEST_LOG(rpt, item) \
({ \
uint32_t key = irq_lock(); \
uint32_t t = k_cycle_get_32(); \
for (uint32_t i = 0; i < rpt; i++) { \
__DEBRACKET item; \
} \
t = k_cycle_get_32() - t; \
k_msleep(200); \
irq_unlock(key); \
k_msleep(400); \
t; \
})

Expand Down

0 comments on commit 0684fbd

Please sign in to comment.