From 6b1a3207dd5d82c25751acce3b851a07590ce35f Mon Sep 17 00:00:00 2001 From: Peter Mitsis Date: Wed, 13 Dec 2023 15:40:35 -0500 Subject: [PATCH] tests: Fix bias adjustment in latency_measure Updates the non-blocking semaphore and mutex benchmark sub-tests in the latency_measure benchmark to remove the timestamp bias adjustment. As the timestamps are not sampled during each iteration of those sub-tests, there is no need to correct for any bias from the sampling. Signed-off-by: Peter Mitsis --- tests/benchmarks/latency_measure/src/mutex_lock_unlock.c | 2 -- tests/benchmarks/latency_measure/src/sema_test_signal_release.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/tests/benchmarks/latency_measure/src/mutex_lock_unlock.c b/tests/benchmarks/latency_measure/src/mutex_lock_unlock.c index 5ab52b43dcd..2f78f45d386 100644 --- a/tests/benchmarks/latency_measure/src/mutex_lock_unlock.c +++ b/tests/benchmarks/latency_measure/src/mutex_lock_unlock.c @@ -91,7 +91,6 @@ int mutex_lock_unlock(uint32_t num_iterations, uint32_t options) k_thread_start(&start_thread); cycles = timestamp.cycles; - cycles -= timestamp_overhead_adjustment(options, options); k_sem_give(&pause_sem); snprintf(description, sizeof(description), @@ -101,7 +100,6 @@ int mutex_lock_unlock(uint32_t num_iterations, uint32_t options) false, ""); cycles = timestamp.cycles; - cycles -= timestamp_overhead_adjustment(options, options); snprintf(description, sizeof(description), "Unlock a mutex from %s thread", diff --git a/tests/benchmarks/latency_measure/src/sema_test_signal_release.c b/tests/benchmarks/latency_measure/src/sema_test_signal_release.c index e5ea2b72992..7610200332c 100644 --- a/tests/benchmarks/latency_measure/src/sema_test_signal_release.c +++ b/tests/benchmarks/latency_measure/src/sema_test_signal_release.c @@ -253,7 +253,6 @@ int sema_test_signal(uint32_t num_iterations, uint32_t options) /* 5. Retrieve the number of cycles spent giving the semaphore */ cycles = timestamp.cycles; - cycles -= timestamp_overhead_adjustment(options, options); snprintf(description, sizeof(description), "Give a semaphore (no waiters) from %s thread", @@ -273,7 +272,6 @@ int sema_test_signal(uint32_t num_iterations, uint32_t options) /* 9. Retrieve the number of cycles spent taking the semaphore */ cycles = timestamp.cycles; - cycles -= timestamp_overhead_adjustment(options, options); snprintf(description, sizeof(description), "Take a semaphore (no blocking) from %s thread",