Skip to content

Commit

Permalink
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.

(cherry picked from commit c61e92a)

Original-Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
GitOrigin-RevId: c61e92a
Cr-Build-Id: 8735619482632649473
Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8735619482632649473
Copybot-Job-Name: zephyr-main-copybot-downstream
Change-Id: I136adbe43562fdd914485da1c53272c58e4df046
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5896230
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Tested-by: Fabio Baltieri <fabiobaltieri@google.com>
  • Loading branch information
nordic-krch authored and Chromeos LUCI committed Sep 27, 2024
1 parent 977ced6 commit ba920d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion samples/boards/nordic/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 ba920d5

Please sign in to comment.