Commit c61e92a7 authored by Krzysztof Chruściński's avatar Krzysztof Chruściński Committed by Fabio Baltieri
Browse files

samples: boards: nordic: coresight_stm: Improve benchmark



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: default avatarKrzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
parent c2454f2a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;                                                                                 \
	})